This example defines a few presets for different boards, with here the ‘Blue Pill’ (STM32F103C8) version used. The code example as implemented using my Nodate framework thus becomes: Whenever we return from this blocking delay function, we toggle the GPIO_ODR bit, which causes the LED that is connected on that pin to be lit or not. In the case of the Blinky example, we remove the active polling of the GPIO_IDR that was used to read the button input, instead relying on the delay function that is added. In the Pushy example, the processor core would constantly query the GPIO peripheral’s incoming data register (GPIO_IDR) and write into the outgoing data register (GPIO_ODR) depending on those input values. Meanwhile the slower APB connects peripherals that are fine with less bandwidth and lower speeds, which includes the I2C, timers, USARTs and SPI peripherals. AHB connects the core to all peripherals that need the low latency and speed, such as RAM, ROM, GPIO banks and display controllers. ![]() This core is connected via a variety of AMBA (Advanced Microcontroller Bus Architecture) buses, with AHB being the fast bus. In Arm MCU architectures, generally the same Cortex-M processor core is used within the same family of MCUs by a manufacturer such as ST Microelectronics (‘ST’). In this article we’ll take a look at all three approaches, along with their advantages and disadvantages. In the latter two cases we also have to use interrupts. On an STM32 MCU, we get to choose between essentially an active delay ( while loop), one implemented using the SysTick timer and using one of the peripheral timers. The reason for this is that there are many ways to implement a delay function on a microcontroller (MCU), each of which comes with their own advantages and disadvantages. The reason for this is that there’s actually quite a story behind a simple call to delay() or its equivalent. This is actually a lot more complicated than the ‘ Pushy‘ example which we looked at in the first installment of this series.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |