The following code seems to work except that the SerReceive reads the first bit only and not the entire byte. Any suggestions on what I'm doing wrong.
;Chip Settings
#chip 12F629,4
;Defines (Constants)
#define RecAHigh GPIO.0 On
#define RecALow GPIO.0 Off
;Variables
Dim Address As byte
Dim Addr As byte
Address = 173
InitSer (1, r2400, 1+WaitForStart, 8, 1, None, Normal)
Dir GPIO.0 In
Dir GPIO.1 Out
Dir GPIO.2 Out
Main:
SerReceive (1, Addr)
Wait 4 ms
If Addr = Address Then
PulseOut GPIO.1, 3 ms
Goto Main
End If
Wait 1 ms
PulseOut GPIO.2, 3 ms
Goto Main
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The following code seems to work except that the SerReceive reads the first bit only and not the entire byte. Any suggestions on what I'm doing wrong.
;Chip Settings
#chip 12F629,4
;Defines (Constants)
#define RecAHigh GPIO.0 On
#define RecALow GPIO.0 Off
;Variables
Dim Address As byte
Dim Addr As byte
Address = 173
InitSer (1, r2400, 1+WaitForStart, 8, 1, None, Normal)
Dir GPIO.0 In
Dir GPIO.1 Out
Dir GPIO.2 Out
Main:
SerReceive (1, Addr)
Wait 4 ms
If Addr = Address Then
PulseOut GPIO.1, 3 ms
Goto Main
End If
Wait 1 ms
PulseOut GPIO.2, 3 ms
Goto Main