Mikroelektronika MIKROE-442 데이터 시트
![Mikroelektronika](https://files.manualsbrain.com/attachments/e0529b3b58069a916ad7bb89f7e9f5f0eda73421/common/fit/150/50/1b07b99aa3112e022a916b06db07f1f4f211e91d41878452d87c7638b1bf/brand_logo.gif)
mikroBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
441
Library Dependency Tree
The following variable must be defined
in all projects using RS-485 Library:
Description:
Example:
dim RS485_rxtx_pin as sbit sfr
external
Control RS-485 Transmit/Receive
operation mode
dim RS485_rxtx_pin as sbit at RF2_
bit
dim RS485_rxtx_pin_direction as
sbit sfr external
Direction of the RS-485 Transmit/
Receive pin
dim RS485_rxtx_pin_direction as sbit
at TRISF2_bit
External dependencies of RS-485 Library
Library Routines
- RS485Master_Init
- RS485Master_Receive
- RS485Master_Send
- RS485Slave_Init
- RS485Slave_Receive
- RS485Slave_Send
RS485Master_Init
Prototype
sub procedure RS485Master_Init()
Description Initializes MCU as a Master for RS-485 communication.
Parameters None.
Returns
Parameters None.
Returns
Nothing.
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). RE/DE signal controls RS-485 transceiver operation mode.
-
RS485_rxtx_pin_direction
- direction of the RS-485 Transmit/Receive pin.
must be defined before using this routine.
UART HW module needs to be initialized. See UARTx_Init.
Example
‘ RS485 module pinout
dim RS485_rxtx_pin as sbit at RF2_bit
dim RS485_rxtx_pin_direction as sbit at TRISF2_bit
‘ End of RS485 module pinout
...
UART1_Init(9600) ‘ initialize UART1 module
RS485Master_Init() ‘ intialize MCU as a Master for RS-485 communication
Notes
None