سلام
اينطوري كه من برداشت كردم
[align=left:4b4f85cf7f]
کد:
function DoRS232Send(DataOutByte:byte):integer; stdcall;
Function sends byte to microcontroller RS232 line at current baudrate.
Parameters
DataOutByte
[in] Value to send to microcontroller RS232 line.
Return values
If the function succeeds, the return value is NO_ERROR.
If the function fails, the return value is DEVICE_NOT_PRESENT (device is disconnected).
Notes:
Function waits for transmitting given byte: all data bits + stop bit are transmitted before function end.
طبق كد بالا كه براي برنامه كامپيوتر هست ديتا رو روي ميكرو ميفرسته يعني از usb به ميكرو هست
اينم كد دوم:
[/align:4b4f85cf7f]
کد:
function DoRS232Read(var DataInByte:byte):integer; stdcall;
Function reads byte received by microcontroller RS232 line.
Parameters
DataInByte
[out] Byte received from microcontroller RS232 line.
Return values
The return values are:
NO_ERROR - one byte received (returned in DataInByte)
NO_DATA_AVAILABLE - no data was received (value DataInByte is not valid)
OVERRUN_ERROR - more bytes was received, but another received bytes was lost: in DataInByte is returned only the first received byte
DEVICE_NOT_PRESENT - error: device is disconnected
پايه هاي RXD,TXD هم مي تونه وصل ميكروي اصلي بشه كه گفتم هم مي تونه با كمك يك MAX232 وصل پورت com بشه
در مورد اينكه آيا مستقيما روي پورت com بفرسته تست نكردم
اين فايل هم بگيرين توابع رو كامل توضيح داده
دانلود