View previous topic :: View next topic |
Author |
Message |
MCUprogrammer
Joined: 08 Sep 2020 Posts: 221
|
CLC ISR |
Posted: Fri Mar 24, 2023 5:48 am |
|
|
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: 9221 Location: Greensville,Ontario
|
|
Posted: Fri Mar 24, 2023 6:20 am |
|
|
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
|
|
Posted: Fri Mar 24, 2023 7:05 am |
|
|
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: 19496
|
|
Posted: Fri Mar 24, 2023 8:31 am |
|
|
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
|
|
|
MCUprogrammer
Joined: 08 Sep 2020 Posts: 221
|
|
Posted: Sat Mar 25, 2023 12:10 am |
|
|
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: 19496
|
|
Posted: Sat Mar 25, 2023 4:15 am |
|
|
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
|
|
Posted: Sat Mar 25, 2023 5:27 am |
|
|
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
|
|
Posted: Sat Mar 25, 2023 9:55 am |
|
|
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. _________________ Humber |
|
|
|