共3条
1/1 1 跳转至页
mega128timer1 mega128timer1问题求教
问
现象:不能进入timer1中断服务程序
观察TOV1 OCF1B OCF1A 已经置位, TOIE1 OCIE1B OCIE1A 也已经0置位
SREG.7 置位
timer0正常.......
为何???????急~~~~~~~~~~~~~~~~~~~~``
iccAVR 6.22b + AVR studio 4.05
void timer1_init(void)
{
TCCR1B = 0x00; //stop
TCNT1H = 0x85; //setup
TCNT1L = 0xEE;
OCR1AH = 0x7A;
OCR1AL = 0x12;
OCR1BH = 0x7A;
OCR1BL = 0x12;
TCCR1A = 0x00;
TCCR1B = 0x01; //start Timer
}
main()
{
MCUCR = 0x00;
EIFR = 0x00; //external interrupts sources
EIMSK = 0x00;
//TIMSK = 0x03; //ONLY enable the timer0 for test the timer....
TIMSK = 0X1C;//Enable the timer1.........
//TIMSK = 0xDF; //timer interrupt sources
ETIMSK = 0x00;//about timer3
SEI(); //re-enable interrupts
... ...
}
答 1: 盼复 答 2: 已经解决,纯软件仿真的问题,使用JTAG没问题
观察TOV1 OCF1B OCF1A 已经置位, TOIE1 OCIE1B OCIE1A 也已经0置位
SREG.7 置位
timer0正常.......
为何???????急~~~~~~~~~~~~~~~~~~~~``
iccAVR 6.22b + AVR studio 4.05
void timer1_init(void)
{
TCCR1B = 0x00; //stop
TCNT1H = 0x85; //setup
TCNT1L = 0xEE;
OCR1AH = 0x7A;
OCR1AL = 0x12;
OCR1BH = 0x7A;
OCR1BL = 0x12;
TCCR1A = 0x00;
TCCR1B = 0x01; //start Timer
}
main()
{
MCUCR = 0x00;
EIFR = 0x00; //external interrupts sources
EIMSK = 0x00;
//TIMSK = 0x03; //ONLY enable the timer0 for test the timer....
TIMSK = 0X1C;//Enable the timer1.........
//TIMSK = 0xDF; //timer interrupt sources
ETIMSK = 0x00;//about timer3
SEI(); //re-enable interrupts
... ...
}
答 1: 盼复 答 2: 已经解决,纯软件仿真的问题,使用JTAG没问题
共3条
1/1 1 跳转至页
回复
有奖活动 | |
---|---|
【有奖活动】分享技术经验,兑换京东卡 | |
话不多说,快进群! | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |
打赏帖 | |
---|---|
【笔记】生成报错synthdesignERROR被打赏50分 | |
【STM32H7S78-DK评测】LTDC+DMA2D驱动RGBLCD屏幕被打赏50分 | |
【STM32H7S78-DK评测】Coremark基准测试被打赏50分 | |
【STM32H7S78-DK评测】浮点数计算性能测试被打赏50分 | |
【STM32H7S78-DK评测】Execute in place(XIP)模式学习笔记被打赏50分 | |
每周了解几个硬件知识+buckboost电路(五)被打赏10分 | |
【换取逻辑分析仪】RA8 PMU 模块功能寄存器功能说明被打赏20分 | |
野火启明6M5适配SPI被打赏20分 | |
NUCLEO-U083RC学习历程2-串口输出测试被打赏20分 | |
【笔记】STM32CUBEIDE的Noruletomaketarget编译问题被打赏50分 |