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

can use analog pin for digital
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Ttelmah



Joined: 11 Mar 2010
Posts: 19451

View user's profile Send private message

PostPosted: Sat Nov 27, 2010 9:42 am     Reply with quote

He is using the 18F252, which doesn't have this. However the 2520, which is 'pin compatible', lower power, and cheaper, does, and on RA5!...
Definately a good idea.

Best Wishes
hayee



Joined: 05 Sep 2007
Posts: 252

View user's profile Send private message

PostPosted: Sun Nov 28, 2010 10:45 pm     Reply with quote

PIC18f252 have "LVDIN" pin at PIN RA5
Is has a same feature as described by bkamen "HLVD".
Can i use that pin for my required purpose?


what datasheet says if i select the value of LVDL3:LVDL0 (1111) then External analog pin is used
So what will be the reference/comparing voltage
like if i select the LVDL3:LVDL0 value (1110) then when voltage below 4.5v-4.77v it generates an interrupt
what will the case for LVDL3:LVDL0 value (1111)

I have searched the forum, I only got codes for internal LVD interrupt caused by the Vdd,
Can anyone show me sample program for external LVD interrupts.
Ttelmah



Joined: 11 Mar 2010
Posts: 19451

View user's profile Send private message

PostPosted: Mon Nov 29, 2010 5:11 am     Reply with quote

Yes.
The LVDIN input, is basically a comparator, which triggers an interrupt, if the pin drops below a particular voltage. You would have to setup a pair of resistors, to give the right switch 'point' for what you want. The trip point is 1.2v at the pin.
_Read the data sheet_. Every bit of what you have asked is in this

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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