problem on 33EP64GS506 UART2

General discussion on mikroC PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
msamar
Posts: 69
Joined: 03 Oct 2004 16:08
Contact:

problem on 33EP64GS506 UART2

#1 Post by msamar » 01 Oct 2020 14:42

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');

}
msamar

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: problem on 33EP64GS506 UART2

#2 Post by filip » 13 Oct 2020 09:15

Hi,

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

Regards,
Filip.

msamar
Posts: 69
Joined: 03 Oct 2004 16:08
Contact:

Re: problem on 33EP64GS506 UART2

#3 Post by msamar » 18 Oct 2020 11:47

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');

}
msamar

Post Reply

Return to “mikroC PRO for dsPIC30/33 and PIC24 General”