Missing WGM2 and WGM3 in AVR.Timer1.Init_CTC
Ada cross compiler and libraries for AVR µCs
Status: Beta
Brought to you by:
rolf_ebert
Missing WGM2 and WGM3 in AVR.Timer1.Init_CTC.
Following works on ATmega1284:
procedure Init_CTC (Prescaler : Scale_Type; Overflow : Unsigned_16 := 0) is begin -- set the control register with the prescaler and mode flags to -- timer output compare mode and clear timer on compare match Ctrl_Reg := (MCU.COM1A0_Bit => False, -- \ normal operation, MCU.COM1A1_Bit => False, -- / OC1A disconnected MCU.COM1B0_Bit => False, -- \ normal operation, MCU.COM1B1_Bit => False, -- / OC1B disconnected MCU.WGM10_Bit => False, -- \ Clear Timer on Compare MCU.WGM11_Bit => False, -- / Match (CTC) / Low Part others => False); WGM2 := True; -- \ Clear Timer on Compare WGM3 := False; -- / Match (CTC) / High Part Init_Common (Prescaler); -- enable Timer1 output compare interrupt Output_Compare_Interrupt_Enable := True; Output_Compare_Reg := Overflow; end Init_CTC;
Anonymous