Dear friends kef and all...
Definitely: I REFUSE TO USE PWM and I REFUSE TO STOP THE TIMER.
Thank you so much for the pictures and code. Believe me that you are not wasting your time, and I appreciate your politness, it is my fault to be sensitive to the form the things are said.
YES I know some about the timer problems and its use because I have been designing electronic ignitions for automotive terminals providers for the last 10 years. My first experience was with the HC11 ( attached picture of one of my old HC11 boards ). Then the HC908 followed and YES it has problems with the buffered/unbuffered issue. As you all know this was a workarround for the problem I am trying to solve with 9S08 but the problem with the timer is still there.
I think that your code ( I´ve just received the file and I couldn´t open it yes ) includes what I was talking about using the Overflow Interrupt ... I don´t know but I promise to take a look at it. Let me remind you guys that my goal is to fire the triac with phase angle without stopping the timer and to keep the gate signal all the time until a little before zero crossing. So the Output Compare has up to 3 jobs during the mains semicycle. I couldn´t make it work without forcing the sync by stopping the timer, and never reloading the Output Compare 3 times during the same semicycle ... I believe the Overflow interrupt is needed if variable angle is used.
Let me take a loo at the code and be back yo you.
Greetings
Roberto
He did say turning it off right before the next zero crossing starts, of course if he tries to cut it too close there will be problems and the triac will be on for the next half cycle as well. I don't think he wants to pulse it several times during a half cycle.
peg wrote:
Or perhaps the OP is just talking about leaving the gate "on" from the trigger point until the next zero cross?
Thank you JImDon, kef,Peg , allwtterb, Bigmac, Ake ...
I was wrong to consider this timer the same as the HC08. Thank you for the contributions and valuable advice. Kef I followed your code "main2.c". I could make it work. No timer stopping , no Overflow event interrupt. Peg and JimDon you are right. When firing SCRs and TRIACs with heavy loads ( high power brush motors and soldering machines ) you need to burst the gate as you know that the load is almost a short circuit full of sparks and the device disconnects repeatedly from the load ( ~2000 to 5000 Amps ). An external oscillator is used to drive the gate circuit @ 20 to 50 KHz. In some applications you can hold the gate until the semicycle dies and the TRIAC stops conducting because it doesn´t have enough sustaining voltage. I like to stop the gating before this. For this reason, as you all know there is a dead firing zone of about 6 degrees after and before zero crossings.
Working code and oscillogram uploaded.
Thank you again friends and kind regards
Roberto
peg wrote:
Or perhaps the OP is just talking about leaving the gate "on" from the trigger point until the next zero cross?