Page 1 of 1

IOC error

Posted: Mon Dec 12, 2016 3:35 pm
by Jan Lichtenbelt
I have problems with Interrupt On Change IOC with the 16F1847 microchip. So I started to test this IOC basic. That means an external oscillator gave pulse of about 1.5 msec each 20 msec on one of the B-ports (I tested B0 and B5 with the same behaviour). On each IOC the output level of pin A will change. In figure 1 you see at top B0 (Ch0) and lowest pin A2 (Ch1). It works as expected.
Clipboard01.jpg
Clipboard01.jpg (13.01 KiB) Viewed 3398 times
But after some time, I find figure 2. That means there must be some goust IOC interrupt?????
Clipboard02.jpg
Clipboard02.jpg (10.83 KiB) Viewed 3398 times
Who can help?

With kind regards

Jan Lichtenbelt
Test_IOC.fcfx
(6.21 KiB) Downloaded 225 times

Re: IOC error

Posted: Mon Dec 12, 2016 5:22 pm
by Benj
Hi Jan,

That's strange. I wonder in your interrupt can you add a decision to check if the value in A2 is equal to B5. If the values are different then you can set another output pin. Then set your scope to trigger on this new pin and hopefully that will allow you to see the signals when the glitch happens.

My guess is that two edges are coming in very close together so that one of the edges is missed by the interrupt because we are still processing the last interrupt.

Re: IOC error

Posted: Mon Dec 12, 2016 7:50 pm
by Jan Lichtenbelt
Hi Ben,

That is a good suggestion. Port A3 (ch2 in the figure) is high if the IOC port (ch0) differs from the ouptut port A2 (ch1). Now it is less often and I had to wait seconds to get a change of port A3. It seems at random in time.
Clipboard04.jpg
Clipboard04.jpg (17.3 KiB) Viewed 3380 times
Jan Lichtenbelt
Test_IOC_V2.fcfx
(7.05 KiB) Downloaded 260 times

Re: IOC error

Posted: Mon Dec 12, 2016 8:14 pm
by Jan Lichtenbelt
Here an other one. There is somethings curious. The oscilator is not stable (see ch0). But that is another problem?

But the first IOC has been missed by the microchip. That is curious! The pulse hight is 4.7 Volt.
Clipboard07.jpg
Clipboard07.jpg (19.48 KiB) Viewed 3380 times
To delete a possible error of the oscillator, I used a single switch on the IOC port. Then I do not see any error occurs. Perhaps we to forget this porblem.

Kind regards

Jan Lichtenbelt