Problem pin UART mapping
Posted: 30 Jul 2020 05:39
Hai guys, I used dsPIC33FJ06GS502. I want to use UART and map pin UART to RP6 and RP7. Here my code
When I test pin RP6&RP7, the data can not be shown. What wrong is that code?
Thanks
Code: Select all
unsigned char data1 = 0x11, data2 = 0x12;
void main() {
//ADC1_Init();
//uart1_Initial();
Unlock_IOLOCK();
st1=PPS_Mapping(7, _OUTPUT, _U1TX);//setting pin TX_UART1
st2=PPS_Mapping(6, _INPUT,_U1RX);//setting pin RX_UART1
Lock_IOLOCK();
Delay_ms(100);
UART1_Init(9600);
Delay_ms(100);
//u= trapz1(20,100,200);
while (1){
Delay_ms(500);
UART_Write(data1);
}
}
Thanks