[CLOSED] uart write garbled character

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
ajie_dirgantara
Posts: 81
Joined: Fri Sep 02, 2016 9:26 am

[CLOSED] uart write garbled character

Post by ajie_dirgantara » Tue Jul 04, 2017 7:40 am

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?
Last edited by ajie_dirgantara on Wed Jul 05, 2017 2:24 am, edited 1 time in total.

User avatar
deshipu
Posts: 1388
Joined: Thu May 28, 2015 5:54 pm

Re: uart write garbled character

Post by deshipu » Tue Jul 04, 2017 7:42 am

Did you forget to also connect gnd?

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: uart write garbled character

Post by pythoncoder » Tue Jul 04, 2017 7:49 am

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.

ajie_dirgantara
Posts: 81
Joined: Fri Sep 02, 2016 9:26 am

Re: uart write garbled character

Post by ajie_dirgantara » Tue Jul 04, 2017 8:28 am

deshipu wrote:Did you forget to also connect gnd?
it is connected because REPL is running OK on another UART
Last edited by ajie_dirgantara on Tue Jul 04, 2017 8:29 am, edited 1 time in total.

ajie_dirgantara
Posts: 81
Joined: Fri Sep 02, 2016 9:26 am

Re: uart write garbled character

Post by ajie_dirgantara » Tue Jul 04, 2017 8:29 am

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.

ajie_dirgantara
Posts: 81
Joined: Fri Sep 02, 2016 9:26 am

Re: uart write garbled character

Post by ajie_dirgantara » Tue Jul 04, 2017 8:59 am

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.

ajie_dirgantara
Posts: 81
Joined: Fri Sep 02, 2016 9:26 am

Re: uart write garbled character

Post by ajie_dirgantara » Tue Jul 04, 2017 11:05 am

UPDATED :

The mistake are on me. I am NOT using correct FTDI usb to serial adapter. CASE CLOSED.

Post Reply