using pin 7 on 08m for and output

sbscott

Senior Member
I am building a fan controller and need to use pin 7. When I do, after removing the rs232 connector after programming, I get a a block of digital "1" (seen on my scope) which triggers the relay it operates. How do I "silence" pin 7 when in a "0" condition"
See code below.
Code:
'#08m  '4-1-2012

'out 0 fan
'out 2 camera
'b1 is therm
'b2 is pot
high 2
x:
debug b1
readadc 4,b1
readadc 1,b2
pause 100
if b1>b2 then gosub fanon
if bit2=1 then goto x
if b1<b2 then gosub fanoff
pause 500
goto x

fanon:
if bit1=1 then re
bit1=1
high 0
return

re:
return

fanoff:
low 0:bit1=0
bit2=1
return
thanks!
 

Technical

Technical Support
Staff member
It's the 'debug' sending out data - leg 7 is also the serial transmit. Simply remove the debug command.
 

nick12ab

Senior Member
I am assuming that pin7 works as the other output pins when debug is NOT turn on.
Like tony_g describes, yes, but high and low signals will also be transmitted on this pin when downloading a program or if the Serial In pin manages to become high before the disconnect command (if any) is issued. Some Rev-Ed project boards have a jumper switch on them to allow you to connect the output to the programming jack only and not the normal output pads, so you could re-use this idea if the quickly alternating output would be an issue while downloading.

Commands that require a bi-directional pin (such as readtemp) won't work either.

yep, i occasionally use pin 7...
Rev-Ed's convention is to call physical pins legs and to call pin names in BASIC pins.
To avoid confusion this manual always talks about &#8216;legs&#8217; where
referring to the external physical location of the input/output pin.
 
Top