CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug Reports on this forum. Send them to support@ccsinfo.com

16F1503 IOC detects L2H when none specified
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Ttelmah



Joined: 11 Mar 2010
Posts: 12523

View user's profile Send private message

PostPosted: Sun Oct 22, 2017 12:25 pm     Reply with quote

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: 35
Location: Northeast USA

View user's profile Send private message

PostPosted: Sun Oct 22, 2017 1:12 pm     Reply with quote

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: 12523

View user's profile Send private message

PostPosted: Sun Oct 22, 2017 1:14 pm     Reply with quote

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: 35
Location: Northeast USA

View user's profile Send private message

PostPosted: Mon Oct 23, 2017 10:12 am     Reply with quote

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: 12523

View user's profile Send private message

PostPosted: Mon Oct 23, 2017 11:02 am     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group