| ??? 06/14/02 01:05 Read: times |
#24453 - RE: Mode 2/3: Multiprocessor Serial (again) |
"I know it'd be a doddle in MS-DOS"
It is true. Some notes to this: 1. We have used a number of 8051 MCUs in multiprocessor serial mode and one PC all connected to the RS-485. PC (old good MS-DOS) program handle 9th bit as stick parity (MARK and SPACE in Win32API) and because RS-485 is half-duplex it's no problem to control stick parity (LCR register). PC program has installed interrupt and it works very well and quickly but under Win98 MS-DOS. 2. In windows (Win32API) applications: if we have more difficult COM protocol it's better to write own program handling as multi-thredded application. Open COM as overlapped and handle as is necessary. For example: receive data severally byte per byte and save it to the own buffer (similarly for transmitter) and handle events as you like. Serial Communications in Win32 Usually I use separate threads for every task (Tx, Rx, Status). Unfortunately I never handle 9th bit for multiprocessor serial this way but -> 3. I plan to handle 9th bit another way. On this link you can find DLPortIO.zip package and there are components for BCB3 and BCB4 but it works also under BCB5 I have. It is also for NT (we test it under WNT and W2K) and it is distributed as FreeWare with source. You can access I/O ports directly and it works well. Please, read licence before you use it. There are two components TDLPortIO and TDLPrinterPortIO and second mentioned has little small error and it's necessary to correct it if you can use it. In case of this problem I can administer some notes if you like. Vaclav |



