Yes, it has been stated in the readme:https://github.com/micropython/micropyt ... /README.md
Basic operations like uart.write() work perfectly with the this UART initialisation.
Zephyr's driver model defines the various peripherals by name (and this is configured in the board/mcu definitions and will correspond to pins etc). MicroPython just makes those names available to the machine API.
In general the only issue that you feel is that UART is not responding right?Any other problem you feel that may cause such a problem?
Thank you very much!!
GPS click on micropython
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: GPS click on micropython
The way to test a UART is to link the TX and RX lines. The following works on a Pyboard with pins X1 and X2 linked:
If that works (when adapted for your board) then repeatedly calling u.readline() should return something recognisable when connected to your GPS.
Code: Select all
from machine import UART
u = UART(4)
u.init(baudrate=9600)
u.write('Hello\n')
u.readline()
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: GPS click on micropython
I made changes to the program:https://github.com/Yadnik1/GPS-Click/bl ... 20CLICK.py
The output of the program is as follows:
Seeing the output,I feel that there is no such issue with the UART initialisation or the program would not have returned this output.Can there be any other error according to you?
Thank you very much!!
The output of the program is as follows:
Code: Select all
UART("UART_0", baudrate=115200, data_bits=8, parity_bits=None, stop_bits=1, flow_control=None, timeout=0, timeout_char=0)
Request Timeout: No GPS data is found.
Thank you very much!!
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: GPS click on micropython
On the contrary, as far as I can see the program is telling you it is receiving nothing.
Did you test the UART as I suggested? Is that baudrate correct: my GPS uses 9600 unless I send it a special command to change it.
Did you test the UART as I suggested? Is that baudrate correct: my GPS uses 9600 unless I send it a special command to change it.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: GPS click on micropython
Hi Peter,
I tried running the UART program while keeping my GPS connected as you suggested,The output is as follows:
>>> from machine import UART
>>> u = UART("UART_1")
>>> u.init(baudrate=9600)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'UART' object has no attribute 'init'
>>> u.write('Hello\n')
6
>>> u.readline()
b''
I also changed the baud rate to 9600 of my board.Can you please have a look and tell me where I am going wrong.
I tried running the UART program while keeping my GPS connected as you suggested,The output is as follows:
>>> from machine import UART
>>> u = UART("UART_1")
>>> u.init(baudrate=9600)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'UART' object has no attribute 'init'
>>> u.write('Hello\n')
6
>>> u.readline()
b''
I also changed the baud rate to 9600 of my board.Can you please have a look and tell me where I am going wrong.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: GPS click on micropython
The fact that
fails tells me there is something wrong with the Zephyr port. I'm afraid I can't help there, we really need someone with Zephyr experience.
Code: Select all
u.init(baudrate=9600)
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: GPS click on micropython
The baud rate is configured in the device tree file of the board like this : https://github.com/jadonk/beagle_connec ... reedom.dts, the machine API takes that into use.Hence I think we cannot change uart baud rate using uart.init() method.Also uart.init function is not in the machine_uart.c file:https://github.com/micropython/micropyt ... ine_uart.c
Are the other things right according to you like the uart.write() and uart.readline().
Thank you very much!!
Are the other things right according to you like the uart.write() and uart.readline().
Thank you very much!!