Hi, searched far and wide on the Net, but was unable to find a useful solution.
I used the example from the MaixBit docs (Chinese version, translated to EN) - and was able to get a working example.
Using uPyLoader, and accessing the MaixBit REPL via the uPyLoader terminal, I was able to tx a multitude of values.
The most basic tx value,
uart.write("0") gave an output 0x06 ( ASCII tables give value 0x30) , received on another computer through a UART-to-USB cable and using PUTTY terminal as reader.
uart.write("0") —> 0x06
uart.write("00") —> 0xE6 0x06
uart.write("000") —> 0xE6 0xE6 0x06
uart.write("0000") —> 0xE6 0xE6 0xE6 0x06
uart.write("1") —> 0x67
uart.write("2") —> 0x33
uart.write("3") —> 0x66
uart.write("4") —> 0x19
uart.write("5") —> 0x65
I actually thought there could be a pattern, some offset, or maybe TX errors in baud rate, but this output stays the same whether or not I change output pins, change baud rates, change UART properties.
I know I have missed something, so here I include my code for your assistance:
fm.register(board_info.PIN9,fm.fpioa.UART2_TX) fm.register(board_info.PIN10,fm.fpioa.UART2_RX) uart2 = machine.UART(machine.UART.UART2, baudrate=4800,bits=8,parity=None,stop=1, timeout=1000, read_buf_len=4096 ) uart2.write( bytes("0", "ascii") )
Thanks for the help.