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

low volt interrupt

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



Joined: 27 Sep 2006
Posts: 11
Location: ITHACA,NY

View user's profile Send private message

low volt interrupt
PostPosted: Mon Feb 19, 2007 7:02 pm     Reply with quote

Hi, I'm using the 18F2455 PIC and trying to program the interrupt to trigger for low volt. It's not clear to me if I am using the correct input pin for the interrupt - I'm using pin 7 - HLVDIN. Is that the correct one?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Feb 19, 2007 7:41 pm     Reply with quote

Per the 18F2455 data sheet, the HLVDIN pin allows you to set your
own voltage trip point, rather than use one of the 15 available preset
voltages. As the data sheet shows, the HLVDIN voltage is set with
a voltage divider formed by two external resistors.

Remember, this module measures a change in the Pic's Vdd voltage,
not an external voltage.

See this thread for sample code for the 18F452:
http://www.ccsinfo.com/forum/viewtopic.php?t=24577
jmofthenorth



Joined: 27 Sep 2006
Posts: 11
Location: ITHACA,NY

View user's profile Send private message

thanks and a new question
PostPosted: Mon Feb 19, 2007 7:56 pm     Reply with quote

Thanks for the help now this makes a lot of sense, I was using it for the wrong application. Esstially I have an external voltage set to 5V, that will drop to 0 for approximately 100ns when a particular piece of equipment is triggered. do you have any suggestions for how to set this up?
I was thinking of something like...

while(input(pin_A5)!=0){;}

and then waiting for the trigger to be set, but I don't know if this will respond fast enough.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Feb 19, 2007 8:06 pm     Reply with quote

100 ns is way too short of a pulse for software polling. It's also too
short for the External Interrupt input. The data sheet says that the
minimum high or low time for an INT pin is Tcy. This is the instruction
cycle time, which is the oscillator frequency divided by 4.
So with an fast oscillator frequency of 40 MHz, the instruction clock
is 10 MHz. Therefore, Tcy is 100ns. You're right on the edge of
having an acceptable pulse duration.

What oscillator frequency are you planning to run the PIC at ?

Do you know for a fact that your incoming pulse is really only 100 ns
in duration ?
jmofthenorth



Joined: 27 Sep 2006
Posts: 11
Location: ITHACA,NY

View user's profile Send private message

PostPosted: Tue Feb 20, 2007 8:37 am     Reply with quote

Yes, I've measured the pulse width, it's an inverted TTL pulse 100ns in duration. My osc. is 20 MHz therefore it'll be way to short and I suppose I'll have to stretch it out.
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