Sending (sequential) break using windows (XP +) api

Is there a better way to send a sequential break, then a setcommbreak - delay - clearcommbreak sequence?

I need to contact a microcontroller that uses serial break as the start of a 115k2 packet, and setcommbreak has two problems:

  • with 115k2, the gap is well below 1 ms and it will receive a critical time.

  • Since the gap should be embedded in the packet stream in the correct position, I expect problems with fifo.

Is there a better way to do this without moving serial communication into a stream without fifo? UART is usually 16550 +

I have a choice in the sense that the microcontroller setting can be switched (other firmware) to a more conventional batch format, but the manual warns that the “split” method involves checking the integrity of the serial interface hardware.

The compiler is Delphi (2009 / XE), but any code or even just a link is welcome.

+3
source share
1 answer

The short answer is that serial programming with Windows is pretty limited: - (

, SetCommBreak(), , , , , . , - , , , .

, , , , , .

, , , () (), , ( ), "" , , , - . , , , , . ( , , , -, : -)

, (SetCommBreak() ) , , (.. FIFO ). Windows Serial , SetCommMask(), WaitCommEvent() .., .

+5

Source: https://habr.com/ru/post/1783238/


All Articles