Message Edited by imajeff on 04-25-200607:39 AM
Message Edited by imajeff on 04-25-200608:12 AM
Message Edited by imajeff on 04-25-200608:27 AM
Message Edited by Steve on 04-25-200605:54 PM
Hi Steve !
Thank you for your advices. I got it to work in the end. The datasheet is a bit fuzzy but I understood it finally. RTI 0x40 for 16MHz crystal gets me close enough of 512us and the PTPSR 0x27 is working great !
Thanks again,
Jarod
Jarod,
You should start by confirming that the PLL is actually selected and at the speed you expect. It sounds as if there may be a problem there.
The RTI always runs from the oscillator clock so your divider looks much too high, you should be dividing by 8192 from a 16MHz oscillator.
You can have the timer prescaler giving a 1us tick by dividing by 40 (from 40MHz bus speed). You need to use the precision prescaler mode (see PTPSR and TSCR1 registers).
If the bus speed isn't right the PWM will behave differently.