PIC 16F886 Interrupt on Change Not Working.

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
jim_g
Posts: 22
Joined: Tue Jan 13, 2015 12:47 pm
Has thanked: 6 times
Been thanked: 8 times

PIC 16F886 Interrupt on Change Not Working.

Post by jim_g »

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.
Attachments
alexAdaptor.fcfx
(31.95 KiB) Downloaded 194 times

jim_g
Posts: 22
Joined: Tue Jan 13, 2015 12:47 pm
Has thanked: 6 times
Been thanked: 8 times

Re: PIC 16F886 Interrupt on Change Not Working.

Post by jim_g »

Oh, and I was so concentrating on describing the symptoms, I forgot to add, please has anyone any clues!

Cheers

Jim_g

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times

Re: PIC 16F886 Interrupt on Change Not Working.

Post by kersing »

According to the data sheet B3 shares a pin with PGM, enable low voltage programming. Do you have Low Voltage Programming enabled in the configuration settings by any chance? If so disable it to use the pin as digital input.
“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

jim_g
Posts: 22
Joined: Tue Jan 13, 2015 12:47 pm
Has thanked: 6 times
Been thanked: 8 times

Re: PIC 16F886 Interrupt on Change Not Working.

Post by jim_g »

Many thanks, Kersing, that fixed it.
Cheers, Jim

Post Reply