Hello, rs485transmit(); for (i=0;i<2;i++) { UART_PUTCHAR(0x01); UART_PUTCHAR(0x04); UART_PUTCHAR(0x00); UART_PUTCHAR(0x0C); UART_PUTCHAR(0x00); UART_PUTCHAR(0x02); UART_PUTCHAR(0xB1); UART_PUTCHAR(0xC8); } rs485receive(); rx = UART_GETCHAR(); If I try to switch from transmit to receive of rs485 then it does not show last 2 bytes 0xB1 and 0xC8 instead it shows 0x00 only one time but if i do not use receive function then i transmit all bytes correctly. These are my transmit and receive function: void rs485transmit() { P2OUT |=BIT0; P2OUT |=BIT1; } void rs485receive() { P2OUT &=~BIT0; P2OUT &=~BIT1; }
↧