9S12DJ64 timer module does not generate interrupt on stop?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

9S12DJ64 timer module does not generate interrupt on stop?

751 次查看
68HC912B32Guy
Contributor I

Hello.  I seem to be unable to get the timer module to wake up the processor after a STOP instruction.  However, after a WAI instruction, the timer will wake up the processor and service the interrupt.  Is the timer module not able to generate an interrupt in STOP mode?

The code that initializes the timer channel looks like this and allows me to capture the waveform I have on the IC0 pin just fine:
  clr          TIE                                      ;disable interrupts
  movb     #%00000101,TSCR2    ;output compare resolution is 8 us, prescaler=32, 4 MHz clock
  movb     #$02,TCTL4                    ;init IC0 for falling edge detection
  clr          TIOS                                  ;select channel 0 to act as input capture (IC)
  movb     #$80,TSCR1                   ;enable timer, runs during BDM and in wait, clears flags normally


The code that I use right before I stop the processor looks like this:
  movb     $03,TCTL4                ;init IC0 for rising and falling edges detection
  bset       TIE,#$01                     ;enable TM0 interrupt
  ldaa       TFLG1
  movb     #$FF,TFLG1              ;clear any interrupts on the timer channels
  andcc    #$7F                           ;enable CPU standby mode via STOP
  cli                                               ;enable global interrupts
  stop

Am I making a mistake leading up to the STOP instruction?  No amount of activity on timer channel 0 wakes up the processor.

Thank you!

标签 (1)
0 项奖励
回复
1 回复

404 次查看
kef
Specialist I

Timer requires clock to run. And since STOP mode shuts off all clocks, timer can't operate.

0 项奖励
回复