Pin high , Pin low
anita1984
Posts: 23
Hello Forum , i have a motor , one of the pin ( when the pin is low the motor is on , when the pin is high the motor is off )
Is it's good to write like this :
this will be in a code and i can call MotorOff or MotorOn , depends to my need
is this good method ?
Thank you Forum
Anita
Is it's good to write like this :
DAT org MotorOff mov dira,Pin mov outa,High MotorOn mov dira,Pin mov outa,#0 Pin long|<7 High long $FFFFFFFF
this will be in a code and i can call MotorOff or MotorOn , depends to my need
is this good method ?
Thank you Forum
Anita
Comments
or dira,Pin' this to set the pin output
or outa,Pin' this sets it high
andn outa,Pin' this sets it low
Or, Paul Baker has another way he recommends that I can't remember right off.
If you are setting these up as functions you have to have ret labels.
$0 through $1FF using "mov dest, #N"
$FFFFFFFF through $FFFFFE01 ($-1 through $-1FF) using "neg dest, #-N"
Thank you in advance
Anita
If the pin number is less than 9, you can use immediate operands