I've got problem with simple UART write,
when I try
ser = pyb.UART(2, 9600)
ser.write("test")
on my pyboard, and then connect tx and rx to the PC and open it using hyperteminal,
I've got garbled message :
(hex) 51 53 74 04 (str) QSt.
I am sure using correct uart settings (9600, 8-n-1).
any ideas?
[CLOSED] uart write garbled character
-
- Posts: 81
- Joined: Fri Sep 02, 2016 9:26 am
[CLOSED] uart write garbled character
Last edited by ajie_dirgantara on Wed Jul 05, 2017 2:24 am, edited 1 time in total.
Re: uart write garbled character
Did you forget to also connect gnd?
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: uart write garbled character
How are you connecting the UART to the PC? What sort of adaptor are you using (e.g. FTDI USB adaptor)? I do hope you're not connecting to a PC serial port with a 9 or 25 way D-type connector. If you are, stop, hope no damage is done, and get an FTDI adaptor.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
-
- Posts: 81
- Joined: Fri Sep 02, 2016 9:26 am
Re: uart write garbled character
it is connected because REPL is running OK on another UARTdeshipu wrote:Did you forget to also connect gnd?
Last edited by ajie_dirgantara on Tue Jul 04, 2017 8:29 am, edited 1 time in total.
-
- Posts: 81
- Joined: Fri Sep 02, 2016 9:26 am
Re: uart write garbled character
pythoncoder wrote:How are you connecting the UART to the PC? What sort of adaptor are you using (e.g. FTDI USB adaptor)? I do hope you're not connecting to a PC serial port with a 9 or 25 way D-type connector. If you are, stop, hope no damage is done, and get an FTDI adaptor.
yes I am using FTDI.. and also I think it is OK because REPL is working on another UART. I am not using USB.
-
- Posts: 81
- Joined: Fri Sep 02, 2016 9:26 am
Re: uart write garbled character
Ok, If I am writing to UART3 (currently used by REPL) it shown OK on hyperterminal. but if I am using UART2, it shows garbled message. weird.
and, did I said I am using pyboard before?-- sorry, I mean I am using nucleo L476RG.
and, did I said I am using pyboard before?-- sorry, I mean I am using nucleo L476RG.
-
- Posts: 81
- Joined: Fri Sep 02, 2016 9:26 am
Re: uart write garbled character
UPDATED :
The mistake are on me. I am NOT using correct FTDI usb to serial adapter. CASE CLOSED.
The mistake are on me. I am NOT using correct FTDI usb to serial adapter. CASE CLOSED.