I'm in the early stages of designing a specialized automated assembly machine. It utilizes six axes - all controlled by stepper motors. I am planning to use two ATmega328 MCUs with 3-axis "grbl" G-code interpreters and a 'Master' MCU (ATmega328) to coordinate them both.
Although it is a Six Axis machine, no two axes will be moving at the same time. Also, once the G-code is debugged and finalized, there will be no need to change it and it will be coded in firmware. Therefore there is no need to have another device (laptop or SDcard reader) connected to the machine to provide the G-code.
The issue I am facing is that "grbl" receives the G-code through the RXD pin, which I understand is the Receive input for the USART. I would like to use the USART TXD of the 'Master' MCU to transmit G-code to both "grbl" devices. Although I am not very familiar with using the USART, I don't believe the protocol allows for selecting different devices like SPI does.
My thinking is to use a 1-of-2 noninverting demultiplexer to direct traffic to the desired device. I would rather not have to modify the "grbl" source code for alternative communication, especially if all I need to do is add a 27 cent demux chip.
Is this an appropriate way to communicate with the two USARTs?