Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

USB low-full-high speed peripherals

张鹏
Level 1
First reply posted First question asked Welcome!
Level 1

BYTE TEMP;

void FX2LPSerial_Init() // initializes the registers for using Timer2 as baud rate generator for a Baud rate of 38400.
{
TMOD = (TMOD & 0x0F) | 0x20;
CKCON |= 0x10;
PCON |= 0x80 ;
EICON |= 0x80;
SCON1 = 0x50;
TH1 = 0xB2 ;
ES1 = 1;
TR1 = 1;
EA = 1;
}

void send_data(BYTE source)
{
SBUF1 = source;
while(TI1 == 0);
TI1 = 0;
}

void send_isr() interrupt 7
{
if(RI1 == 1)
{
RI1 = 0;
TEMP = SBUF1;
}
}

0 Likes
1 Solution
2 Replies