I am trying to display NMEA data like $GPGGA using uart.write(),using the zephyr port of MicroPython. The GPS by default runs on a baud rate of 9600 and my boards baud rate has been configured to 115200, due to which I feel the data cant be displayed and uart.write('$GPGGA') just prints out the $GPGGA6.I cannot use uart.init() as well to initialise baud rate.
As a last resort will I have to manually change the baud rate of gps module to 115200 using U-Centre application?
Can someone please guide me.Thank you very much!!
Configuring baud rate of UART
-
- Posts: 16
- Joined: Wed Jul 14, 2021 8:58 am
Re: Configuring baud rate of UART
Why you can't use uart.init() ??
Code: Select all
from pyb import UART
uart = UART(1, 9600) # init with given baudrate
uart.init(9600, bits=8, parity=None, stop=1) # init with given parameters
Re: Configuring baud rate of UART
I think because I am using the Zephyr port of MicroPython https://github.com/micropython/micropyt ... /README.md and not on the dedicated MicroPython firmware I am not able to initialise baud rate of uart using uart.init().
The code I am writing is as follows:
>>> from machine import UART
>>>uart=UART("UART_0")
>>>uart.init(9600, bits=8, parity=None, stop=1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'UART' object has no attribute 'init'
It would be very helpful if someone can please guide me with this.
The code I am writing is as follows:
>>> from machine import UART
>>>uart=UART("UART_0")
>>>uart.init(9600, bits=8, parity=None, stop=1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'UART' object has no attribute 'init'
It would be very helpful if someone can please guide me with this.