1.中断相关
使用中断要包含头文件#include<avr/interrupt.h>
开全局中断:sei();
关全局中断:cli();
中断服务函数:ISR(xxxx_vect)
2.一位外国网友(AVRFREAKS)的FAQ:
FAQ#1:ISR/main shared variables MUST be defined 'voiatile'
FAQ#2:embeded programs must NEVER return from main()
FAQ#3:99.9% of UART errors are AVRs not being clocked right
FAQ#4:If using avr-gcc aviod -O0 optimisation setting at all costs
FAQ#5:If PORTC bit don't seem work JTAG probably needs disabling
文章评论(0条评论)
登录后参与讨论