Datasheet

Programming PIC Microcontrollers in BASIC - mikroElektronika
Description Routine sends number of bytes (1 < datalen <= 3) from buffer via 485, to slave specified by <address>.
MCU must be initialized as Master in 485 communication. It is programmer's responsibility to ensure (by
protocol) that only one device sends data via 485 bus at a time.
Example
RS485Master_Write(dat, 1)
5.2.14.4 RS485Slave_Init – Initializes MCU as Slave in RS485 communication
Prototype sub procedure RS485Slave_Init(dim address as byte)
Description Initializes MCU as Slave in RS485 communication. USART needs to be initialized.
<address> can take any value between 0 and 255, except 50, which is common address for all slaves.
Example
RS485Slave_Init(160) ' initialize MCU as Slave with address 160
5.2.14.5 RS485Slave_Read – Receives message from Master
Prototype
sub procedure RS485Slave_Read(dim byref data as byte[5])
http://www.mikroelektronika.co.yu/english/product/books/picbasicbook/05.htm (90 sur 112)05/11/2004 02:20:53