Hi,
Can the USB socket of a Nano be wired directly or indirectly to the Rx/Tx of a Mega2560?
The problem is I have two nano's each having their Rx/Tx used by GPS and Wireless, both these boards need to talk to the Mega2560, as the Rx/Tx's are being used on the Nanos I need to know if I can wire the Nano's USB to the Mega2560 Rx/Tx ports to transmit/receive data?
Thanks
No, you can't do that.
If you want to use the serial line to communicate to the other board you will have to do it one of these two ways:
- use the softSerial library, or
- if you don't use the serial line at all while running your application to communicate with the PC using the USB interface, you can always connect the Rx/Tx breakouts from the nano to the other board. Remember to cross them, i.e. Tx to Rx on the other board and Rx to Tx on the other board.
No, because:
'328 based Nano only has 1 serial port - Rx/Tx are also connected to USB/Serial chip. Can only do one or the other. You must coordinate so they don't conflict if you want to use for both.
You can use newsoft serial to create software serial comm's (vs hardwre UART for the D0/D1 serial port) as a different means.
Most GPS is only at 4800, use software serial for that, reserve the hardware serial for faster stuff.
Thanks guys, I'll try the software serial for the slower devices and the hardware serial for the interconnections 