question on sx/b wait command
Hi
I don't know if this is the good way to do it but I 'd like to activate a relais during a certen time. I connected a rotary switchto the sx so a user can select numbers from 0 to 9. This I want to use as setting for the ammount of minuts. Then when a certain imput is low I start a loop where I activate an output witch is driving the relais. After that i placed a loop with the wait staitmend in it so I can calculate the time . It is working well with one but.
During de time the sx is in the loop with the wait, It is not reackting to aything else. I know it is because off the wait.
So is thier some other easy way with sx/b to drive an output·relais for a long time (several minuts, determend by the setting of a variable). And during that time still execute some other code??
I'm just a beginner so bear my stupidity.
Stef
·
I don't know if this is the good way to do it but I 'd like to activate a relais during a certen time. I connected a rotary switchto the sx so a user can select numbers from 0 to 9. This I want to use as setting for the ammount of minuts. Then when a certain imput is low I start a loop where I activate an output witch is driving the relais. After that i placed a loop with the wait staitmend in it so I can calculate the time . It is working well with one but.
During de time the sx is in the loop with the wait, It is not reackting to aything else. I know it is because off the wait.
So is thier some other easy way with sx/b to drive an output·relais for a long time (several minuts, determend by the setting of a variable). And during that time still execute some other code??
I'm just a beginner so bear my stupidity.
Stef
·
Comments
The easiest would be to make an interrupt routine that simply increments a WORD variable.
What clock speed are you using to run the SX ?
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap used 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
SX-Video Display Modules www.sxvm.com
Stuff I'm selling on ebay http://search.ebay.com/_W0QQsassZhittconsultingQQhtZ-1
"People who are willing to trade their freedom for·security deserve neither and will lose both." Benjamin Franklin
·
I'm running at 50Mhz. (external resonator)
What I like to do during the activation of the relais (during the wait command)
1 Still use the serial connection I set up. That one is working normaly but not during the wait command. It is for an serial LCD i connected .
2 Check some other imputs and reakt on them if they change.
3 Do some pulsoutput. That is still not working. I need to get an exact time/pulswith. I can't get that to work.
So during de time the output is driving the relais I don't want to wait· and do nothing. The chip has execute some other code during that time.
Stef