
12-30-2003, 03:33 PM
|
 |
Code Meister
Retired Moderator * Guru *
|
|
Join Date: Aug 2000
Location: Vancouver, BC, Canada
Posts: 10,441
|
|
|
So you wish to send characters to your microprocessor one at a time with a 1ms delay between each char.
It's easy enough to put in a delay; just use the QueryPerformanceCounter API (see my tutorial on "A brief history of Time and Date" in Tutors Corner)....
One possible problem lies with the nature of windows communication routines. As I understand it, windows *may* buffer any data you send via the API (the mscomm control is just a wrapper for the API) and then blow it out the port in one go. This is not good for you....
*IF* this is the case, then you will need to send the characters out the port yourself without using windows API. The way to do this is to use the INP and OUT commands from the INPOUT32.DLL module (check the FAQ at the top of the communications forum) to send data directly to the port address.
It may be that mscomm will work for you, if so, great. But if it doesn't, then try the inpout32.dll method.
|
__________________
"I have a plan so cunning you could put a tail on it and call it a weasel!" - Edmund Blackadder
|