cancel
Showing results for 
Search instead for 
Did you mean: 

Interrupt on in B1? ON Bluepill STM32F103 without HAL

sven
Associate II

Hallo,
does anybody have an Example(without HAL), how I can initialize an external Interrupt with STM32F103 Bluepill on PIN B1?

At this moment I try with this

[code]
procedure Event(); iv IVT_INT_EXTI1; ics ICS_AUTO;
begin
GPIOC_ODR := not GPIOC_ODR; // Toggle PORTC
delay_ms(100);
end;
[/code]

[code]RCC_APB2ENR.AFIOEN := 1; // Enable clock for alternate pin functions
AFIO_EXTICR3 := 0x0100; // PB as External interrupt
AFIO_EXTICR1 := 0x0001; // PB as External interrupt
EXTI_RTSR := 0x00000400; // Set interrupt on Rising edge
EXTI_IMR := EXTI_IMR or 0xFFFF; // Set mask
NVIC_IntEnable(IVT_INT_EXTI1); // Enable External interrupt

EnableInterrupts(); // Enables the processor interrupt.
[/code]

0 REPLIES 0