Re: 2nd hardware UART
you don't appear to have set the portb pins used to digital [anselb =$f6]
or not
mcc sets the involved registers like this to match your settings
TRISB = 0xFE;
ANSELB = 0xF6;
U2RXPPS = 0x0B; //RB3->UART2:RX2;
RB0PPS = 0x16; //RB0->UART2:TX2;
U2P1L = 0x00;
U2P1H = 0x00;
U2P2L = 0x00;
U2P2H = 0x00;
U2P3L = 0x00;
U2P3H = 0x00;
U2CON0 = 0xB0;
U2CON1 = 0x80;
U2CON2 = 0x00;
U2BRGL = 0x82;
U2BRGH = 0x06;
U2FIFO = 0x00;
U2UIR = 0x00;
U2ERRIR = 0x00;
U2ERRIE = 0x00;
Last edited by richard; - 13th August 2024 at 01:05.
Reason: oh you posted again when i reading the data sheet
Warning I'm not a teacher
Bookmarks