RS485 not working in pic24fj128ga202
I guess you have triple-checked the baud rates between the microcontrollers, as well as between receive uart1 and the hyperterminal.

The receive code is not correct:

    while(1)
        {
            uart1str(uartrec4());  //printing received uart4 data in hyperterminal
            Delayms(1000);
        }


Problem here is that uartRec4 receives one character. What happens is:


sender sends out 7 bytes, waits one second
receiver receives the first byte, send it out, then ignores everything for 1 second.


Remove your delayms(1000) from the receiver side. Ensure that you're using the same bandwidth both between pics and also on hyperterminal.



If still not work, try to split into parts:


make a "receiver" side which does not receive anything just prints Hello to uart1 - this checks if you have everything correct towards the PC
send only one character, e.g. an A on the sender, wait 1000ms and repeat - this does not require any buffering and special timing consideration.


Note that uart1str(uartrec4()) can also be problematic if the hw uart does not have a buffer (PICs do have a 2 byte receiver buffer, afaik). (The problem is that you're waiting for one byte, then while sending it out to uart1, another byte may arrive which you supposed to check for.)