Serial parity
Posted: 17 Dec 2017 22:43
Hi,
Z-Uno is awesome. I hope I will migrate from Raspberry to Z-Uno.
I'm unavailable to read Serial1 properly. I get following result :
My serial is 1200 7E1. I convert 8N1 to 7E1 using 0x7f and.
I'm using this sketch :
On Raspberry, I'm using following command to read 1200 7E1 :
I get this result :
Z-Uno doesn't match Raspberry result. Any idea ?
Sincerely yours.
Z-Uno is awesome. I hope I will migrate from Raspberry to Z-Uno.
I'm unavailable to read Serial1 properly. I get following result :
Code: Select all
DEC BIN BIN HEX CHAR
252 1111111111111100 1111100 7C |
252 1111111111111100 1111100 7C |
248 1111111111111000 1111000 78 x
192 1111111111000000 1000000 40 @
224 1111111111100000 1100000 60 `
254 1111111111111110 1111110 7E ~
252 1111111111111100 1111100 7C |
248 1111111111111000 1111000 78 x
I'm using this sketch :
Code: Select all
void setup() {
Serial0.begin(1200);
Serial.begin(115200);
}
void loop() {
while(Serial0.available() > 0) {
int entier = Serial0.read();
Serial.print(entier);
Serial.print(' ');
char caractere_8b = entier;
Serial.print(caractere_8b, BIN);
Serial.print(' ');
char caractere_7b = caractere_8b & 0x7f;
Serial.print(caractere_7b, BIN);
Serial.print(' ');
Serial.print(caractere_7b, HEX);
Serial.print(' ');
Serial.println(caractere_7b);
}
delay(2000);
}
Code: Select all
stty -F /dev/ttyUSB0 1200 sane evenp parenb cs7 -crtscts
Code: Select all
00000030: 0a 4f 50 54 41 52 49 46 20 48 43 2e 2e 20 3c 0a .OPTARIF HC.. <.
00000040: 0a 49 53 4f 55 53 43 20 33 30 20 39 0a 0a 48 43 .ISOUSC 30 9..HC
00000050: 48 43 20 30 30 37 33 37 35 37 35 35 20 2d 0a 0a HC 007375755 -..
00000060: 48 43 48 50 20 30 30 34 39 37 38 32 37 39 20 41 HCHP 004978279 A
00000070: 0a 0a 50 54 45 43 20 48 50 2e 2e 20 20 0a 0a 49 ..PTEC HP.. ..I
00000080: 49 4e 53 54 20 30 30 34 20 5b 0a 0a 49 4d 41 58 INST 004 [..IMAX
00000090: 20 30 33 35 20 47 0a 0a 50 41 50 50 20 30 30 39 035 G..PAPP 009
000000a0: 38 30 20 32 0a 0a 48 48 50 48 43 20 44 20 2f 0a 80 2..HHPHC D /.
000000b0: 0a 4d 4f 54 44 45 54 41 54 20 30 30 30 30 30 30 .MOTDETAT 000000
Sincerely yours.