Using the serial port AND monitoring it?

Can I use a serial port AND monitor it simultaneously?

Here's the background - I've got a simple arduino project that monitors some data (temperature, pressure, radiation etc) and writes it to an SD card. I've discovered that writing to a file on an SD card can takes several milliseconds and I need to speed the process up.

I want to split the project into two. One arduino (lets call it "A") to monitor and process the data, and a 2nd arduino ("B") to write the data to a SD file. The plan is that the Tx port of "A" will be wired to the Rx port of "B" and "B" will be coded simply to write all the data it receives to an SD card.

I still want to be able to plug "A" into my computer via it's USB port. I know that the USB connector and the Rx/Tx port use the same internal circuitry, so will it be possible to monitor the serial port using the serial monitor at the same time that "B" is connected to the Tx pin? I'd like to be able (during development anyway) to monitor the data being passed from "A" to "B" at the same time as it's being written to the file?

You could use SoftwareSerial and two other pins.

You could use SoftwareSerial and two other pins.

I've used software serial in the past, it tends to be resource intensive and I would prefer to avoid using it if I can.

I appreciate that the simplest answer is probably 'try it and see' but I would prefer some guidance before I start building hardware and cranking out code.

One thing that I've done is to take a 339 and two serial adapters. Non-inverting sides of all comparators wired to like half the full voltage.

Each of the two target TX and RX pins are wired to the input of one comparator, and these outputs are wired to the TX pins of the other serial adapters. So one of them outputs everything it sees going by in one direction, the other outputs everything it sees going by in the other direction.

Each of the two target TX and RX pins are wired to the input of one comparator, and these outputs are wired to the TX pins of the other serial adapters. So one of them outputs everything it sees going by in one direction, the other outputs everything it sees going by in the other direction.

Clever idea. (and cheap)

I think you are talking about a "Serial port SNIFFER" (datalogger). The commercial versions store the serial traffic in a downloadable buffer but are pricey..