I'm trying to use Arduino's SoftwareSerial to communicate with a RS-422 device.
I use SN75179BP
to convert 422 to TTL.
The device is 8bit - odd parity - 1 stop bit.
I've tried to mod the softwareserial library using:http://arduino.cc/forum/index.php/topic,108097.0.html
Changed the parity bit calculation in the write function to odd instead of even.
Couple of problems:
First, if I use the exact mod suggested by pylon [the 4th comment] on the recv function, while trying to upload the sketch I get:
/var/folders/st/vmhkh5t57592ln_zhkyfq2q80000gn/T//cct5EjNP.s: Assembler messages:
/var/folders/st/vmhkh5t57592ln_zhkyfq2q80000gn/T//cct5EjNP.s:243: Error: register r24, r26, r28 or r30 required
/var/folders/st/vmhkh5t57592ln_zhkyfq2q80000gn/T//cct5EjNP.s:263: Error: register r24, r26, r28 or r30 required
Have no idea why.
but if I leave the function as is, and only changing this:
// skip the parity bit
// skip the stop bit
// skip the 2 stop bits
I can upload the sketch and even start receiving true and correct data on my serial.
The second problem, is that no matter what I do - I can't get the write function to work.
The device doesn't respond to any input except that in the second I try to send something to that device over the serial, I stop getting nice and clean data on my recieve channel, instead I get clutter...
[BTW, in that situation - if send some "new line" 0D, it brings back the normal data on the recieve channel...]*-I'm using Arduino 1.0.1
EDIT: I don't know if it's important or not, but I'm using inverse_logic for the receive function to work.
Any ideas will be more than welcomed,