2

I'm currently building a remote controlled motor driven robot that is taking USB remote input, and output said input through the UART TX pin to a Texas Instruments MSP430 launchpad, that is connected through its UART RX pin. I've already programmed a script that translates the USB remote to output characters such as "A" and "B", and I want to transmit these characters through UART so that my C program on the MSP430 can receive the characters to execute the corresponding function. I've done some research on here and found a command line to add to my config.txt file on my microSD card that would allow the Pi python console to output directly from the TX pin. The code is below:

dtoverlay=pi3-disable-bt

My concern is if the UART connection on both devices are encoded the same way. The MSP430 has the ability to recieve various encoding like UTF-8 or ISO8859. I can't seem to find what python on the pi encodes to. Any insight would be greatly appreciated. Also, if you don't think the line of code that went into my config.txt file won't work to transmit from the TX GPIO, any insight on that would be helpful too. Thanks!

2

The Pi has 2 UART, but only ONE is accessible via GPIO. This is accessible as /dev/serial0 (but needs to be enabled via raspi-config).

The change you propose to config.txt will not do what you think.

You can disable bluetooth and/or swap which UART is connected to the GPIO, but there seems to be little reason to do so - the default is adequate for most purposes.

The serial I/O will send bytes - the interpretation of these bytes i.e. the encoding is entirely up to the program at either end. Unless you are sending something other than A or B there is NO DIFFERENCE under either coding.

If this does not answer your question, you need to clarify, and possibly include code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.