Riva:
What if you use a lower baud rate, 300, 1200, 2400 and 4800 are standard rates below 9600 but it could also be custom.
Does your logic analyser protocol decoder have an auto baud option where it will try to figure out the baud rate for its self?
Firstly, thank you Riva for your help on this. It's very much appreciated and is really keeping me invested.
ok, another step forwards perhaps...
I changed the arduino code that utlilises the rs485 module to the following:
long baudRate = 9600;
byte serialConfig = SERIAL_8N1;
#define TxControlMixer 3 //RS485 Direction control
#define RS485Transmit HIGH
#define RS485Receive LOW
long unsigned lastCom = 0;
long unsigned curMicros = 0;
const unsigned long comPeriod = 55000;
const int bitLen = 104;
byte message[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
void setup() {
Serial1.begin(baudRate, serialConfig);
// Init Transceiver
pinMode(TxControlMixer, OUTPUT);
digitalWrite(TxControlMixer, RS485Receive);
}
void loop()
{
curMicros = micros();
if ((curMicros > (lastCom + comPeriod)) || (curMicros < lastCom)){
lastCom = curMicros;
digitalWrite(TxControlMixer, RS485Transmit); // Enable RS485 Transmit
for (int i = 0; i < sizeof(message); ++i) {
Serial1.write(message[i]);
delayMicroseconds(bitLen);
}
}
}
The main point being I've removed the line that sets the RS485 module to receive. This means that the arduino is constantly in transmit which could be a problem when I connect the controller up but I'll get to that later.
This gave the right sort of pattern, as shown on the top line in the attached image.
Once I got to there I then changed the baud to 8750 (with some trial and error) which gave me the middle line.
The bottom line is the mixer.
Note:
- the scale is not the same on each line
- rather the measure at the top of each line shows the duration
So the overall length of a packet looks right but the individual segments look a little too short.
