PIC 16F886 Interrupt on Change Not Working.
Posted: Wed Jun 24, 2015 7:44 pm
This is for a ham radio transmitter-receiver operating on the HF bands (160 through to 6 metres).
The attached program is intended to provide an SPI and a parallel interface from a 4-bit word received by PORT B(3..6).
The program is woken by a change in the value of these bits and should then provide its outputs.
It works fine switching between any of the lower bands, but does not work for 15, 12, 10 and 6 metres.
The input table is...
Band control on portB:-
Band B6 B5 B4 B3
160 1 0 0 0
80 0 1 0 0
60 1 1 0 0
40 0 0 1 0
30 1 0 1 0
20 0 1 1 0
17 1 1 1 0
15 0 0 0 1
12 1 0 0 1
10 0 1 0 1
6 1 1 0 1
So B3 would seem to be implicated.
The PIC is run at +5v and the inputs switch between +50mV and +3.2V.
If I switch between any of 160 to 17 all works fine.
If I switch between any of these and 15 to 6, nothing changes; if I then switch back to any of 160 to 17, it works fine again.
For clarity, a sequence might go like this:
select 160 (160 output OK); select 40 (40 output OK); select 10 (still outputting 40); select 80 (80 output OK); select 20 (20 output OK).
I have another input on portB(7) that I can toggle. If bands 15 - 6 are selected it does not have any effect. If bands 160 to 17 are selected it works fine. It is as if portB(3) were inhibiting circuit operation. I have checked for shorts.
I have built 3 of these boards and all fail the same.
The attached program is intended to provide an SPI and a parallel interface from a 4-bit word received by PORT B(3..6).
The program is woken by a change in the value of these bits and should then provide its outputs.
It works fine switching between any of the lower bands, but does not work for 15, 12, 10 and 6 metres.
The input table is...
Band control on portB:-
Band B6 B5 B4 B3
160 1 0 0 0
80 0 1 0 0
60 1 1 0 0
40 0 0 1 0
30 1 0 1 0
20 0 1 1 0
17 1 1 1 0
15 0 0 0 1
12 1 0 0 1
10 0 1 0 1
6 1 1 0 1
So B3 would seem to be implicated.
The PIC is run at +5v and the inputs switch between +50mV and +3.2V.
If I switch between any of 160 to 17 all works fine.
If I switch between any of these and 15 to 6, nothing changes; if I then switch back to any of 160 to 17, it works fine again.
For clarity, a sequence might go like this:
select 160 (160 output OK); select 40 (40 output OK); select 10 (still outputting 40); select 80 (80 output OK); select 20 (20 output OK).
I have another input on portB(7) that I can toggle. If bands 15 - 6 are selected it does not have any effect. If bands 160 to 17 are selected it works fine. It is as if portB(3) were inhibiting circuit operation. I have checked for shorts.
I have built 3 of these boards and all fail the same.