Ich habe mal einen Anfang probiert, aber wie weiter ?
Code: Alles auswählen
const
TIM_CR1_CEN = 1; // #define TIM_CR1_CEN BIT(0)
RCC_APB1ENR_TIM2EN = 1;
procedure Timer1_Interrupt; public Name 'TIM2_interrupt'; interrupt;
begin
multi;
end;
begin
// Ports einschalten
RCC.APB2ENR := RCC.APB2ENR or (%111 shl 2);
// Timer
RCC.APB1ENR := RCC.APB1ENR or RCC_APB1ENR_TIM2EN;
TIM2.PSC := 0;
TIM2.ARR := $FFFF;
TIM2.RCR := 0;
TIM2.DIER:=TIM_DIER_UIE;
TIM2.DIER:=TIM2.DIER or TIM_CR1_CEN;
// TIM2.CR1 := TIM2.CR1 or 1;
Für C++ habe ich ein Beispiel gefunden: https://os.mbed.com/forum/mbed/topic/16 ... ment-38688