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 CCS Technical Support

18F16Q41 IOC error

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
bdeb



Joined: 05 Nov 2010
Posts: 42
Location: Sweden

View user's profile Send private message Visit poster's website

18F16Q41 IOC error
PostPosted: Sun Mar 26, 2023 9:36 am     Reply with quote

uP=18F16Q41, CCS=5.115 + 5.107, IDE=MPLAB 6.0, OS=Win10

Dear code gods,
For once I may be offering a solved problem! Laughing


After *several* nights tracking nasty problems with interrrupt-from-sleep from IOC, this is what I found:

Using disable_interrupts(any_ioc_pin) will brutally clear PIE0.7 i.e. IOCIE!


Apart from that, the (frugally documented) IOC functions work excellent!

enable_interrupts(INT_IOC_C3_H2L) will set bit 3 in IOCCN.

enable_interrupts(INT_IOC_C4_H2L) will set bit 4 in IOCCN without clobbering bit 3, etc.

(enable_interrupts(INT_IOC_C4) will enable both edges)


Furthermore interrupt_active(INT_IOC_C3_H2L) will test IOCCF bit 3.



Happy if someone could verify this, so I'm not misleading.


All the best:

/BdeB
Ttelmah



Joined: 11 Mar 2010
Posts: 19537

View user's profile Send private message

PostPosted: Mon Mar 27, 2023 12:59 am     Reply with quote

Well done.

I think the lack of documentation, is the big problem with these.
Historically the interrupt enable/disables were simple. Just physical interrupts.
Then they 'evolved', with the addition of the abilities to control/detect the
extra bits for IOC. Unfortunately this evolution has never really been
documented. There have been some threads here as people found what
could/was being done.
You have given us the best overview so far on these. Very Happy
bdeb



Joined: 05 Nov 2010
Posts: 42
Location: Sweden

View user's profile Send private message Visit poster's website

PostPosted: Mon Mar 27, 2023 7:16 am     Reply with quote

Dear Ttelmah, thank you for your kind words!

I'll better report this directly to CCS, right?


All the best:

/BdeB
Ttelmah



Joined: 11 Mar 2010
Posts: 19537

View user's profile Send private message

PostPosted: Mon Mar 27, 2023 8:42 am     Reply with quote

It's not a fault, just a lack of documentation. The disable just disables the
whole interrupt involved.
There are lot of areas where their documentation has gone 'backwards'.
For example, the 'readme' with each compiler is no longer updated.
This is another example.
Perhaps they do need a 'kick' to bring the documentation up to date...
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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