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

18f452 low voltage interrupt

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



Joined: 19 Feb 2005
Posts: 11
Location: new york usa

View user's profile Send private message

18f452 low voltage interrupt
PostPosted: Wed Sep 27, 2006 9:21 am     Reply with quote

I cant get the low voltage interrupt to work. I have a 5volt pot wiper to LVDIN pin A5. I used the wizard to make my project.

#include "C:\CCS Programs\New lowv3\lowv.h"
#include <LCD>
#int_LOWVOLT
LOWVOLT_isr()
{
printf(lcd_putc,"in int" );
}



void main()
{
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);
setup_spi(FALSE);
setup_wdt(WDT_OFF);
setup_timer_0(RTCC_INTERNAL);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_timer_3(T3_DISABLED|T3_DIV_BY_1);
lcd_init();
enable_interrupts(INT_LOWVOLT);
enable_interrupts(GLOBAL);
loop:
goto loop;

}





header:
#include <18F452.h>
#device adc=8
#use delay(clock=20000000)
#fuses NOWDT,WDT128,HS, NOPROTECT, NOOSCSEN, NOBROWNOUT, BORV45, NOPUT, NOSTVREN, NODEBUG, NOLVP, NOWRT, NOWRTD, NOWRTB, NOWRTC, NOCPD, NOCPB, NOEBTR, NOEBTRB
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Sep 27, 2006 10:18 am     Reply with quote

See this thread for a demo program for #int_lowvolt:
http://www.ccsinfo.com/forum/viewtopic.php?t=24577
tkidder



Joined: 19 Feb 2005
Posts: 11
Location: new york usa

View user's profile Send private message

low voltage detect
PostPosted: Wed Sep 27, 2006 11:34 am     Reply with quote

I tried suggested program. I get an error "setup_low_volt_detect ( )
is undefined.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Sep 27, 2006 11:56 am     Reply with quote

Quote:
I tried suggested program. I get an error "setup_low_volt_detect ( )
is undefined.

What's your compiler version ? That post was made on Sept. 29, 2005
so I probably used PCH vs. 3.235 to test it.

If you have an older version, you might not have support for that
function.
tkidder



Joined: 19 Feb 2005
Posts: 11
Location: new york usa

View user's profile Send private message

low voltage interrupt
PostPosted: Tue Oct 03, 2006 11:48 am     Reply with quote

I bought the latest compiler. Still cant get interrupt to occur.
Used the posted program as well as wizard generated project.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Oct 03, 2006 12:35 pm     Reply with quote

Do you mean that bought vs. 4.011 ? That's a beta version.
Most people would say, don't use it. Go to the download page
and get vs. 3.249. Then try your program again.
http://www.ccsinfo.com/compilerupdates.php

If, after doing that, it still doesn't work for you, then I'll test it
on a PicDem2-Plus board with an 18F452 and vs. 3.249.
tkidder



Joined: 19 Feb 2005
Posts: 11
Location: new york usa

View user's profile Send private message

low voltage interrupt
PostPosted: Thu Oct 05, 2006 6:02 am     Reply with quote

sorry my fault. I thought the interrupt would be triggered by an external voltage on the LVDIN pin. The int is actually caused by the voltage falling on the VDD to the chip.
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