View previous topic :: View next topic |
Author |
Message |
Ttelmah
Joined: 11 Mar 2010 Posts: 19219
|
|
Posted: Sun Oct 22, 2017 12:25 pm |
|
|
That is interesting.
Makes a 'sort of sense', if you think that the 'edge enables' are masks onto the physical interrupt. Does it perhaps wake on changes on other pins as well?. Worth testing.
Does the actual interrupt handler get called?. If not, then the mask is working for this, but not for the wake up. |
|
|
apakSeO
Joined: 07 Dec 2016 Posts: 60 Location: Northeast USA
|
|
Posted: Sun Oct 22, 2017 1:12 pm |
|
|
Thank you for the confirmation, PCM ... Although I am disheartened by this bug and nothing in the silicon errata explains it, it feels good to know I am not making some kind of novice, glaring mistake here in my code.
I will explore some kind of code work around on Monday, starting with guageguy's suggestion above.
Unfortunately I cannot move to another PIC16 ... this line of 16(L)F1503 is the only 3mm x 3mm package that fits into the product I am designing. I wonder if the 16LF1503 has the same issue ... I am going to order a few and test it out on my board, change the power supply to a 3.0V part, and report back here. What are the bets that the 16LF1503 has the same problem? I think the chances are rather high, but it seems worth investigating.
How does Microchip handle bug reports? How do you guys go through the official channels when a legitimate bug is found? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19219
|
|
Posted: Sun Oct 22, 2017 1:14 pm |
|
|
It is a fairly simple work-round.
You only need to test on wake up for the reason being what you want, and if not just go back to sleep. |
|
|
apakSeO
Joined: 07 Dec 2016 Posts: 60 Location: Northeast USA
|
|
Posted: Mon Oct 23, 2017 10:12 am |
|
|
Confirmed that the handler is being called for this, put a little pin-wiggle at the very start of the ISR, so I can confirm that this ISR is being called upon wakeup from falling- or rising edge.
Ttelmah wrote: | It is a fairly simple work-round.
You only need to test on wake up for the reason being what you want, and if not just go back to sleep. |
Isn't that what
Code: | if (interrupt_active(INT_IOC_A4_H2L)) { ... } |
is supposed to do by design? Check if the reason for wake-up was because of a falling edge?
From reading the datasheet, I cannot see another way to query whether a rising edge or falling edge caused the PIC to wake up. Is there another way?
Last edited by apakSeO on Mon Oct 23, 2017 11:18 am; edited 2 times in total |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19219
|
|
Posted: Mon Oct 23, 2017 11:02 am |
|
|
Just test it....
Record the input value for the port before you go to sleep.
Then don't have an interrupt handler!. Instead disable_interrupts(GLOBAL), but enable the specific interrupts you want to wake. This means it'll wake, but no handler will be called.
When the chip wakes, just compare the new value from the port to the old.
Key point is that 'yes' This is what the interrupt_active test is meant to test for, but the point is that the mask that handles this is not working for the wake up. So the wake up is occurring when the signal that 'feeds' the mask happens, rather than on an output from the mask, so you have to handle this yourself.
There is a master signal saying 'something has changed'. This feeds the mask, which then triggers the actual interrupt. It appears that it is this 'unmasked' signal that also feeds the wake up circuit. |
|
|
|