thank you
the last link is very useful
on this page he said:
Definitions Needed:
#define bit9600Delay 84
#define halfBit9600Delay 42
#define bit4800Delay 188
#define halfBit4800Delay 94But how he can find 84 microseconds to generate 9600baud
f=1/T F= 1/0,000084 = 11905 hz approximately
How can i find the right frequency to generate 31250baud ?
Maybe he add the time of each action on his fonction , i'm right??
Now, with your help i know what i need to do to send data in my JUNO60
Arduino must generate a clock at 31250hz on one PIN
a second PIN must send DATA (Start bit, Data Bits,Parity Bit and Stop Bit) in Serial at the same frequency and synhcro with the clock
And a third PIN to latch the hardwareflow control.
Then i could use this part of code to generate the right "polarity" of my bit
void SWprint(int data)
{
byte mask;
//startbit
digitalWrite(tx,LOW);
delayMicroseconds(bit9600Delay);
for (mask = 0x01; mask>0; mask <<= 1) {
if (data & mask){ // choose bit
digitalWrite(tx,HIGH); // send 1
}
else{
digitalWrite(tx,LOW); // send 0
}
delayMicroseconds(bit9600Delay);
}
//stop bit
digitalWrite(tx, HIGH);
delayMicroseconds(bit9600Delay);
}