Serial Communication
eduardomorais
Posts: 11
Hello everybody!
I'm new in using the serial communication board ... especially ussando parallax.
I would write a program in which parallax to receive a byte sent from the computer, store it in a buffer and returns this byte back to the computer.
Even seemingly simple ... I'm lot of trouble!
I tried the following program, but did not work.
Does anyone have any idea?
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
VAR
byte buffer[16]
OBJ
pc: "Parallax Serial Terminal"
PUB Main
pc.StartRxTx(31, 30, 0, 9600)
repeat
pc.StrIn(@MyData)
pc.Str(@MyData)
waitcnt(clkfreq + cnt)
DAT
MyData byte 16
I'm new in using the serial communication board ... especially ussando parallax.
I would write a program in which parallax to receive a byte sent from the computer, store it in a buffer and returns this byte back to the computer.
Even seemingly simple ... I'm lot of trouble!
I tried the following program, but did not work.
Does anyone have any idea?
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
VAR
byte buffer[16]
OBJ
pc: "Parallax Serial Terminal"
PUB Main
pc.StartRxTx(31, 30, 0, 9600)
repeat
pc.StrIn(@MyData)
pc.Str(@MyData)
waitcnt(clkfreq + cnt)
DAT
MyData byte 16
Comments
Should work now.
The following program works:
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
OBJ
pc: "Parallax Serial Terminal"
PUB Main
pc.StartRxTx(31, 30, 0, 9600)
repeat
pc.StrIn(@MyData)
pc.Str(@MyData)
waitcnt(clkfreq + cnt)
DAT
MyData byte 16
Anyway thanks Kye.