SoftwareSerial mangling data in an interesting way.

So I've got serial data coming from an ancient games console (vectrex) and being received by an arduino.

The serial data is transmitting at
9615 baud
8n1
inverted
and has been tested on other hardware (atarivox) and is working.

I've tried receiving the data on an arduino beetle and nano.
Using software serial
9600 baud
inverted signal set to true
and I believe it's set to 8n1 by default.

I am receiving data but it's mangled, and in a consistent fashion.

If I send
bin 01100001 , I receive
bin 00111101
and i have observed that if I invert that result 11000010 and roll it one bit to the right, i do get my original value, all be it with the most significant bit lost.

I have tried setting inverted signal to 'false' but then i just receive nothing.

So Can anyone figure out what's going on here or suggest a fix?

All i can think to try at this point is inverting the bit with hardware and using the hardware serial port.

Thanks.

I understand your input stream is 9615 baud. I don't know why this would be, but I would imagine that setting Arduino serial to match it would be the first move.

clockworkrobot:
The serial data is transmitting at
9615 baud
8n1
inverted
and has been tested on other hardware (atarivox) and is working.

If it is intended to work at 9615 please produce the documentation to prove it.

In its absence my guess is that it should be working at 9600 but is not doing so properly. However an error of 15 in 9600 is very small - about 1.5 in 1000. That's about the same as the error at 9600 baud using HardwareSerial on a 16MHz Atmega 328 (according to the datasheet).

Can you receive data from your device using HardwareSerial?

If so I guess the problem is with the timing inside SoftwareSerial.

...R

I believe 9615 baud is the closest my vectrex running at 1.5mhz can get to 9600 and I have tried setting the vectrex software serial to both 9600 and 9615. This hasn't made a difference although I read the discrepancy should be within tolerance.

I've not tried hardware serial yet as i need hardware to invert the signal (which i will receive tomorrow).

Sounds like a not inverted signal that just has the start bit inverted. Do you have a scope/logic analyzer picture of such a transfer?

OK this just gets stranger, so I put a nc7sz04 in there to invert the logic.. and now i get data.. IF I use software serial with inverted logic ... TRUE.
hu?
The data is now good from 00 to FE but i can't receive FF !
I have no clue.

clockworkrobot:
OK this just gets stranger, so I put a nc7sz04 in there to invert the logic.. and now i get data.. IF I use software serial with inverted logic ... TRUE.

And what happens with HardwareSerial, with and without the inverted logic?

Have you tried the NeoSwSerial or AltSoftSerial libraries?

...R

clockworkrobot:
OK this just gets stranger, so I put a nc7sz04 in there to invert the logic.. and now i get data.. IF I use software serial with inverted logic ... TRUE.
hu?
The data is now good from 00 to FE but i can't receive FF !
I have no clue.

I'd really like to see a scope/logic analyzer output of that signal. Looks a this isn't an UART signal but some proprietary serial signal which isn't compatible with standard asynchronous serial interfaces. You may have to implement your own version of SoftwareSerial to read this signal but without a picture of how the signal looks, this is quite difficult as it's mostly guesswork.