Serial from dev board to PC through USB (newbie)
amando
Posts: 1
Can I use something like Simple_Serial to talk from a Propeller development board to a PC through the USB port. I am talking about the USB to serial converter that is connected to pins 30 and· 31.· I am getting inconsistant results. I can sometime echo a single character OK, but if I try to print Hello! World! on the PC I get garbage. It seems like a baud rate mis-match. Which baud rate should I use?
Many thanks
Jeff Hanson
{{
······· Try to use the simple serial object
······· We are talking between a PC and the dev board.
······· We are talking though the USB connector,
······· so the serial comes out on pins 30 and 31 (Rx and Tx).
}}
CON
· _clkmode = xtal1 + pll16x
· _xinfreq = 5_000_000
VAR
· long bite
·
OBJ
· SERIAL :····· "Simple_Serial"
· LED :········ "Display_Byte"
PUB main
· dira[noparse][[/noparse]30]~~
· dira[noparse][[/noparse]31]~
·
· LED.init
· LED.display($00_00_00_AA)
·
· SERIAL.init(31, 30, 9600)
· LED.display($00_00_00_11)
· SERIAL.str(sal)
· LED.display($00_00_00_33)
· bite := SERIAL.rx
· SERIAL.str(sal)
·
· repeat
··· LED.display($00_00_00_77)
··· bite := SERIAL.rx
··· LED.display(bite)
··· SERIAL.tx(bite)
DAT
sal···· byte "Hello! World!", 0
·
Many thanks
Jeff Hanson
{{
······· Try to use the simple serial object
······· We are talking between a PC and the dev board.
······· We are talking though the USB connector,
······· so the serial comes out on pins 30 and 31 (Rx and Tx).
}}
CON
· _clkmode = xtal1 + pll16x
· _xinfreq = 5_000_000
VAR
· long bite
·
OBJ
· SERIAL :····· "Simple_Serial"
· LED :········ "Display_Byte"
PUB main
· dira[noparse][[/noparse]30]~~
· dira[noparse][[/noparse]31]~
·
· LED.init
· LED.display($00_00_00_AA)
·
· SERIAL.init(31, 30, 9600)
· LED.display($00_00_00_11)
· SERIAL.str(sal)
· LED.display($00_00_00_33)
· bite := SERIAL.rx
· SERIAL.str(sal)
·
· repeat
··· LED.display($00_00_00_77)
··· bite := SERIAL.rx
··· LED.display(bite)
··· SERIAL.tx(bite)
DAT
sal···· byte "Hello! World!", 0
·
Comments