â™¦I am quite familiar with timers in Tiny and Mega series, but with this Tiny45 I run into an odd problem: Bascom code.
'Init: Timer1 generates PWM on OC1B, using clk/1, OCR1C=top, OCR1B=pwm percentage Tccr1 = &B10000001 'clk/1 = 8 MHz Gtccr = &B01100000 'Clear OC1B on match 'Set Gtccr.com1b0 'inverse PWM-signal Pwm_drv Alias Ocr1b Pwm_top Alias Ocr1c
The signal on OC1B is the inverse of what I need. But setting Gtccr.com1b0 results in a constant high on OC1B, and not the inverse signal: which is what I expected.
OC1B drives a boost converter and so a constant high kills the power: the boost-inductor saturates. No magic smoke, btw ;) , it simply reboots.
In the main loop, OCR1B and OCR1C are handled.
Pwm_top = 200 Pwm_drv = 50
What am I missing ?