Rob Guyatt

SH8 timer channel value registers

Discussion created by Rob Guyatt on May 19, 2008
Latest reply on Jul 25, 2008 by Todd Priesz
I am trying to get the SH8 to do PWM.
In SH8 the following does not change the timer value registers.
ldhx    #a_number      ; any 16 bit value
sthx   $0029               ; TPM1C1VH        or any other timer channel value register.
Writing to TPM1MODH does write ok. I get timer overflow interupts ok for period but can't set pulse width since I can't get a value other than 0 in TPM1C1VH.
However if I do the same in QG8 it does work eg;
ldhx    #a_number      ; any 16 bit value
sthx   $0049               ; TPMC1VH        or any other timer channel value register
I'm using WinIDE, ProgHCS08 and ICDHCS08 debugger, Cyclone Pro as interface.
Testing the device as standalone circuit or via ICDHCS08 shows the same result.
I've tried a couple of SH8 chips.
With any luck this will be simple and something I'm overlooking. Perhaps a memory mapping problem??