We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello
I try to set up a test environment with the keil environment with an ADUC848 from analog device.
Basically my application acquires data from ADC and sends it to a host on UART link every 240 ms, and waits for an acknowledge from the host.
The acquisition is started when a “HELLO frame is received “, so the protocol communication protocol looks like that:
HOST : Send Hello
Simulated ADUC848 : Ack Hello
Simulated ADUC848 : Send DATA t0
HOST : Ack DATA
Simulated ADUC848 :Send DATA t0 + 240 ms
Simulated ADUC848 : Send DATA t0 + 480 ms
....
The UART link between keil simulator and the host are by a cross cable between COM1 ( the host) and COM4 (connected to keil simulator)
The communication protocol is set with a baud rate of 9600 bps, and 9 data bits with even parity.
The communication between host and simulator are correct, the Hello frame is received by the simulator, and correctly acknowledged to the host.
The Data frame has a length of 26 characters, so the expected time of transmission it 26/27 ms ( at 9600 bps).
By installing an UART spy between host and simulator, I measure a total sending time of data frame about 235-250 ms, with some times a gap of 30 to 40 ms between each sendig of a character.
Waht could be the reason for this large time to send the frame ? A clue to solve this problem ?
Thanks in advance.
Nicolas BERTRAND
When I wrote FIFO, I didn't mean the general case of first-in-first-out as in your normal ring-buffer for pending data to send, but an UART that has hardware FIFO to allow multiple characters to be given to the UART at the same time.
It is only with a UART with FIFO that you may let the simlated machine see more than one character at a time, allowing the simulator to send more than one character to the Windows serial driver.
With a UART without FIFO, you have to assume that there will be a pause between each sent character, since the PC UART runs dry and have to wait until the simulator wakes your program so you can put a new character into the simulated UART so there will be any character to restart the PC UART with.
In short: It is expected that a simulation will not be able to run the PC serial port at optimum speed. If the simulated UART has FIFO support and the program makes use of it, then the simulator has a better chance of keeping the PC UART constantly running. When Keil simulates the serial port for logging to the IDE or a file, it is possible to set an option that the simulator should ignore baudrate and instantly allow the simulated UART to accept more characters. But that is a special case intended for logging of data - not for use as a general serial port with hand-shake signals and data being sent in both directions.