AT89C2051利用中断产生PWM
#include "REG2051.H"
#include "intrins.h"
#define uint unsigned int
#define uchar unsigned char
const TH_600=0xfd;
const TL_600=0xd4;
const TH_1200=0xfb;
const TL_1200=0x7c;
const TH_2400=0xf6;
const TL_2400=0xa0;
sbit PWM=P3^7;
bit ld=0; //上一次发送的数据
uchar _pool[10];
uchar _length;
uchar _index;
uchar _bit_index;
void onKeyDown(uchar,uchar);
void push(uchar);
void init();
void main(){
}
void init(){
}
void push(uchar xcode){
}
void reset(){
}
void onKeyDown(uchar row,uchar column){
}
void timer_pwm() interrupt 1{
}
产生的波形
1200ms为1
600us为
根据NEC协议制作的波形图
#define uint unsigned int
#define uchar unsigned char
sbit PWM=P3^7;
uchar code Pcode[]={0x16,0x0C,0x18,0x5E,0x08,0x1C,0x5A,0x42,0x52,0x4A,0x47,0x44,0x40};
void onKeyDown(uchar,uchar);
void write_data(uchar);
void start();
void delay_560(void);
void delay_1690(void);
void delay_4500(void);
void main(){
}
void onKeyDown(uchar row,uchar column){
}
void start(){
}
void write_data(uchar d){
}
void delay_560(void)
{
}
void delay_1690(void)
{
}
void delay_4500(void)
{
}
AT89C2051中断PW 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)