I need to interface an IDUINO MEGA to a Pi3 and also in a separate configuration a BLUE PILL to a Pi3. I shall refer to both the MEGA and the BLUE PILL as MICRO. I need to use serial UART on the Pi and UART on the MICRO. I need to be able to send raw binary data from the MICRO to the Pi. I understand that the Pi has two pins available for independent serial commas. I understand that the MICRO can be programmed to allocate UARTS to various pins. IT is completely unclear from my internet searches precisely how to do this??? That is determine which pins to choose and how to allocate them in the code and then set up UART and send raw data. I will need to be able to be doing other seriously high speed operations in the MICRO loop probably interrupt timed loop and so the serial port cannot sit there dedicated to the UART and nothing else.
This is not essential but very desirable to be able to send parity bits. I want to be able to send data with odd parity and depending on the data change over to even parity and back again without having a major code delay to do this. Similarly the Pi must be able to detect odd / even parity in its receive string and be able to recognize it in the received data.
I prefer to program in C not C++, but I will put up with what advise I am given.
What is the desirable method to interface Pi 3V3 tolerant logic to MICRO 5V0 logic?
Please help.
Regards