FrustratedEngineer
Newbie level 6
Guys,
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 )
Initialisation of PPS on RD6 and RD7
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 )
Code:
#pragma config PPS1WAY = OFF
Initialisation of PPS on RD6 and RD7
Code:
ANSELDbits.ANSELD6 = 0;
ANSELDbits.ANSELD7 = 0;
TRISDbits.TRISD6 = 0;
TRISDbits.TRISD7 = 1;
PPSLOCK = 0x55;
PPSLOCK = 0xAA;
PPSLOCKbits.PPSLOCKED = 0x00; // unlock PPS
RD6PPS = 0x0B; //RD6->EUSART2:TX2;
RD7PPS = 0x0B; //RD7->EUSART2:RX2
RX2PPSbits.RXPPS = 0x1F; //RD7->EUSART2:RX2;
PPSLOCK = 0x55;
PPSLOCK = 0xAA;
PPSLOCKbits.PPSLOCKED = 0x01; // lock PPS