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 - Problem with formatted UART simulation

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

Problem with formatted UART simulation (by Oguz)
I have attached an example ( including a screenshot ) that seems to have problems with simulation of formatted UART instruction.

1) The first character 'H' of "Hello" is dropped
2) Newline is ignored
3) If I press Space to single step, "Hello..." string is printed to simulation terminal one character at a time. If Space causes the execution of a single rung ( or instruction ? ) at a time, I would expect the formatted string to be sent to UART all at once.

This behavior seems independent of processor.

Thanks

Oz
Fri Nov 27 2009, 21:57:13, download attachment serial_format2.zip
(no subject) (by Jonathan Westhues)
(1) I really should fix that at some point. It starts with the second character, not the first, but is correct thereafter.

(2) Newline is not ignored; you just don't see anything, since you don't print anything after the newline.

(3) The UART on these processors has only a one- (or two-) character buffer. So the program would have to either write the string to a FIFO, and feed the UART from an interrupt handler--which is complex, and would burn RAM and introduce timing variations--or just enqueue one character per cycle. It does the latter.

See the attachment, which shows that newlines do work, and that the issue in (1) corrects itself.
Fri Nov 27 2009, 22:38:38, download attachment serout.ld
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):