STC8A8K64D4 Series Manual
// Version: VER1.0
// Date: 2014-11-28
// Remark:
//========================================================================
void PrintString1(u8 *puts)
{
for (; *puts != 0;
puts++)
{
TX1_write2buff(*puts);
}
}
//========================================================================
// Function: void UART1_config(void)
// Description: UART1 initialization function.
// Parameters:none.
// Return: none.
// Version: VER1.0
// Date: 2014-11-28
// Remark:
//========================================================================
void UART1_config(void)
{
TR1 = 0;
AUXR &= ~0x01;
AUXR |= (1<<6);
TMOD &= ~(1<<6);
TMOD &= ~0x30;
TH1 = (u8)((65536L-(MAIN_Fosc / 4) / Baudrate1) >> 8);
TL1 = (u8)(65536L-(MAIN_Fosc / 4) / Baudrate1);
ET1 = 0;
INT_CLKO &= ~0x02;
TR1 = 1;
S1_USE_P30P31();
P3n_standard(0x03);
//S1_USE_P36P37(); P3n_standard(0xc0);
//S1_USE_P16P17(); P1n_standard(0xc0);
SCON = (SCON & 0x3f) | 0x40;
//
PS = 1;
ES = 1;
REN = 1;
B_TX1_Busy = 0;
}
//========================================================================
// Function: void UART1_int (void) interrupt UART1_VECTOR
// Description: UART1 interrupt function
// Parameters:nine.
// Return: none.
// Version: VER1.0
// Date: 2014-11-28
// Remark:
//========================================================================
//send a string
//End with stop 0
//S1 BRT Use Timer1;
//Timer1 set as 1T mode
//Timer1 set As Timer
//Timer1_16bitAutoReload;
// Disable Timer1 interrupt
// Timer1 does not output high-speed clock
// Start Timer1
//Switch to P3.0 P3.1
//Switch to P3.6 P3.7
//Switch to P1.6 P1.7
//UART1 mode, 0x00: synchronized shift output,
//
0x40: 8-bit data, variable baud rate,
//
0x80: 9-bit data, fixed baud rate,
//
0xc0: 9-bit data, variable baud rate
//high priority interrupt
//enable interrupt
//enable receiving
- 477 -
Need help?
Do you have a question about the micro STC8A8K64D4 Series and is the answer not in the manual?