RX TX set up for micropython as a sender

Hi,

I try to use micropython to send data through Rx and TX port of raspberry pico to arduino uno . I know there are different protocol can be used , but i want to practice my skill with this port . I saw the library uart recommended in the tutorial . However , I think it only send up to 5 bit , but i want 8 bit.

I find on the internet the below code to configure serial sender as 8 bit :

import serial
import threading

      self.serial = serial.Serial(
            port= port, // depend on the port use  
            baudrate=115200,
            parity=serial.PARITY_NONE,
            stopbits=serial.STOPBITS_ONE,
            bytesize=serial.EIGHTBITS

For the port section on above code , when I put RX and TX , the error appeared as no port available . How could I add the RX and TX to the above code.

You are using Python code instead of MicroPython code. If you are using a Pico you need to stick with MicroPython.

For example:


from machine import UART, Pin
# UART0 mapped to GPIO 0/1, 12/13 and 16/17
# UART1 mapped to GPIO 4/5 and 8/9
uart1 = UART(1, baudrate=115200, tx=Pin(4), rx=Pin(5))
uart0=UART(0,baudrate=115200,tax=Pin(0), rx=Pin(1))

uart1.write('hello')


Hi,
for the byte cold i send 8 byte of data through uart pico. One website I read , state that I could not send 8 bytes through Uart. If It can , any configurateion need

The default declaration in the example assumes an 8-bit word. Check here for more information on using machine.UART.
https://docs.micropython.org/en/latest/library/machine.UART.html#machine-uart

thank you

No problem.