I am trying to connect UART2 engine to RD6 (Tx) and RD7 (Rx). For this I used PPS feature over RD6 and RD7.
When I check in debug mode, I get the Tx Interrupt and I can see that TX2REG is filled with the correct data everytime.
However, I don't see the data coming out of the RD6 pin, when I tapped the pin on Oscilloscope.
My immediate doubt is on PPS initialisation. I tried whatever I could but could not get data on Pin.
Please let me know where I am getting wrong.
PPS enabling... I tried both combinations (OFF and ON )
Not directly answering your question, the default state for the PPSLOCKED bit is 'off'(0) so I strongly suggest that you don't try to play with the unlock/lock settings until you have everything working.
When you do, the unlock sequence MUST be executed bu the MCU as consecutive instructions. Unfortunately this is not guaranteed by any C compiler and you really need to use the in-line assembler capability - or better yet any built-in capability that your compiler might provide for you (some provide macros that do these special sequences for you).
Are you using a 28-pin or a 40-pin device? Your setting for the RD6PPS implies that it must be a 40-pin device.
Also the 2nd line (RD7PPS = 0x0b) might be confusing things a bit.
Susan