初始化:
void uart_init(void)
{ SCBR = 0x86; //CKS 0 SCP1 SCP0 R SCR2 SCR1 SCR0
// 1 0 0 0 0 1 1 0
SCC1 = 0x5C; //LOOPS ENSCI 0 M WAKE ILTY PEN PTY
// 0 1 0 1 1 1 0 0
SCC2 = 0x2A; //SCTIE TCIE SCRIE ILIE TE RE RWU SBK
// 0 0 1 0 1 0 1 0
SCC3 = 0; }
发送:
if(SCS1 & 0xC0)
{ SCDR = a; }
[此贴子已经被作者于2005-12-22 21:32:56编辑过] |