AnsweredAssumed Answered

DV16 TPM Question

Question asked by Doug Hansel on Oct 30, 2010
Latest reply on Nov 9, 2010 by Doug Hansel

Hello, I seem to have an issue successfully writing to the modulo register on my 9s08dv16 MCU.  I am quite puzzled, here is what it is doing:

c -source

TPM2CNT = 0;    
TPM2MOD = 0x0460; /* 280uS @ 0.25uS/bit */
TPM2SC_TOIE = 1; /* enable the modulus interrupt */

 

assembly

CLRH

STHX  _TPM2CNT.Word

LDHX  #0x0460

STHX  _TPM2MOD.Word

 

As I step through this code, the TPM2 modulo register at address 0x63-0x64 remains at zero.  HX is being properly loaded with 0x0460, the STHX command appears to be executed, but the reported memory location doesn't change.  I can set the location directly using the PE micro multilink debugger interface with CW 6.3 debugger and it works fine.  It behaves the same regardless of debugger attached or not(verified with o-scope).  It also behaves the same if I break the write into high byte and low byte.  Also, I don't completely understand the coherency mechanism so I wrote a value that was a couple of timer ticks higher then the current timer value to see if the location would update when TPM2CNT == TPM2MOD-1, no effect.

 

any ideas?

thanks

Doug

Outcomes