Sorry, its a 9s12xdt512, using low power pierce oscillator at 4MHz. I have set the prescaler to the 128 max and set an LED to flash when the timer is over 0xF000. I was curious to see if i understood the timer so i timed how long the LED cycle took, it turned out to be 4.2 seconds. I thought it should be 1/ 4,000,000(clock) / 65536 (max timer value) all * 128 = 2.1 second
register wise i set TSCR2 to 0x07 and TSCR1 to 0x80
Message Edited by ernestsnaith on 05-02-200603:10 PM
If you have a 4MHz crystal the bus speed (and source of the timer clock) is 2MHz so your maths is correct. If you need the S12X to go faster you should enable the PLL.
You can have a larger prescaler on the timer by using the precision mode (see this thread: http://forums.freescale.com/freescale/board/message?board.id=16BITCOMM&message.id=861)
(Alban created link)
Message Edited by Alban on 05-03-2006 11:10 AM