Help with input output

Status
Not open for further replies.

rskumar89

New Member
Hi
I have written a code to operate leds when the trigger is applied at port.A1.
and when it detects the trigger i want it to send a pulse to RB3 first then RB2.
Pulse duration to be 1 sec.
But when i connect the circuit i dont get outputs at RB3 and RB2.
To trouble shoot i inserted a line in the program to start an led as soon as the trigger is applied at RB1.

Pls help friends...


the problem is that the leds at RB2 and RB3 are not flashing.


cheers,
Linus
 
Last edited:

hi,
The problem is with the delay routines, the program gets stuck in an infinite loop.

When I take out the delays, B2 and B3 flash once, then the program runs off the end.
 
but then each of the delay routine correspond to 1 sec since i use a 4MHz crystal.
now if i take the delay off the flashing would be fast.
how do i make a one sec delay ?
 
but then each of the delay routine correspond to 1 sec since i use a 4MHz crystal.
now if i take the delay off the flashing would be fast.
how do i make a one sec delay ?

hi,
Google for PICloops calculator copy and paste the code and call the subr when you want the delay.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…