Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

[SOLVED] PIC18F65K22 Uart2 Reception Not Working...UART1 TX/RX workin

Status
Not open for further replies.

kawal_547

Newbie level 5
Joined
May 5, 2011
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,334
Hi,

I am working on PIC18F65k22. I am getting problem in UART2 Reception Mode.
UART1 transmission is OK
UART1 RECEption is OK
UART2 Transmission is oK

I am sending you the program

char uart_rd;
void main()
{
Delay_ms(1000);
UART2_INIT();
UART2_Write_Text("UART2 tESTING");
while(1)
{
UART2_Write_Text("USART2 Testing");
if (UART2_Data_Ready())
{ // If data is received,
uart_rd = UART2_Read(); // read the received data,
UART2_Write(uart_rd); // and send data via UART
}
}
}
void USART2_INIT()
{
ANCON2.ANSEL18=0; //Digital Pin RX2/AN18
ANCON2.ANSEL19=0; //Digital Pin TX2/AN19
CM3CON.CON=0; //Comparator is Disabled
ODCON3=0; //Open Drain Capability Disable
RCSTA2.SPEN=1; //Serial Port Enable
TRISG.RG2=1; //RG2/Rx2 ia made Input
TRISG.RG1=0; //RG1/TX2 ia made Output
UART2_Init(9600);
}
 

kawal_547

Newbie level 5
Joined
May 5, 2011
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,334
My Software is 100% correct..Problem was in hardware...My this problem is solved by me only....
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top