Hi, Tim
Welcome aboard ...
YES there are lots of different ways ...
BUT ... we , at least, need to know which processor you use and what you already use as resources ...
Shortly ...
Your program ALSO is welcome ...
Alain
Hi, Tim
Welcome aboard ...
YES there are lots of different ways ...
BUT ... we , at least, need to know which processor you use and what you already use as resources ...
Shortly ...
Your program ALSO is welcome ...
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
timetec
Think about using the inbuilt hardware timer and its associated interrupt. With this, you can flash leds in the background. But, like Alain says, please tell us more about your selected PIC for this to be meaningful to you
Welcome aboard
Many thanks for the replies
The MCU is a 12F629, using all GPIO ports.
Here's the routine :
To monitor 2 momentary switch inputs, & enable an output (blinking an LED @ 2Hz), when a switch is pressed.
There is a seperate O/P for each corresponding switch.
If both outputs become active, a 3rd output toggles 10 seconds high and then reverts back to a low state -- the LED outputs are then reset.
All working perfectly, but I'm having to use FLED's on the outputs.
Hi, Tim
Sorry, but I do not understand what you want to do or actually do ... :
Blink outputs WHILE button pressed ?
Blink @ First press and stop @ second press ?
You talk about 2 Leds ???
... 2 inputs + 3 outputs + 2 Leds ...the LED outputs are then reset.
are more pins than available on the 629 ...
soooo ... PLEASE : Your program .... so we can understand what you do !
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
5 I/O are used - 2 switch inputs, 2 LED outputs, 1 'reset' output
Example :
Switch 1
Blink LED output IF the Switch 1 has been pressed - keep it blinking @ 2Hz
If Switch 1 pressed again, keep it blinking ! - exactly the same for Switch 2
If both LED outputs are active - send 10 second pulse to 3rd output pin.
Then reset all switches / LED's & start again.
http://www.picbasic.co.uk/forum/showthread.php?t=1742
Code and schematic are key....
Dave
Always wear safety glasses while programming.
Really sorry about the delay in getting this up - major problems with my one and only 12F629 - lost the 'OSCCAL' number when programming,
somehow...-- so re-compiled it for a 12F509.
It's long-winded I know, but it works with steady outputs in conjunction with 2 x FLEDS or flashing LED's.
In the listing, there are 4 lines of commented (tried & unused) code for a simple 250ms on - 250ms off, port toggle for each LED output.
Of course, this is useless, as the program spends all it's time, toggling outputs..
No components involved, other than a 3 resistors for LED's, if you want to put some on GPIO.2 / GPIO.4 & GPIO.5 as status indicators to 0V.
The 2 switch inputs are single-pole tactile types pulled active LOW.
Switch input pins are GPIO.0 & GPIO.1 - all pin details in the listing.
Just need to get 2 standard LED's flashing @2Hz on the outputs, without this affecting the switch input 'scan' routine.
Many thanks all![]()
Bookmarks