amrshata
Member level 1
hi every one i have a problem that i can't find any solution for it i try to connect pc to mcu using rs485 line as it have long distance
efficeiny so i bought usb to rs485 converter .. and bought max485 .. to make the interface between them as shown in the picture
i tried two ways ... first by consdering it's normal uart interface and i used the interface modules in mikroc . and i got errors ..
first as RC2 are not defind for normal uart interface .. so when i connect it with resistance 10k to volt .. errors occure too
.. that i recevie .... start repeated many times
output on virtual terminal
03:38:00 …ÉÑ)
03:38:04 art
03:38:12 Ñ…ÉÑ)
03:38:14 Starô
03:38:15 ¡ø
03:38:16 —¨ø
03:38:17 Start
and as i write on virtual nothing recevied
second i used the RS485 modules in the mikroc .. where here i have problem as when i send from master (pc) to slave (pic) .. i must
define the slave address in the virtual terminal ... and i can't find a way to do so in mikroc . .. .. guys .. please help me
efficeiny so i bought usb to rs485 converter .. and bought max485 .. to make the interface between them as shown in the picture
i tried two ways ... first by consdering it's normal uart interface and i used the interface modules in mikroc . and i got errors ..
first as RC2 are not defind for normal uart interface .. so when i connect it with resistance 10k to volt .. errors occure too
.. that i recevie .... start repeated many times
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 char uart_rd; void main() { ANSEL = 0; // Configure AN pins as digital ANSELH = 0; UART1_Init(9600); // Initialize UART module at 9600 bps Delay_ms(100); // Wait for UART module to stabilize UART1_Write_Text("Start"); UART1_Write(10); UART1_Write(13); while (1) { // Endless loop if (UART1_Data_Ready()) { // If data is received, uart_rd = UART1_Read(); // read the received data, UART1_Write(uart_rd); // and send data via UART } }}
output on virtual terminal
03:38:00 …ÉÑ)
03:38:04 art
03:38:12 Ñ…ÉÑ)
03:38:14 Starô
03:38:15 ¡ø
03:38:16 —¨ø
03:38:17 Start
and as i write on virtual nothing recevied
second i used the RS485 modules in the mikroc .. where here i have problem as when i send from master (pc) to slave (pic) .. i must
define the slave address in the virtual terminal ... and i can't find a way to do so in mikroc . .. .. guys .. please help me
Last edited: