abinesh raja
Newbie level 6
- Joined
- Mar 3, 2013
- Messages
- 14
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- INDIA
- Activity points
- 1,374
I CHECKED EUART PROGRAM OF PIC18F45K22 BY ECHOING THE CHARACTER BUT I HAVE NO RESULT.I CHECKED TRANSMITTING IT WORKED FINE.
HERE IS MY PROGRAM
I THINK THAT THE RECEIVER INTERRUPT FLAG IS NOT SETTING.
THANKS IN ADVANCE
HERE IS MY PROGRAM
Code:
#include<htc.h>
#include<pic18.h>
unsigned char e;
void tx(unsigned char c)
{
while(!TRMT1);
TXREG1='c';
}
void main()
{
TRISC6=0;
TRISC7=1;
BAUDCON1=0x40;
SPBRG1=25;
TXSTA1=0x06;
RCSTA1=0x80;
ANSELC=0;
GIE=1;
PEIE=1;
RC1IF=1;
TXEN1=1;
CREN1=1;
while(1)
{
while(!RC1IF)
{
e=RCREG1;
DelayMs(100);
tx(e);
}
}
}
THANKS IN ADVANCE
Last edited by a moderator: