I am creating a security system that triggers a 18M2 to count down from 10 to 0 on a (https://www.sparkfun.com/search/results?term=com-11644) and activates an 08M2. There is a 315Mhz receiver (http://www.adafruit.com/product/1096) as part of the system such that if the keyfob is pressed the countdown will halt and not activate the 08M2. The schematic is below along with the test code. The problem is that when not connected to the 18M2, the 315Mhz receiver output shows 4.18 volts when activated which should be high enough to register a logical "1" but when connected to the 18M2 pin B.2 gets no higher than 0.35 volt, much to low. Any suggestions as to how to get the output to reach a logical "1" level would be appreciated along with any code enhancements.
Going out for the evening and will check the post tomorrow morning CST.
Thanks for any help.
Berny
Going out for the evening and will check the post tomorrow morning CST.
Thanks for any help.
Berny
Code:
#picaxe 18m2
#no_data
#com 3
setfreq m8
symbol stp = c.2
symbol led = c.1
symbol stpflag = b0
symbol state = bit0
let b0 = 0
low b.3
symbol tx = c.0 'this is connected to RX on display
symbol baud = T9600_8 'serial baud rate
low c.2
setint %00000100,%00000100,c
high tx
serout tx, baud, (0x7F)
serout tx, baud, (0x02)
serout tx, baud, (0x7A ,0x100) 'set brightness to 1/2
main:
wait 1
goto main:
stpflag = 0
'serout tx, baud, (0x81) 'reset display to factory defaults
'pause 2000 'wait 1/2 second
'serout tx, baud, (0x76) 'clear display
'pause 20 'wait 10ms
'pause 2000 'wait 1 second
'serout tx, baud, (0x76) 'clear displ
interrupt:
pause 2000 'wait 1/2 second
serout tx, baud, (0x77,%00000010) 'set decimal point
serout tx, baud, ("10 ") 'set counter to 10 seconds
gosub chkflag:
pause 2000 'wait 1 second
serout tx, baud, (0x77,%00000010) 'set decimal point
serout tx, baud, (" 9 ")
gosub chkflag:
pause 2000
serout tx, baud, (0x77,%00000010) 'set decimal point
serout tx, baud, (" 8 ")
gosub chkflag:
pause 2000
serout tx, baud, (0x77,%00000010) 'set decimal point
serout tx, baud, (" 7 ")
gosub chkflag:
pause 2000
serout tx, baud, (0x77,%00000010) 'set decimal point
serout tx, baud, (" 6 ")
gosub chkflag:
pause 2000
serout tx, baud, (0x77,%00000010) 'set decimal point
serout tx, baud, (" 5 ")
gosub chkflag:
pause 2000
serout tx, baud, (0x77,%00000010) 'set decimal point
serout tx, baud, (" 4 ")
gosub chkflag:
pause 2000
serout tx, baud, (0x77,%00000010) 'set decimal point
serout tx, baud, (" 3 ")
gosub chkflag:
pause 2000
serout tx, baud, (0x77,%00000010) 'set decimal point
serout tx, baud, (" 2 ")
gosub chkflag:
pause 2000
serout tx, baud, (0x77,%00000010) 'set decimal point
serout tx, baud, (" 1 ")
gosub chkflag:
pause 2000
serout tx, baud, (0x77,%00000010) 'set decimal point
serout tx, baud, (" 0 ")
for b0 = 1 to 5 'trip BB servo
high led
pause 500
low led
pause 500
next b0
setint %00000100,%00000100,c
return
chkflag:
state = pinb.2
if pinb.3 <> state then
stpflag = 1
goto main
endif
setint %00000100,%00000100,c
return
Attachments
-
3 KB Views: 7