Issue with the Baudrate of "Serial Parallax Terminal" library
JChris
Posts: 58
Hi,
I use a propeller C3 and an Ethernet Module (USR-K3)
I have an issue with the display on screen of Terminal and I don't understand why.
When I put the Baudrate of USR-K3 at 115200 (default) I obtain this (picture : "Baudrate 115200") and when I set the baudrate of my device to 9600, I get this (picture : "Baudrate 9600")
My code is the following for Baudrate at 115200
My code is the following for Baudrate at 9600
What is expected are the responses of the Baudrate 9600 image but this forces me to fix the baudrate to 9600 while I would like to set it to 115200 which is the default baudrate.
How do I get a good debugging with a baudrate set to 115200?
If someone has a clue, I would appreciate it.
I use a propeller C3 and an Ethernet Module (USR-K3)
I have an issue with the display on screen of Terminal and I don't understand why.
When I put the Baudrate of USR-K3 at 115200 (default) I obtain this (picture : "Baudrate 115200") and when I set the baudrate of my device to 9600, I get this (picture : "Baudrate 9600")
My code is the following for Baudrate at 115200
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 USR_Rx = 0 USR_Tx = 2 USR_Rst = 4 USR_Baud_115200 = 115200 USR_Baud_9600 = 9600 CR = 13 LF = 10 temps_attente = 2000 VAR long char, Stack[200] byte AT_Reponse[150], cog OBJ USR : "FullDuplexSerial" pst : "Parallax Serial Terminal" PUB main pst.Start(115200) cog := USR.Start(USR_Rx, USR_Tx, 0, USR_Baud_115200) USR_Config waitcnt(clkfreq*5+cnt) cogstop(cog) mac PUB USR_Config pst.str(String("Start setting" ,9)) pst.Str(String(CR)) waitcnt(clkfreq/10+cnt) USR.Str(String("+++")) 'Enter in AT command mode Rx_USR(temps_attente) pst.Str(String(13)) pst.str(String("Response 0: ",9)) pst.Str(@AT_Reponse) pst.Str(String(13)) USR.Str(String("a")) Rx_USR(temps_attente) pst.Str(String(13)) pst.str(String("Response 1: ",9)) pst.Str(@AT_Reponse) pst.Str(String(13)) waitcnt(clkfreq+cnt) USR.Str(String("AT+UART1=115200,8,1,NONE,NFC",CR)) 'Set Baudrate at 115200 Rx_USR(1000) pst.Str(String(13)) pst.str(String("Response 2: ",9)) pst.Str(@AT_Reponse) pst.Str(String(13)) waitcnt(clkfreq+cnt) USR.Str(String("AT+Z",CR)) 'Reset the device Rx_USR(1000) pst.Str(String(13)) pst.str(String("La réponse à ta requete est la suivante 3: ",9)) pst.Str(@AT_Reponse) pst.Str(String(13)) PUB mac USR.Start(USR_Rx, USR_Tx, 0, USR_Baud_115200) pst.str(String("debut de la config" ,9)) pst.Str(String(CR)) waitcnt(clkfreq/10+cnt) USR.Str(String("+++")) 'Enter in AT command mode Rx_USR(temps_attente) pst.Str(String(13)) pst.str(String("La réponse à ta requete est la suivante 4: ",9)) pst.Str(@AT_Reponse) pst.Str(String(13)) USR.Str(String("a")) Rx_USR(temps_attente) pst.Str(String(13)) pst.str(String("La réponse à ta requete est la suivante 5: ",9)) pst.Str(@AT_Reponse) pst.Str(String(13)) waitcnt(clkfreq+cnt) USR.Str(String("AT+MAC",CR)) 'Get MAC address of the device Rx_USR(1000) pst.Str(String(13)) pst.str(String("La réponse à ta requete est la suivante 6: ",9)) pst.Str(@AT_Reponse) pst.Str(String(13)) Pub Rx_USR(timeout) | ptr ptr := 0 ' USR.RxFlush repeat char := USR.RxTime(timeout) pst.dec(char) AT_Reponse[ptr++] := char while (char <> -1) AT_Reponse[--ptr] := 0
My code is the following for Baudrate at 9600
CON _clkmode = xtal1 + pll16x _xinfreq = 5_000_000 USR_Rx = 0 USR_Tx = 2 USR_Rst = 4 USR_Baud_115200 = 115200 USR_Baud_9600 = 9600 CR = 13 LF = 10 temps_attente = 2000 VAR long char, Stack[200] byte AT_Reponse[150], cog OBJ USR : "FullDuplexSerial" pst : "Parallax Serial Terminal" PUB main pst.Start(115200) cog := USR.Start(USR_Rx, USR_Tx, 0, USR_Baud_9600) USR_Config waitcnt(clkfreq*5+cnt) cogstop(cog) mac PUB USR_Config pst.str(String("Start setting" ,9)) pst.Str(String(CR)) waitcnt(clkfreq/10+cnt) USR.Str(String("+++")) 'Enter in AT command mode Rx_USR(temps_attente) pst.Str(String(13)) pst.str(String("Response 0: ",9)) pst.Str(@AT_Reponse) pst.Str(String(13)) USR.Str(String("a")) Rx_USR(temps_attente) pst.Str(String(13)) pst.str(String("Response 1: ",9)) pst.Str(@AT_Reponse) pst.Str(String(13)) waitcnt(clkfreq+cnt) USR.Str(String("AT+UART1=115200,8,1,NONE,NFC",CR)) 'Set Baudrate at 9600 Rx_USR(1000) pst.Str(String(13)) pst.str(String("Response 2: ",9)) pst.Str(@AT_Reponse) pst.Str(String(13)) waitcnt(clkfreq+cnt) USR.Str(String("AT+Z",CR)) 'Reset the device Rx_USR(1000) pst.Str(String(13)) pst.str(String("La réponse à ta requete est la suivante 3: ",9)) pst.Str(@AT_Reponse) pst.Str(String(13)) PUB mac USR.Start(USR_Rx, USR_Tx, 0, USR_Baud_9600) pst.str(String("debut de la config" ,9)) pst.Str(String(CR)) waitcnt(clkfreq/10+cnt) USR.Str(String("+++")) 'Enter in AT command mode Rx_USR(temps_attente) pst.Str(String(13)) pst.str(String("La réponse à ta requete est la suivante 4: ",9)) pst.Str(@AT_Reponse) pst.Str(String(13)) USR.Str(String("a")) Rx_USR(temps_attente) pst.Str(String(13)) pst.str(String("La réponse à ta requete est la suivante 5: ",9)) pst.Str(@AT_Reponse) pst.Str(String(13)) waitcnt(clkfreq+cnt) USR.Str(String("AT+MAC",CR)) 'Get MAC address of the device Rx_USR(1000) pst.Str(String(13)) pst.str(String("La réponse à ta requete est la suivante 6: ",9)) pst.Str(@AT_Reponse) pst.Str(String(13)) Pub Rx_USR(timeout) | ptr ptr := 0 ' USR.RxFlush repeat char := USR.RxTime(timeout) pst.dec(char) AT_Reponse[ptr++] := char while (char <> -1) AT_Reponse[--ptr] := 0
What is expected are the responses of the Baudrate 9600 image but this forces me to fix the baudrate to 9600 while I would like to set it to 115200 which is the default baudrate.
How do I get a good debugging with a baudrate set to 115200?
If someone has a clue, I would appreciate it.
Comments
Your first line is: But you also have: The baud rate has to match.
I spoke too soon. They both run on my serial terminal.
With both code, you get the same responses?
If yes, do you know why I don't?
FYI : I put 2 second delay for testing but this works with 100ms but I have the same error with the baudrate 115200
You can try to increase the rx buffer size, I don't remember if the FullDuplexSerial code can be easily changed so I can't help on that matter right now, or as you have already tried decrease the serial port speed so your program can read the buffer fast enough.
it was the problem. I use now "FullDuplexSerialExtended" library that it has a larger buffer (256 bytes) whereas "FullDuplexSerial" library has 16 bytes