??? 04/07/11 19:43 Read: times |
#181768 - Serial Comms Responding to: ???'s previous message |
As already Andy noted here:
http://www.8052.com/forum/read/181722 Andy Neil said:
Think how long it actually takes the fingerprint module to transmit its message.
Do you really think you have any chance to see those characters in real time? Vaggelis Triantafillou said: do you have any idea how to receive these bytes completely ?? Use interrupt-driven reception instead, receiving the message into a buffer... The serial communications are typical for the standard 8051 class of microcontrollers. The code posted till now use the polling method to send and receive chars through the UART/serial channel. The code when receives a char should store it to a buffer of enough space [25bytes] located in iRAM. When all characters have been received, then the code should "display" them to the Leds or the 2xSeven segment displays, using a pause of the desired 0.5s or more. This procedure is for debugging. If the system could have a second serial port, could send these to a PC for monitoring. Also since the "trainer kit" includes a LCD display, could display to it using the 25 positions from the 32(2x16) available. To debug the communications channel all the prerequisities as timing, checksums, should be followed by the book. The way of using interrupt driven code could be more transparent to the procesess working in the background/foreground. The assembler writing is a choice to develop the code ? The C way of programming microcontrollers have some advantages in developing procedures, despite the most tight control that assembler provides. K.L.Angelis |