I currently read data from a radio link to the 18m2 base. The base uses an RTC for real time display.
Due to the blocking nature of serin, displayed time can be wrong, especially if received data is missed from the link.
I am hoping to overcome this with an interrupt request. The 18m2 code is
Request sent TO the 18m2 on pin c.1, and received serial in on pin c.7
The corresponding 08m2 code is
08m2 data received from link on c.1, IRQ when c.4 goes high, data out to 18m2 via c.2
Is this basically sound? I can't test fully at the moment due to lack of bits.
Would a pulseout be better on c.4
Do I need a pre-amble for the 08m2 to 18m2 link
All pointers would be appreciated.
Due to the blocking nature of serin, displayed time can be wrong, especially if received data is missed from the link.
I am hoping to overcome this with an interrupt request. The 18m2 code is
Code:
#picaxe18m2
setint %00000010,%00000010 'Enable interrupt on pin c.1
do
'
'Whatever
'
loop
interrupt:
serin c.1,n2400,b0,b1,b2
sertxd ("b0= ",#b0," b1= ",#b1," b2= ",#b2,cr,lf)
setint 010000010,%000000010
return
The corresponding 08m2 code is
Code:
#picaxe08m2
setfreq m4
symbol ANT=c.1 'Data in from RX
symbol INT=c.4 'Int request TO 18m2
symbol SER=c.2 ' Serial data TO 18m2
high ANT
do
serin ANT,T600,($AA,$BB,$CC), b0,b1,b2 'Get RX data
pause 200
High INT 'Send IRQ
pause 500
Low INT
serout SER,N2400,(b0,b1,b2) 'Send data
pause 200
sertxd ("b0= ",#b0," b1= ",#b1," b2= ",#b2,cr,lf)
pause 5000
loop
Is this basically sound? I can't test fully at the moment due to lack of bits.
Would a pulseout be better on c.4
Do I need a pre-amble for the 08m2 to 18m2 link
All pointers would be appreciated.