I’m attempting to sniff serial data from a 9600,7,N,1 dot matrix serial printer link, and I’m discovering the Serial1 UART fails to recognize data in this mode despite the following setup:
Alternatively, configuration may be constructed manually by ORing ( `|` ) the following configuration constants:
Data bits:
* SERIAL_DATA_BITS_7 - 7 data bits
* SERIAL_DATA_BITS_8 - 8 data bits
* SERIAL_DATA_BITS_9 - 9 data bits
Stop bits:
* SERIAL_STOP_BITS_1 - 1 stop bit
* SERIAL_STOP_BITS_2 - 2 stop bits
* SERIAL_STOP_BITS_0_5 - 0.5 stop bits
* SERIAL_STOP_BITS_1_5 - 1.5 stop bits
Parity:
* SERIAL_PARITY_NO - no parity
* SERIAL_PARITY_EVEN - even parity
* SERIAL_PARITY_ODD - odd parity
What are my options (if any) with using the UART?
I have yet to check, however, if the SoftSerial class supports this?
@jimini, which printer is it? Also, which Particle device are you using? If the printer uses RS232 level signals vs TTL, you cannot connect the line directly to the RX pin of the Particle device (see here for explanation). Doing so may damage your Particle device.
You will need an RS323-to-TTL level converter such as ones that use a MAX232 chip. You could use something like this, powered by 3.3v from your Particle device:
Once you have that in place, you can test different congurations. You could also get a converter that works with a PC so you can test there first. The converter is like these:
P1 with all the EIA 232/3V3 level shifting…
It is a serial dot matrix ticket printer that we’ve validated DIP settings.
It’s a serial setup question, not an interface question
I assume you verified the printer settings by sending something to it via a PC? If this doesn’t work, you could try a different baudrate, either 4800 or 19,200 to see if that help.
BTW, if you have an oscilloscope, you should verify the signal is clean on the Serial1 RX line.
I've config'd as you've enumerated here, and I've sim'd this on my bench using the XCTU frame generator via 7,N,1 format to no avail... it's not an interface issue at all, way past that.
Again, just needing someone to validate the UART does/does-not operate here.