Chapter 11: Serial Interfacing. There are many serial protocols. Interrupt synchronization will be used in situations where the system is fairly complex. Nov 09, 2007 Interrupt USART receive for reliable serial. I see users had a lot of problems getting reliable serial reception. You don't NEED interrupts if you can. Interruption rs232 MIKROC Search and download interruption rs232 MIKROC open source project / source. Rs232 is an asynchronous serial communications protocol.
RS-485 is a multipoint communication which allows multiple devices to be connected to a single bus. The mikroC PRO for PIC provides a set of library routines for comfortable work with RS485 system using Master/Slave architecture. Master and Slave devices interchange packets of information. Pinnacle Studio 9 Pal Serial Podcast. Each of these packets contains synchronization bytes, CRC byte, address byte and the data.
Each Slave has unique address and receives only packets addressed to it. The Slave can never initiate communication.
It is the user’s responsibility to ensure that only one device transmits via 485 bus at a time. The RS-485 routines require the UART module. Pins of UART need to be attached to RS-485 interface transceiver, such as LTC485 or similar (see schematic at the bottom of this page). Library constants: • START byte value = 150 • STOP byte value = 169 • Address 50 is the broadcast address for all Slaves (packets containing address 50 will be received by all Slaves except the Slaves with addresses 150 and 169).
Important: • The library uses the UART module for communication. The user must initialize the appropriate UART module before using the RS-485 Library. • For MCUs with multiple UART modules it is possible to initialize them and then switch by using the routine. Library Dependency Tree External dependencies of RS-485 Library The following variable must be defined in all projects using RS-485 Library: Description: Example: extern sfr sbit RS485_rxtx_pin; Control RS-485 Transmit/Receive operation mode sbit RS485_rxtx_pin at RC2_bit; extern sfr sbit RS485_rxtx_pin_direction; Direction of the RS-485 Transmit/Receive pin sbit RS485_rxtx_pin_direction at TRISC2_bit; Library Routines • • • • • • RS485Master_Init Prototype void RS485Master_Init(); Returns Nothing. Description Initializes MCU as a Master for RS-485 communication. Requires Global variables: • RS485_rxtx_pin - this pin is connected to RE/DE input of RS-485 transceiver(see schematic at the bottom of this page).