Hello,
I've noticed that on the PIC 16F18326, interrupts always trigger on both edges when a falling edge is set. This applies to the IOC and INT pins.
Regards
PIC16F18326 Interrupt error
-
DirkB
- Posts: 104
- http://meble-kuchenne.info.pl
- Joined: Thu Dec 10, 2020 3:55 pm
- Has thanked: 1 time
- Been thanked: 4 times
-
mnfisher
- Valued Contributor
- Posts: 1936
- Joined: Wed Dec 09, 2020 9:37 pm
- Has thanked: 157 times
- Been thanked: 911 times
Re: PIC16F18326 Interrupt error
Can you post a simple demo showing this?
Looking at the datasheet - bits are set in IOCxP and IOCxN for rising and falling edge interrupts - both to detect both.
I added an IOC interrupt to a chart and selected some pins (the 'selection' image is too small - and I couldn't find keys to enlarge it) - then looking at the code generated:
Which looks okay?
Martin
Looking at the datasheet - bits are set in IOCxP and IOCxN for rising and falling edge interrupts - both to detect both.
I added an IOC interrupt to a chart and selected some pins (the 'selection' image is too small - and I couldn't find keys to enlarge it) - then looking at the code generated:
Code: Select all
// Interrupt
st_bit(INTCON,GIE);
IOCAP=0x28;
IOCAN=0x18;
IOCCP=0x0;
IOCCN=0x0;
st_bit(PIE0, IOCIE);
Martin