Pulsin command
curtis
Posts: 19
Hello,
I put together an infrared detector circuit and a rs232 circuit in order to receive a value for each pulse sent by a pocket pc through its ir port. I used a logic probe to test the output·of the letter "A" from the PPC using serial code, I get the 8 bit binary representation of a "A". I tried to write some code to measure the pulses using the SXB and a sxtech board. All I get are zeros. I am using a VB6 program to aquire the data. Could someone help me with code below?
DEVICE········· SX28, OSCXT2, TURBO, STACKX, OPTIONX
FREQ··········· 4_000_000
' =========================================================================
' Vaiables
' =========================================================================
serByte········ VAR···· Byte(10)··················· ' serial IO byte
' =========================================================================
· PROGRAM Start
' =========================================================================
Start:
· ' initialization code here
goto main
Main:
pulsin RA.0,1,serByte(0)
pulsin RA.0,1,serByte(1)
pulsin RA.0,1,serByte(2)
pulsin RA.0,1,serByte(3)
pulsin RA.0,1,serByte(4)
pulsin RA.0,1,serByte(5)
pulsin RA.0,1,serByte(6)
pulsin RA.0,1,serByte(7)
pulsin RA.0,1,serByte(8)
pulsin RA.0,1,serByte(9)
serout RA.1,T9600,serByte
Pause 1000
GOTO Main
Thanks,
Curtis
·
I put together an infrared detector circuit and a rs232 circuit in order to receive a value for each pulse sent by a pocket pc through its ir port. I used a logic probe to test the output·of the letter "A" from the PPC using serial code, I get the 8 bit binary representation of a "A". I tried to write some code to measure the pulses using the SXB and a sxtech board. All I get are zeros. I am using a VB6 program to aquire the data. Could someone help me with code below?
DEVICE········· SX28, OSCXT2, TURBO, STACKX, OPTIONX
FREQ··········· 4_000_000
' =========================================================================
' Vaiables
' =========================================================================
serByte········ VAR···· Byte(10)··················· ' serial IO byte
' =========================================================================
· PROGRAM Start
' =========================================================================
Start:
· ' initialization code here
goto main
Main:
pulsin RA.0,1,serByte(0)
pulsin RA.0,1,serByte(1)
pulsin RA.0,1,serByte(2)
pulsin RA.0,1,serByte(3)
pulsin RA.0,1,serByte(4)
pulsin RA.0,1,serByte(5)
pulsin RA.0,1,serByte(6)
pulsin RA.0,1,serByte(7)
pulsin RA.0,1,serByte(8)
pulsin RA.0,1,serByte(9)
serout RA.1,T9600,serByte
Pause 1000
GOTO Main
Thanks,
Curtis
·
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax