#include
#include “intrins.h”
#define uchar unsigned char
#define uint unsigned int
sbit W_CLK= P1^0;
sbit PQ_UD= P1^1;
//sbit RET= P1^2;
uchar word[5]={0x00,0x00,0x00,0x00,0x00};
unsigned long int k=42.94967296*400;//15000000便是所要输出的频率值,//若晶振不同为其他频率更改数值就行了
void chang(unsigned long int t)
{
word[1]=k>>24;
word[2]=k>>16;
word[3]=k>>8;
word[4]=k;
}
delay_1ms(uint t)
{
uint i,j;
for(i=0;ifor(j=0;j<120;j++);
}
main()
{
uint i;
//RET=1;
delay_1ms(100);
W_CLK=0;
PQ_UD=0;
// RET=0;
chang(k);
while(1)
{
for(i=0;i<5;i++)
{
P0=word[i];
W_CLK=1;_nop_();
W_CLK=0;_nop_();
}
PQ_UD=1;_nop_();
PQ_UD=0;_nop_();
}
}
声明:本文内容来自网络转载或用户投稿,文章版权归原作者和原出处所有。文中观点,不代表本站立场。若有侵权请联系本站删除(kf@86ic.com)https://www.86ic.net/ceping/baogao/256480.html