发表于:2007/3/23 8:03:00
#4楼
这个是我实验程序。希望可以给些帮助。
#include
#define uchar unsigned char
#define uint unsigned int
#define ulong unsigned long
__CONFIG(XT&UNPROTECT&PWRTEN&BORDIS&WDTEN);
//asm("FILL (GOTO $),(0x0FFF-$)");
union {
struct {
unsigned b0:1;
unsigned b1:1;
unsigned b2:1;
unsigned b3:1;
unsigned b4:1;
unsigned b5:1;
unsigned b6:1;
unsigned b7:1;
}tpBit;
unsigned char tpBits;
} tp;
#define bj0 tp.tpBit.b0
#define bj1 tp.tpBit.b1
#define bj tp.tpBits
const unsigned char table[]={ 0x60,0x30,0x90,0x0C0, };
const unsigned char tablef[]={0x0C0,0x90,0x30,0x060, };
uchar i;
///AD 延时子程序
void ADdelay (uchar i)
{