Now, I have a problem about the TPM in MC9S08AW32.
I use the 4MHz crystal and set the bus clock to 20MHz. And I want to set a interrupt per 500usec. So I use the TPM module, but it isn't work to me. I don't know what's happen?
Does anyone can help me,thanks.
My workaround: Codewarrior V3.1 for HC(S)08
Below is my code.
#include // For enable interrupts macro #include // Include peripheral declarations #define LED1 PTCD_PTCD2
void IniCpu(void) { --------- --------- PTADD=0b00000000; // I/O data direction, 1utput, 0:Input PTBDD=0b00000000; // I/O data direction, 1utput, 0:Input PTCDD=0b01011100; // I/O data direction, 1utput, 0:Input // Set the PTC5 is a SCI Rx2,PTC3 is SCI Tx2 PTDDD=0b00000000; PTEDD=0b00000001; // Set the PTE1 is a SCI Rx1,PTE0 is SCI Tx1 PTFDD=0b11110000; // Set PTF[6:7] are output, PTF[4:5] are PWM output PTGDD=0b00000000; ---------- ----------