View previous topic :: View next topic |
Author |
Message |
acel
Joined: 09 Aug 2018 Posts: 8
|
PIC18F05Q40 HLVD interrupt? |
Posted: Wed Jul 10, 2024 9:15 am |
|
|
PIC18f05Q40 için HLVD ABOVE ve BELOW kesme için örnek verir misiniz. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19495
|
|
Posted: Wed Jul 10, 2024 10:16 am |
|
|
Start by giving a correct part number PIC18F05Q40 does not exist....
Since this sort of peripheral differs chip to chip, we need to know
what chip you are using.
The forum really works normally in English. If you don't, get somebody or
a translation program to translate for you. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Wed Jul 10, 2024 11:41 am |
|
|
Google says....
Can you give an example for cutting?
which makes sense, he wants a code example. |
|
|
acel
Joined: 09 Aug 2018 Posts: 8
|
|
Posted: Thu Jul 11, 2024 12:44 am |
|
|
I am using the PIC18F05Q40 MCU and I need an example for HLVD (High/Low-Voltage Detection) interrupt. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19495
|
|
Posted: Thu Jul 11, 2024 2:13 am |
|
|
An example for LVD detect is here:
[url]
http://www.ccsinfo.com/forum/viewtopic.php?t=46389&highlight=hlvd
[/url]
HVD uses the same interrupt, and you just use LVD_TRIGGER_ABOVE
instead of the TRIGGER_BELOW.
Critical thing is you will always have to clear the interrupt before you
can enable it (clear_interrupts(INT_LVD);). You don't have to do it
manually as this code does. Reason is that this interrupt always gets
set on a power_on reset, unless you have an external reset circuit
that holds the chip in reset till the power is stable. The data sheet
warns that you have to do this.
Obviously you can only have high voltage detect or low voltage detect,
since there is only one set point. |
|
|
|