Continuation of the series of articles about the assembler editor for ARM microcontrollers for the GNU AS compiler
previous article Assembler Editor Plus: First Draft
under the cut there will most likely be a lot of pictures!
So, we have yesterday's project with clocking settings and a dull loop, now let's try to add it in such a way to see the results of work on LEDs
We recall that in order to use any peripherals of the microcontroller, we need to enable it, for this we use the RCC registers
Therefore, we need to add the RCC module to our project, for this we start adding the module to the project (see the previous article if you do not know how)
The RCC is located in the PERIPH block of the microcontroller, so we go along the tree "PERIPH" - "Reset and clock control (RCC)" and then the options appear:
you can simply add an RCC definition file where all RCC registers and their possible values will be described
you can add a ready-made GPIO clock setting module, which will add the RCC module to us and at the same time provide the GPIO on / off interface
When you click install, you will be asked for the path and name to save the file of the clocking configuration module, since these are peripherals, in order to avoid the inevitable entropy of the universe, it is better to save this configuration file along a sensible path, I chose the path src \ periph \ rcc
GPIO
Open407I-C, , Easy , ArmAsmEdit\Add\MCUDoc\DevBoards
2 : GPIOH GPIOI
GPIOH
GPIOH:
DISABLE GPIO
"F4 "
,
, , .include -
main.asm .include ( )
, ,
, ( ), "F4 " . ,
" "
ARM - , - GPIO
, GPIO, , GPIO (, B, C) , .
GPIOH " GPIO", RCC , , src\periph\gpio
"F4" , "F4 ", ! :-)
,
, (. , 2 3), - GPIO , , "F4"
MODER "", ,
FR OTYPER ( , F4 )
,
GPIO, ,
, main.asm .include
, , , , , , !
, :
, LDR, R0, , [LDR R0,=] , ( , ( ), , )
, , "F5 " " " ( Ctrl+3)
( ), :
.GLOBAL - ,
MODULE - (), .include
SWITCH - , ( GPIO)
STM32F4 - , src\inc
STM32F4, AHB1PERIPH_BASE ( ), GPIO, GPIOH, GPIO_ODR
, Reference Manual RM0090
GPIOH GPIOH, R0, ""
R1 MOV GPIOODR, GPIOH, R0, GPIO_ODR ( F5)
( , )
,
, , " " SysTick,
src\core\stk
:
main.asm , BL, F5 , BL SYS F5
R0 - , BL SYSTICK_DELAY. , R0 GPIOH ? - R2 , :
, , ,
, - ...
,