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.
But after some time, I find figure 2. That means there must be some goust IOC interrupt?????
Who can help?
With kind regards
Jan Lichtenbelt
IOC error
Moderator: Benj
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: IOC error
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
Re: IOC error
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.
Jan Lichtenbelt
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.
Jan Lichtenbelt
- Jan Lichtenbelt
- Posts: 797
- Joined: Tue Feb 17, 2009 8:35 pm
- Location: Haren GN, the Netherlands
- Has thanked: 128 times
- Been thanked: 264 times
- Contact:
Re: IOC error
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.
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
But the first IOC has been missed by the microchip. That is curious! The pulse hight is 4.7 Volt.
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