#include<pic.h>
#define uchar unsigned char
#define uint unsigned int
__CONFIG(0x3B31);
void init();
//void delay(uint x);
void main()
{
init();
//TRISA2=0;
TXREG=1;
while(!TRMT);
while(1);
}
void init()
{
//TRISB5=1;//
// TRISB7=0;
TRISB=0XFF;
PORTB=0XFF;
TXSTA=0x24;
RCSTA=0x90;
SPBRG=71;
GIE=1;
PEIE=1;
RCIE=1;
}
void interrupt com()
{
if(RCIE&&RCIF)
{ RCIF=0;
TXREG=RCREG;
while(!TRMT);
TRMT=0;
}
}
|