A few days ago I got a good answer. Thank you.
This time I am trying to transfer data using RS485 4 click.
"RS485_4_click" was installed on "mikromedia_Plus_for_STM32_ARM_Shield"-BUS4
Code: Select all
sbit RS485_rxtx_pin at GPIOE_ODR.B5;
void main() {
Start_TP();
UART2_Init(19200); // initialize UART1 module
Delay_ms(100);
RS485Master_Init(); // intialize MCU as a Master for RS-485 communication
USART2_CR1bits.RXNEIE = 1; // enable uart rx interrupt
GPIO_Digital_Input(&GPIOE_IDR, _GPIO_PINMASK_3);
NVIC_IntEnable(IVT_INT_USART2); // enable interrupt vector
while (1) {
Check_TP();
if((Button(&GPIOE_IDR, 3, 1, 0)) && (a == 0)){
RS485Master_Send(dat,1,160);
a = 1;
}
if((Button(&GPIOE_IDR, 3, 1, 1)) && (a == 1)){
a = 0;
}
}
}
PE5Pin responds at the press of a button,
But communication is unresponsive.
PA3-USART2 RX
PD5-USART2 TX
Can't set
What should I do?
Thank you in advance !!