Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - Receive string from Uart

(you are viewing a thread; or go back to list of threads)

Receive string from Uart (by Ken)
Hi all,
I have project send and receive data between a servo driver and MCU, baudrate is 19200. I wrote a LD at baudrate 2400 it working and read value ok, but at 19200 it working wrong. How i read value in string from servo driver? the string send to MCU at format: ";number"
Fri Dec 20 2019, 05:06:07, download attachment test.ld
(no subject) (by MGP)
At 19200b and you can't controle the input speed then it will not work, LDmicro works with cycletime.
Fri Dec 20 2019, 06:59:02
(no subject) (by MGP)
You dont use timers....have you ever tried with a zero cycle time?
Fri Dec 20 2019, 07:01:56
(no subject) (by Ken)
Thanks MGP,
Really, i don't know about how to use cycle time and how it impact to program, can you help me about this one?
Fri Dec 20 2019, 19:16:47
(no subject) (by MGP)
Let us count on the assumption that 1 letter consists of 10 bits, then with 19200B you can receive about 1920 letters per second or 1 letter needs 0.5 mS.
That's too fast for LDmicro with a 1mS cycle time because you need 1 cycle time to receive and 1 cycle to process.

You have 2 options, either you reduce the baudrate or you check the incoming speed by handshaking, something LDmicro cannot do.

You can switch off the cycle time by setting it to 0, then the program will run at its fastest, the disadvantage is that the timers will no longer be correct.

If it still doesn't work then your program is too long to receive at 19200b.
In general 19200 is too fast to work properly and 9600 is just about the maximum in LDmicro.
Sat Dec 21 2019, 03:25:23, download attachment Snap86.jpg
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):