Ответ: В компонентах ASyncPro от TurboPower есть поддержка RS485 сигналом DTR. Все нормально работает.
(«Телесистемы»: Конференция «Микроконтроллеры и их применение»)

миниатюрный аудио-видеорекордер mAVR

Отправлено vladvash 11 мая 2004 г. 11:30
В ответ на: Помогите подружиться с RS-485 отправлено sda 11 мая 2004 г. 11:10

RTS Control

Since the TApdComPort provides an RTS property your application could manually raise RTS before transmitting data and lower RTS after transmitting. This would work in theory, but is somewhat problematic in that when a PutXxx method has returned, the data may not have been completely transmitted and lowering RTS at that time would result in some data being truncated. Even lowering RTS after a calculated delay would be error prone since the calculation would have to account for delays in UART (the serial port chip) buffering and would be susceptible to unpredictable delays due to multitasking.

A better approach is to use Async Professional's built-in RTS line control, which is available through the RS485Mode property. When RS485Mode is set to True all PutXxx methods raise RTS before transmitting the first byte, wait for the data to be completely transmitted, then lower RTS. The wait accurately accounts for data in the UART, assuring that RTS is lowered at the proper time.

Caution: The RTS line control follows the output buffer. If the output buffer empties while your code is formatting and transmitting a command, the RTS line could be lowered and re-raised - which might cause some RS-485 devices to misinterpret the message.



Составить ответ  |||  Конференция  |||  Архив

Ответы



Перейти к списку ответов  |||  Конференция  |||  Архив  |||  Главная страница  |||  Содержание  |||  Без кадра

E-mail: info@telesys.ru