Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

dsPIC30F6015, ede1144.

Status
Not open for further replies.

acampos1

New Member
I am trying to display on the LCD screen the key of the keypad. For that to happen I am using a keypad encoder(ede 1144). I have the keypad encoder connected to 9600. Every time I enter a key, what is display is 255, instead of the actual key I pressed. I am not really familiar with the UART, so could anybody take a look at my code. Thanks


void initUART()
{
U2MODEbits.UARTEN = 1;
U2MODEbits.PDSEL0 = 0;
U2MODEbits.PDSEL1 = 0;
U2MODEbits.STSEL = 0;
U2STA = 1;
IFS1bits.U2RXIF = 0;
IEC1bits.U2RXIE = 1;

U2BRG = 0X00C7;

}
void __attribute__((__interrupt__)) _U2RXInterrupt(void)
{
char buff[50];
sprintf(buff, "%i", U2RXREG);
Send_String(buff);

IEC1bits.U2RXIE = 0;
U2MODEbits.UARTEN = 0;
//RTFbits.RF5 = 1;
IFS1bits.U2RXIF = 0;
IEC1bits.U2RXIE = 1;
U2MODEbits.UARTEN = 1;
}
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top