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

CLC ISR

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



Joined: 08 Sep 2020
Posts: 221

View user's profile Send private message

CLC ISR
PostPosted: Fri Mar 24, 2023 5:48 am     Reply with quote

CCS C 5.115
PIC18F57Q43

I came with new question. I want to use CLC ISR.

Code:

#INT_CLC1
void CLC1_isr(void)
{

}
enable_interrupts(INT_CLC1);
enable_interrupts(GLOBAL);

is it use this codes enough ?

What I want to do is let CLC1 enter the ISR when it approaches the falling edge in PIN_A0 input. How can I do?
_________________
Best Regards...
MCUprogrammer
_______________________________
Work Hard
temtronic



Joined: 01 Jul 2010
Posts: 9102
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Mar 24, 2023 6:20 am     Reply with quote

OK, don't have a new enough compiler but still
curious, I looked at the datasheet..
chapter 22 CLC is pretty easy to follow
use PPS to select the pin
configure the CLC as a 4 input AND gate with A0 only ?
configure for -ve edge
enable the interrupt

I've never used CLC but it looks like a great peripheral.

BTW sure seems a shame to use the entire CLC for just this 'single pin interrupt'.
MCUprogrammer



Joined: 08 Sep 2020
Posts: 221

View user's profile Send private message

PostPosted: Fri Mar 24, 2023 7:05 am     Reply with quote

I same idea. But I have to use. Because it is incoming signal 500ns. Very speed. CLC is this signal very easily capture.
_________________
Best Regards...
MCUprogrammer
_______________________________
Work Hard
Ttelmah



Joined: 11 Mar 2010
Posts: 19219

View user's profile Send private message

PostPosted: Fri Mar 24, 2023 8:31 am     Reply with quote

There are eight CLC modules on that chip, so using one isn't a great loss.
Obviously, it won't be when "it approaches the falling edge", but when the
falling edge happens. However INT_EXT_H2L will do exactly the same job,
with INT_EXT PPS selected to pin A0. That has a 25nSec minimum
detection time.
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Fri Mar 24, 2023 12:15 pm     Reply with quote

Just a question. Why you open a new thread with the same issue?

https://www.ccsinfo.com/forum/viewtopic.php?t=59986
Same author, same issue.
_________________
Humberto
MCUprogrammer



Joined: 08 Sep 2020
Posts: 221

View user's profile Send private message

PostPosted: Sat Mar 25, 2023 12:10 am     Reply with quote

humberto there is nothing incomprehensible. then i wasn't planning to use interrupt. I'm also sorry for the effort you went through to find this detail. Anyway, let's give you a reward. you got me. i didn't understand the purpose
_________________
Best Regards...
MCUprogrammer
_______________________________
Work Hard
Ttelmah



Joined: 11 Mar 2010
Posts: 19219

View user's profile Send private message

PostPosted: Sat Mar 25, 2023 4:15 am     Reply with quote

However I still cannot see why you would want to use he CLC for this?.
Gains nothing. In fact the CLC latency is added to the interrupt response
time, so the handling will be slower than just using one of the standard
interrupts. Given that this chip allows these to be PPS mapped, seems
pointless, unless you need more interrupts than are available.
MCUprogrammer



Joined: 08 Sep 2020
Posts: 221

View user's profile Send private message

PostPosted: Sat Mar 25, 2023 5:27 am     Reply with quote

Only IOC interrupt I will using. I will not using CLC. The 500ns signal is easily captured by the IOC interrupt.
_________________
Best Regards...
MCUprogrammer
_______________________________
Work Hard
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Sat Mar 25, 2023 9:55 am     Reply with quote

MCUprogrammer, the incomprehensible thing is on your own, I never said something similar.
For your information, I didn't make any effort, the first thread is on the same page, just a few lines below your last post,
and both by the same author (you). It was not so difficult.
This is one of the best forums on the subject due to the quality of its content and does not have a full-time administrator.
We all know that doing a search with a keyword, will hardly find an expected result.
For this and other reasons, we users must do a minimum effort in these details that are irrelevant to you but not to me.
_________________
Humberto
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