*Edit - I've found the problem. Doing logic level analysis it turns out the baud rate of the prolific converter was about 9259, not 9600. The signals from the FTDI were reversed from that of the prolific and the ZigBee. (FTDI High Logic Level was 0, while Prolific High Logic Level was 1).
I've searched the internet for the cause of this problem and the best I've been able to find is "check the baud rate". I've already tried that, always using 8N1, but just can't find the source of this problem.
I'm using an Arduino board, programmed as a Modbus slave device, and a ZigBee to rs232 converter from SHJ electronics. I was attempting to connect the Arduino Modbus slave to the ZigBee to rs232 converter. They failed to communicate, and I found the following results by doing further testing.
The Arduino board functions perfectly as a modbus slave when connected to the pc via an ftdi board, however for some reason cannot be programmed by the ftdi board, producing errors. I had to resort to isp programming.
The arduino board produces garbled data when connected to the pc with a prolific usb to serial converter
The Zigbee to serial converter produces garbled data with both prolific and ftdi usb to serial converters, except when in configuration mode.
When the prolific and ftdi usb to serial converters are connected to each other, converting from usb - serial - usb, with 2 com ports open on my maching, the data between them is garbled.
I've checked the baud rate, it changes how the data is garbled, but doesn't fix the problem.
Who would ever know? One reason why they probably won't is that your code is apparently a State Secret.
A couple of guesses are that
there is a mismatch of baud rate in the system somewhere
you are using software serial on hardware serial pins.
you are using software serial at a speed beyond its abilities 38400
wrong bluetooth protocol
you are using software serial at a speed beyond its abilities 38400
I'm using baud 9600
Nick_Pyner:
Who would ever know? One reason why they probably won't is that your code is apparently a State Secret.
A couple of guesses are that
there is a mismatch of baud rate in the system somewhere
you are using software serial on hardware serial pins.
you are using software serial at a speed beyond its abilities 38400
wrong bluetooth protocol
There must be a mismatch in the baud rate somewhere right?
I'm using baud 9600, so surely that won't exceed any limitations?
I'll look further into software serial on hardware serial pins, I don't know much about that so there might be something there.
What is sending the data? Where is your PROOF that the data is garbled? Why do you have so freaking much code that has nothing to do with serial data reception when you have a basic problem with serial data reception?
PaulS:
What is sending the data? Where is your PROOF that the data is garbled? Why do you have so freaking much code that has nothing to do with serial data reception when you have a basic problem with serial data reception?
The zigbee unit sends modbus data to my Arduino, which then sends a reply back to the zigbee unit.
However they failed to work together, and in testing I connected a ftdi USB to serial converter to a prolific one, sent data between them, and what came out wasn't what I put in. I suspect that's where my problem starts.