工具篇
CodeVisionAVR
AVRStudio
编程注意点
预定义的模块结构及访问
typedef struct PORT_struct
{
unsigned char DIR; // I/O Port Data Direction
unsigned char DIRSET; // I/O Port Data Direction Set
unsigned char DIRCLR; // I/O Port Data Direction Clear
unsigned char DIRTGL; // I/O Port Data Direction Toggle
...
} PORT_t;
#define PORTA (*(volatile PORT_t *) 0x0600)
后缀名
_bm(Bit mask) 可以用来设置/清楚指定bits
TCD0.CTRLD |= TC_EVDLY_bm