智能车制作
标题:
关于激光分时发射问题就高手解决
[打印本页]
作者:
1240144207
时间:
2011-6-16 17:12
标题:
关于激光分时发射问题就高手解决
为什么我的激光分时加了总线时钟初始化就不工作了
unsigned char Data[15]={0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F};
void Delay(unsigned int Time)
{
unsigned char i;
DDRA=0xFF;
for(i=0; i<160; i++)
for( ; Time>0; Time--);
}
void liushui(void)
{
unsigned char i;
for(i=0;i<15;i++)
{
PORTA=Data[i];
Delay(50); //500us延时 50
}
} void SetBusCLK_32M(void)
{
CLKSEL=0X00; //disengage PLL to system
PLLCTL_PLLON=1; // on PLL
SYNR =0xc0 | 0x08;
REFDV=0x60 | 0x04;
POSTDIV=0x00; //pllclock=2*osc*(1+SYNR)/(1+REFDV)=64MHz;
_asm(nop); //BUS CLOCK=32M
_asm(nop);
while(!(CRGFLG_LOCK==1)); //when pll is steady ,then use it;
CLKSEL_PLLSEL =1; //engage PLL to system;
}
void main(void)
{ SetBusCLK_32M();
for(;;) { liushui();}}
作者:
耕耘
时间:
2012-3-9 21:07
我要看看你的硬件电路是怎么连接的
欢迎光临 智能车制作 (http://111.231.132.190/)
Powered by Discuz! X3.2