[RESOLVED] SERIAL1 and SERIAL2: Can it be INVERTED?

Hello,

I am replacing an Arduino Uno with a Spark Core. I used to run SoftwareSerial to send data to these very nice and expensive screens: http://www.seetron.com/glo416.html

They require an inverted serial signal, with the last argument as a 1 using the SoftwareSerial library. This is a working line in my Arduino Uno code, as an example:

SoftwareSerial oled1 = SoftwareSerial(254,2,1); //rx pin=255 (an unused pin), tx pin=2, 1=inverted signal

Will I be able to use the Spark Core Serial1 and Serial2 abilities and configure them with this inverted signal? How would I go about implementing that? Thanks for you insight!

Resolution: No, you cannot currently invert the serial output from the Core.

I may have just answered my own question:

On the oled webpage it states “Serial Input (logic/data) Inverted or noninverted, 9600—38,400bps.” Now I just have to figure out how to configure that on the screen-side if it needs to be. Still, advice on this would be pertinent to the stated problem. Thanks.

ah, there it is: http://seetron.com/glo416/images/glo416v2back.png

Still, the title question stands.

It appears that, not without modification to the core firmware, it is impossible to run one of the core’s UARTs (serial) in inverted mode. I’ll dive deeper into it later if there is interested

For the curious, here’s a link to the Core’s serial code: https://github.com/spark/firmware/blob/9b01d795ecaaf657399dc4888f30f3898d91d74a/src/spark_wiring_usartserial.cpp

1 Like

That is also what I concluded, but I lack the expertise about such things. Thanks for the response and the link. I bet it could be implemented fairly easily within the Core code if there was ever a need.

None the less, thanks for replying. BTW, these OLED screens look killer. -very high contrast and brightness

I’ve used the Spark Core with inverted serial devices.

I wound up using a 74-series Schmidt trigger inverter, to great effect.

2 Likes

Ah, nice solution. I’ve built one of those, but only to learn about what it was. I wonder if that is what is in these screens, since it is possible it’s a hardware bypass jumper to select inverted/non-inverted.

What kind of devices were you interfacing with?

Getting back into this so excuse me if I am talking out my rear.

A far less performant solution could be to manually invert it in code.

@kanurys the page for your serial display says it can work in a non-inverted mode as well.

Inverted or noninverted, 9600—38,400bps

I’ve never been forced to use inverted UART but I would guess that inverted means it is completely inverted… start, stop, parity and data… so the 74-series Schmidt trigger inverter would work correctly verses trying to just invert the data in code.

More info on your display:

GLO-416s accept asynchronous serial at *9600bps, 8 data bits, no parity, 1 or more stop bit(s), often called "N81." They will accept RS-232 input, inverted TTL, or non-inverted TTL. Non-inverted TTL requires cutting the SPol jumper on the circuit board. See the hardware reference for further information.

http://seetron.com/glo416/glo416hdw.html#hookup

EDIT: I see you’ve seen all this already :slight_smile:

@kanurys, I am confused. The board instructions clearly show to cut the jumper for a non-inverted serial input. You don’t need to do anything on the Core side! :wink:

@peekay123 It’s okay. If you review the prior posts you’ll see that I just missed the serial polarity info on the seetron website. I cut the wire and everything works smoothly. There is no confusion to be had here. Now if you’re confused about if one can actually output an inverted signal from a Spark Core, then that I understand. I had the same question (hence this thread) until @harrisonhjones kindly replied, above. As a solution, the Schmidt trigger inverter seems like the ticket (EDIT: seems like >a< ticket). Thank you all for you input on this.

2 Likes