MikroElektronika PIC Microcontrollers PIC16 Fiche technique Page 133

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 194
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 132
Programming PIC Microcontrollers in BASIC - mikroElektronika
Description Only messages that appropriately address Slaves will be received. As messages are multi-byte, this procedure
must be called for each byte received (see the example at the end of the chapter). Upon receiving a message,
buffer is filled with the following values:
data[0..2] is actual data
data[3] is number of bytes received, 1..3
data[4] is set to 255 when message is received
data[5] is set to 255 if error has occurred
rest of the buffer is undefined
Procedure automatically sets data[4] and data[5] upon every received message. These flags need to be cleared
repeatedly from the program.
MCU must be initialized as Master in 485 communication to assign an address to MCU.
Example
RS485Slave_Read(dat)
5.2.14.6 RS485Slave_Write – Sends message to Master
Prototype
sub procedure RS485Slave_Write(dim byref data as byte[2], dim datalen as
byte)
http://www.mikroelektronika.co.yu/english/product/books/picbasicbook/05.htm (91 sur 112)05/11/2004 02:20:55
Vue de la page 132
1 2 ... 128 129 130 131 132 133 134 135 136 137 138 ... 193 194

Commentaires sur ces manuels

Pas de commentaire