Hi Friends, I am working on RS485 communication with PIC24F series. When i work individually for transmission and reception it works fine but when i try to integrate both it is not working properly. I am not able to figure out what could be the issue with the software? Please find the code below which i have used #include "system.h" #include "p24FJ32GA004.h" #include "f_uart.h" #ifdef __PIC24FJ32GA004__ _CONFIG1( JTAGEN_OFF & GCP_OFF & GWRP_OFF & COE_OFF&FWDTEN_OFF&ICS_PGx2&FWPSA_PR32 &WDTPS_PS32) _CONFIG2( FCKSM_CSDCMD & OSCIOFNC_OFF & POSCMOD_HS&FNOSC_PRI&I2C1SEL_SEC&IOL1WAY_ON) #else _CONFIG1( JTAGEN_OFF & GCP_OFF & GWRP_OFF & COE_OFF & FWDTEN_OFF & ICS_PGx2) _CONFIG2( FCKSM_CSDCMD & OSCIOFNC_OFF & POSCMOD_HS & FNOSC_PRI) #endif UINT8 l_receive_var; UINT8 l_receive_sts; void __attribute__((__interrupt__, auto_psv)) _U1TXInterrupt(void) { /*clear the transmission interrupt flag everytime a byte is transmitted outside. */ IFS0bits.U1TXIF = 0; } void __attribute__((__interrupt__, auto_psv)) _U1RXInterrupt(void) { UINT8 fl_test; IFS0bits.U1RXIF = 0; l_receive_var = U1RXREG; l_receive_sts = TRUE; } SINT16 main (void) { UINT16 fl_partiy_sel_U16; UINT16 i; fl_partiy_sel_U16 = UART_UXMODE_NO_PAR_8BIT; AD1PCFG = 0xffff; for(i = 0 ; i<1000;i++); /*UART1 RX remappable configuration*/ RPINR18bits.U1RXR = 0; /*UART1 TX remappable configuration*/ RPOR1bits.RP3R = 3; /*Configuring the reception enable RE IO as output*/ _TRISB1_DEF = 0; /*Configuring the Transmission enable DE IO as output*/ _TRISB2_DEF = 0; /*configuring the IO as 0 to enable the reception mode*/ _RB1 = 0; _RB2 = 0; /*baud rate - system clock is 8 MHz*/ U1BRG = SYSCLK /32/19200 - 1; U1MODE = (UART_UXMODE_EN | UART_UXMODE_IDLE_CON | UART_UXMODE_DIS_WAKE | UART_UXMODE_DIS_LOOPBACK | UART_UXMODE_DIS_ABAUD | fl_partiy_sel_U16 | UART_UXMODE_1STOPBIT); U1STA = ( UART_STS_INT_TX_BUF_EMPTY | UART_STS_IrDA_POL_INV_ZERO | UART_STS_SYNC_BREAK_DISABLED | UART_STS_TX_ENABLE | UART_STS_INT_RX_CHAR| UART_STS_ADR_DETECT_DIS ); //UART_STS_RX_OVERRUN_CLEAR); IEC0bits.U1TXIE = 1; IEC0bits.U1RXIE = 1; IFS0bits.U1TXIF = 0; IFS0bits.U1RXIF = 0; IPC3bits.U1TXIP = 2; IPC2bits.U1RXIP = 3; IFS0bits.U1TXIF = 0; while(1) { if(FALSE != l_receive_sts) { l_receive_sts = FALSE; l_receive_var = 0; for(i = 0 ; i<1000;i++); _RB1 = 1; _RB2 = 1; for(i = 0 ; i<1000;i++); U1TXREG = 'A'; _UTXEN = 1; for(i = 0 ; i<500;i++); _UTXEN = 0; _RB1 = 0; _RB2 = 0; for(i = 0 ; i<100;i++); } } return 0; Please let me know if i need to change something in my configuration. Please send me the example code for RS485 if available which would help me in understanding the code Thanks and Regards Manju Bargavi -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist