Page 1 of 1

problem on 33EP64GS506 UART2

Posted: 01 Oct 2020 14:42
by msamar
hello

we are encounter problem on UART2
dosnt work
but UART1 working fine
33EP64GS506

Code: Select all

//// UART 2/////////////////////////
/// RX2
#define RX2 PORTC.B4         // RP52
#define TRIS_RX2 TRISC.B4
#define U2RX_PIN 52
// TX2
#define TX2 LATC.B3          // RP51
#define TRIS_TX2 TRISC.B3
#define U2TX_PIN 51
// EN2
#define UART2_EN LATD.B2
#define TRIS_UART2_EN TRISD.B2
////////////////////////////////////////////////////
/// UART 1  ///////////////////////////////////////
// RX1
#define RX1 PORTC.B5        //  RP53
#define TRIS_RX1 TRISC.B5
#define U1RX_PIN 53
// TX1
#define TX1 LATB.B1      // RP33
#define TRIS_TX1 TRISB.B1
#define U1TX_PIN 33
// EN1
#define UART1_EN LATD.B5         // RD5
#define TRIS_UART1_EN TRISD.B5
///////////////////////////////////////////////////////

PPS_Mapping(U1TX_PIN,_OUTPUT,_U1TX );
PPS_Mapping(U1RX_PIN,_INPUT,_U1RX );
PPS_Mapping(U2TX_PIN,_OUTPUT,_U2TX );
PPS_Mapping(U2RX_PIN,_INPUT, _U2RX );

UART2_Init(9600); 
UART1_init(9600);
Delay_ms(100);

void main()
{
   UART2_Write('A');

}

Re: problem on 33EP64GS506 UART2

Posted: 13 Oct 2020 09:15
by filip
Hi,

Have you tried your code without using the UART1 at all, only UART routines ?

Regards,
Filip.

Re: problem on 33EP64GS506 UART2

Posted: 18 Oct 2020 11:47
by msamar

Code: Select all

UART2_Init(9600); 

Delay_ms(100);

void main()
{
   UART_Write('A');

}
the same problem also for UART2

but if i use UART1 code working fine as

Code: Select all

UART1_Init(9600); 

Delay_ms(100);

void main()
{
   UART_Write('A');

}