When I wrote the code like this and individually went through each 0 and 1 bits it outputted fine on the pin
start:
low fan_tx
PulsOut Fan_tx, 35
pauseus 330
pulsout fan_tx, 66
pauseus 660
pulsout fan_tx, 33
pauseus 330
pulsout fan_tx, 66
pauseus 330
pulsout fan_tx, 66
pauseus 660
pulsout fan_tx, 33
pauseus 660
pulsout fan_tx, 33
pauseus 660
pulsout fan_tx, 33
pauseus 660
pulsout fan_tx, 33
pauseus 660
pulsout fan_tx, 33
pauseus 660
pulsout fan_tx, 33
pauseus 660
pulsout fan_tx, 33
pauseus 330
pulsout fan_tx, 66
pauseus 100
goto start
Now when I try to simplify it, I'm not getting any output with the following code from PORTD.5:
RF VAR bit[12]
c VAR byte 'number of times to send data stream (loop)
b VAR byte 'RF(b) stream (loop)
Output_TX VAR PORTD.5
Main:
'lead-in pulse of 350uS followed by
'Data to output: 010011111110
RF[0]=0
RF[1]=1
RF[2]=0
RF[3]=0
RF[4]=1
RF[5]=1
RF[6]=1
RF[7]=1
RF[8]=1
RF[9]=1
RF[10]=1
RF[11]=0
Low Output_TX
For c = 1 To 4 'number of times to send data stream
PulsOut Output_TX, 35 '350uS lead-in pulse
For b = 0 To 11
If RF[b] = 0 Then
PauseUs 330 '330uS space
PulsOut Output_TX, 66 '660uS pulse
Else
PauseUs 660 '660uS space
PulsOut Output_TX, 33 '330uS pulse
EndIf
Next
Pause 40 '40mS GAP in between each copy
Next
Sleep 2 'Wait 2 seconds before sending data again
GoTo Main
Am I missing something here?
Bookmarks