2004-07-08 10:19 PM
2004-07-01 10:25 PM
I want to generate 4 PWM's with ST72C254 to drive 230V light sources at PA0-PA3. Only one PWM may be active at the same time!
The netsync of the 230V is coming in to the capture interrupt. After a capture interrupt, i read the alternate counter and add the delay time and write it to the output compare interrupt.2004-07-08 10:19 PM
Hi!
1) If you are running the 16-bit timer in ''free running'' mode, I would recommend not to read the counter in the IC Interrupt routine but to read the input capture register in order to get the timer value at the exact time of the input capture event without any jitter. 2) It should be no problem to work with IC and OC at the same time. Please check the sequence which you use to write to the OC-higher Byte and lower byte: first write to the HB then write to the LB. Take care also for the second IC and OC chanal which should be disabled if you don't need an interrupt on it: Access first the LB than the HB (reverse order!) => compare also to datasheet for that sequence 3) Make sure that the OC interrupt is enabled! Wish you good luck!