注册会员
- 积分
- 57
- 威望
- 30
- 贡献
- 15
- 兑换币
- 13
- 注册时间
- 2012-11-29
- 在线时间
- 6 小时
|
1贡献
#include <hidef.h>
#include<mc9s12xs128.h>
void SET_PLL()
{
CLKSEL=0x00;
PLLCTL_PLLON=1;
SYNR=0xc0|0x02;
REFDV=0x80|0x01;
POSTDIV=0x00;
_asm(nop);
_asm(nop);
while(!(CRGFLG_LOCK==1));
CLKSEL_PLLSEL=1;
while(1);
}
void uart_init (void)
{
SCI0CR2=0x80;
SCI0BDH=0x00;
SCI0BDL=0x9c;
}
void uart_putchar(unsigned char ch)
{
while(!(SCI0SR1&0x40))
{}
SCI0DRL=ch;
}
void main (void)
{
uchar str []={'h','e','l','l','o'};
uchar i=0;
SET_PLL();
EnableInterrupts;
uart_init ();
for (;i<5;i++)
uart_putchar(str[i]);
for(;;)
{}
}
程序有问题吗?
|
|