Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics 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.

Coding for RF ID using LPC2129 doesn't give output in the hyperterminal

Status
Not open for further replies.

harshita

Member level 2
Joined
Dec 28, 2006
Messages
51
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
chennai
Activity points
1,629
u0ier

Hello sir...

This is my coding for RF ID using LPC2129...
am not getting output in Hyperterminal....but its error free only...
please help me soon......

am in need of your help guys...

Thank you...

Waiting for the reply....:cry:

#define CR 0x0D
#include <LPC21xx.H>

void init_serial (void);
int putchar (int ch);
int getchar (void);
//int getchar2(void);
int put_String(char* pString);
void put_char (int ch);
void delay(unsigned char time);

unsigned char test;
char *r,*a;
int i;
int main(void)
{
VPBDIV = 0x02; //Divide Pclk by two
init_serial();

while(1)
{
while((U0IER & 0x01));
//while(!(U0LSR & 0x01));
//*a=getchar();
//if(!(U0IER & 0x01))
//{
while(U0RBR != '\0')
//while(getchar()!='\0')
{
//while(!(U0LSR & 0x01));
*r= U0RBR;
r++;
}
//r++;
//}
//delay(1);
// i=0;

// while(*r!='\0')
//{

put_String(r);
//i++;

//}
//put_String(r);
//putchar(getchar()); //Echo terminal
}
}

void init_serial (void) /* Initialize Serial Interface */
{
//PINSEL0 = 0x00050000; /* Enable RxD1 and TxD1 */
PINSEL0 = 0x00050005;
//PINSEL1 = 0x00050000;
U1LCR = 0x00000083; /* 8 bits, no Parity, 1 Stop bit */
U0LCR = 0x00000083;
U1DLL = 0x000000C2; /* 9600 Baud Rate @ 30MHz VPB Clock */
U0DLL = 0x000000C2;
U1LCR = 0x00000003; /* DLAB = 0 */
U0LCR = 0x00000003;
U0IER = 0x07;
U0FCR= 0xC3;
// U0RBR = 0X01;

}


//int putchar (int ch) /* Write character to Serial Port */
//{

// if (ch == '\n') {
// while (!(U1LSR & 0x20));
// U1THR = CR; /* output CR */
// }
// while (!(U1LSR & 0x20));
// return (U1THR = ch);
//}


int putchar (int ch) /* Write character to Serial Port */
{

if (ch == '\n') {
while (!(U0LSR & 0x20));
U0THR = CR; /* output CR */
}
while (!(U0LSR & 0x20));
return (U0THR = ch);
}

/* int getchar (void)
{

while (!(U1LSR & 0x01));

return (U1RBR);
//return(100);
}
*/

int getchar(void)
{
//int *r;
while(!(U0LSR & 0x01));


return (U0RBR);
//return(100);
}


int put_String(char* pString)
{

int i=0;

while(*pString)
{

put_char(*pString++);
i++;

}

return i;

}

/*int get_String(char* r1)
{
int i=0;
while(*r1)
{
*r1=getchar();
r1++;
i++;
}
return *r1;
} */

void put_char (int ch) // Write character to Serial Port
{

while (!(U1LSR & 0x20));
U1THR = ch;
}




void delay(unsigned char time)
{
unsigned char i,j;
for(i=0;i<=time;i++)
for(j=0;j<=1275;j++);
}
 

u1lsr & 0x20

Hello Guys i got the output ....

In LPC2129 arm, we have 2 UART....
UART0 and UART1... I got output when i connect UART0 with Hyperterminal and UART1 to RFID kit....

But i didnt get output when i connect this viceversa.... but i change respectively too... but i didnt get the output...

please atleast reply for this guys...


thank you....
 

coding lpc2129

Hi,

Can u give some details of the RFID kit? . From ur description i understand that the RFID kit communicates with your LPC controller through UART right.

U are sending command from hyperterminal to the controller and the controller sends this to the RFID kit . right?

Correct me if i go wrong?

Is the both the UART0 and 1 initialize with identical settings?
 

u0lsr&0x01

Thanks for the reply...

But the connection your are telling is not correct one...

please make a not this:

UART0 ia connected to RFID kit.... where i have detect the RF Tag(RF CARD).....
UART1 is connected with Hyperterminal(Serial PORT in PC)....


In Hyperterminal we are going get the data from RFID KIT(When we Use that RF CARD)...

Can you understand means reply me....

But the thing is i got the answer(Output from RFID Kit), when i connect UART0 to Hyperterminal and UART1 to RFID Kit...



Thank you....
 

using uart0 in lpc2129

Hi,

As per the code the data from RFID kit is received in UART0 and the data is sent to UART 1(PC) . Please check the physical connection whether u have really connected the UART0 to RFID kit ? please put the schematics here to verify.
 

uart0 in lpc2129

Hi,

give me your mail id.. i will send the details you have asked....
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top