I've used the low voltage detect using the Microchip C18 compiler for both the 18F252 and the 18F6720. This compiler has no special instructions for it, but has the bitfield structures that let you set and clear bits as desired (just like assembly!). I pretty much just followed the step by step procedure in the chip datasheet for setting up the LVD. In one application, I just poll it to flash an LED when the battery is low. In another, I use the interrupt to save a little data to eeprom as the power dies. Harold > I haven't tried it, but I think it is just implemented as an interrupt: > > enable_interrupts(INT_LOWVOLT); > > #INT_LOWVOLT > void > lowvolt_isr (void) > { > .... > } > > You would have to set the LDVCON bits 3-0 directly. > > Bruce Partridge > http://www.rebreather.ca > >> -----Original Message----- >> From: pic microcontroller discussion list >> [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Brian Clewer >> Sent: Friday, January 09, 2004 1:45 AM >> To: PICLIST@MITVMA.MIT.EDU >> Subject: [PIC]:Low Voltage detect >> >> >> Hi all, >> Has anyone implemented the low voltage detect feature on the PIC 18F >> parts >> using the CCS compiler? As far as I can see, there are no instructions >> in >> the CCS manual for this. >> >> Brian. >> >> -- >> http://www.piclist.com hint: The PICList is archived three different >> ways. See http://www.piclist.com/#archives for details. >> --- >> Incoming mail is certified Virus Free. >> Checked by AVG anti-virus system (http://www.grisoft.com). >> Version: 6.0.558 / Virus Database: 350 - Release Date: 1/2/2004 >> > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.558 / Virus Database: 350 - Release Date: 1/2/2004 > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > -- FCC Rules Online at http://www.hallikainen.com -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.