How about this... (getting annoying isn't it?)
I commented out the encoding/decoding parts. Just sending a split up raw value now....see what happens...
'RECEIVE PIC
'same includes and defines as the other versions
temp var word : tempf var word : counter var byte : templo var byte
temphi var byte : input portb.2 : converts var byte[15] : convtemp var byte
converts[0] = $55 : converts[1] = $56 : converts[2] = $59
converts[3] = $5a : converts[4] = $65 : converts[5] = $66
converts[6] = $69 : converts[7] = $6a : converts[8] = $95
converts[9] = $96 : converts[10] = $99 : converts[11] = $9a
converts[12] = $a5 : converts[13] = $a6 : converts[14] = $a9
converts[15] = $aa : pause 1000
loop:
counter = counter + 1 : lcdout $fe , $c0 , "Waiting......" , DEC3 counter
waitfor55:
serin portb.2 , n2400 , temp : if temp <> $55 then goto waitfor55
waitforaa:
serin portb.2 , n2400 , temp : if temp <> $aa then goto waitforaa
serin portb.2 , n2400 , templo : serin portb.2 , n2400 , temphi
'for convtemp = 0 to 15
'if templo = converts[temp] then templo = convtemp
'if temphi = converts[temp] then temphi = convtemp
'next convtemp
temp = ( temphi << 4 ) + templo : tempf = temp * 9 : tempf = tempf / 5
tempf = tempf + 32
lcdout $fe , $80 , "Tc=" , DEC3 temp , "C,Tf=" , DEC3 tempf , "F."
lcdout $fe , $c0 , "Received....." , DEC3 count
goto loop
'TRANSMIT PIC
'same includes and defines as the other versions
'--------------------------------------------------------------------------
'remove the char_pacing value, with it in there, the RX will lose it's "training"
'-------------------------------------------------------------------------
counter var byte : temp var word : output portb.2 : high portb.2
input portb.3 : dq var portb.4 : templo var byte : temphi var byte
converts var byte[15] : converts[0] = $55 : converts[1] = $56
converts[2] = $59 : converts[3] = $5a : converts[4] = $65
converts[5] = $66 : converts[6] = $69 : converts[7] = $6a
converts[8] = $95 : converts[9] = $96 : converts[10] = $99
converts[11] = $9a : converts[12] = $a5 : converts[13] = $a6
converts[14] = $a9 : converts[15] = $aa : pause 1000
loop:
lcdout $fe , $c0 , "Getting......" , DEC3 count : owout DQ , 1 , [ $cc ]
owout DQ , 0 , [ $44 ] : Pause 500 : owout DQ , 1 , [ $cc ]
owout DQ , 0 , [ $be ]
owin DQ , 0 , [ temp.LOWBYTE , temp.HIGHBYTE , skip 6 ]
lcdout $fe , $80 , "Tc=" , DEC3 temp
lcdout $fe , $c0 , "Sending......" , DEC3 count
templo = temp.lowbyte & $f : temphi = temp.lowbyte >> 4
'templo = converts[templo] : temphi = converts[temphi]
serout portb.2 , n2400 , [ $55 , $55 , $55 , $55 , $aa ]
serout portb.2 , n2400 , [ templo , temphi ]
counter = counter + 1
goto loop
ok eee, seems to be working now, am I awake....
thank you thank you
i will try the wireless
what is this line for (was for , or intended to)
'templo = converts[templo] : temphi = converts[temphi]
Well, what program are you running right now? I changed some stuff and was about to post it...but if you say it's working correctly at both ends, then I'll go with that.... So, repost the program you're running now (if it works), so I can remember what the line above did.
using post 118
it works wireless,
does it have to do with the encoding technique ?
but most often its showing good temp.
could I add a 10v voltage regulator for the RF transmitter to boost up the signal ? I am using the rentron 433mhz chips tws
Glitches - Probably has to do with the encoding technique because the data isn't encoded (I commented that part out in post #118), but the 'training' bytes are encoded.
Maybe try to add a few more $55 to the serout line in the transmit section. And make sure the char_pacing isn't in the define sections anymore.
Bookmarks