原理图
程序
#include <iom8v.h>
#define uchar unsigned char
#define uint unsigned int
//定义BIT 0-7 置1
#define BIT0_POS (1<<0)
#define BIT1_POS (1<<1)
#define BIT2_POS (1<<2)
#define BIT3_POS (1<<3)
#define BIT4_POS (1<<4)
#define BIT5_POS (1<<5)
#define BIT6_POS (1<<6)
#define BIT7_POS (1<<7)
//定义BIT 0-7 清零
#define BIT0_NEG ((unsigned char)(~(1<<0)))
#define BIT1_NEG ((unsigned char)(~(1<<1)))
#define BIT2_NEG ((unsigned char)(~(1<<2)))
#define BIT3_NEG ((unsigned char)(~(1<<3)))
#define BIT4_NEG ((unsigned char)(~(1<<4)))
#define BIT5_NEG ((unsigned char)(~(1<<5)))
#define BIT6_NEG ((unsigned char)(~(1<<6)))
#define BIT7_NEG ((unsig