Baud rate change in the software

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
PIC-Speed32
Posts: 33
Joined: Tue May 08, 2012 3:48 pm
Location: Germany
Has thanked: 7 times
Contact:

Baud rate change in the software

Post by PIC-Speed32 »

Sorry? Translated with Google
I use a serial LCD display from 4D Systems.
It always starts with 9600 baud.
How can I start at 9600 baud, and then switch to 38.000baud (115.000 baud).
The command for the display, I can send. Then I have to change the baud from the PIC. Are there any C code for it? I do not know C code.
Thanks in advance Uwe

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Baud rate change in the software

Post by Benj »

Hello,

Which 4D display are you using? I think by default the baud rate is started at 9600 and then automatically ramped up when possible but this may not be the case for all the displays.

Also are you using software or hardware mode?

PIC-Speed32
Posts: 33
Joined: Tue May 08, 2012 3:48 pm
Location: Germany
Has thanked: 7 times
Contact:

Re: Baud rate change in the software

Post by PIC-Speed32 »

I use PIC18f46k80 and the hardware interface. 64Mhz
The display uLCD-43PT.
It starts at 9600 baud.
Then I want to increase the baud.
so I analyze the data from the touch display quicker.
at 9600 baud, it takes about 0.5 seconds.

Regards Uwe

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Baud rate change in the software

Post by Benj »

Hello Uwe,

Which display type do you currently have selected in the gLCD component properties. I believe the best choice may be the EB076 option.

With the EB076 display option the speed is ramped up to 19200 after the init but only if you are using a hardware UART to control the display.

Can you attach your program so I can see what you have got so far?

PIC-Speed32
Posts: 33
Joined: Tue May 08, 2012 3:48 pm
Location: Germany
Has thanked: 7 times
Contact:

Re: Baud rate change in the software

Post by PIC-Speed32 »

The display is controlled via the serial interface with your own commands.
I can write on the screen, draw, view pictures.
I check the touchscreen.
I query the TS whether an area is pressed.
answer 1
I query the TS whether an area is pressed.
answer 2
I query the TS whether an area is pressed.
answer 3
Now I ask the TS to get the position.
Answer 00 20 00 35
From this I calculate the Touchpukt a = 00 b = 00 * 256 +20 * 256 +35
The display has 480 x 272 pixels
That I must show measurements.

This all works.
Just not fast enough.

Regards Uwe

PIC-Speed32
Posts: 33
Joined: Tue May 08, 2012 3:48 pm
Location: Germany
Has thanked: 7 times
Contact:

Re: Baud rate change in the software

Post by PIC-Speed32 »

Sorry, an error has crept.
a = 00 * 256 + 20
b = 00 * 256 + 35

Regards Uwe
Attachments
MCP3421_x3_18f14k50_2.fcf
Test
(76.65 KiB) Downloaded 217 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Baud rate change in the software

Post by Benj »

Hello Uwe,

Aha I see now your simply using the RS232 component to control the display. What about trying the gLCD component instead and setting the properties to the EB076 type display. This should give you all the display functions plus touchscreen and should also perform the speed increase for you.

Otherwise you perform the speed increase like this.

UART_Send(0x51); //Update Baud Command
UART_Send(0x0C); //Update to 57600bps
UART_Receive(255); //Try to collect Ack
UART_Update_Baud(6); //Update UART baud to 57600bps

Other baud rates are available but you will have to change the 0x0C for the correct 4D baud command, 115200 is 0x0D.

0 - 1200
1 - 2400
2 - 4800
3 - 9600
4 - 19200
5 - 38400
6 - 57600
7 - 115200

PIC-Speed32
Posts: 33
Joined: Tue May 08, 2012 3:48 pm
Location: Germany
Has thanked: 7 times
Contact:

Re: Baud rate change in the software

Post by PIC-Speed32 »

Hi Benj,
This change I do not unfortunately.
I think the change in the PIC.
In Flowcode RS232 is initialized at 9600 baud.
So I can talk to the display.
I can change the display to a different baud.
Thereafter, the RS232 connection is interrupted.
The PIC runs at 9600 and the display with 115000Bautrate.
How do I turn now to the PIC to 115000 baud?


Regards Uwe

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Baud rate change in the software

Post by Benj »

Hello,
How do I turn now to the PIC to 115000 baud?
You call the function I suggested above.
UART_Update_Baud(6); //Update UART baud to 57600bps
If you don't have this function in your RS232 component then please ensure you are using the latest version of Flowcode which is v5.4 for PIC.
baudchange.jpg
baudchange.jpg (48.61 KiB) Viewed 4667 times

PIC-Speed32
Posts: 33
Joined: Tue May 08, 2012 3:48 pm
Location: Germany
Has thanked: 7 times
Contact:

Re: Baud rate change in the software

Post by PIC-Speed32 »

I have not seen.
One should be able to read!
Thank you.
This brings me on now.

Thanks again


Regards Uwe


How can I make the forum a self programmed baud error calculator is available?

Post Reply