AnsweredAssumed Answered

STM32F0 WITH Assembly

Question asked by PA3040 on Nov 30, 2014
Latest reply on Dec 13, 2014 by PA3040
Dear All ,
I written a program in assembly to tern on bit 8 on GPOIC 
It is compiled well but LED does not on
processor STM32F051R8T6
IDE KEIL     

    PRESERVE8
    THUMB
     
RCC_APB2ENR     EQU     0X40021018
GPIOC_CRH       EQU     0x40011004
GPIOC_ODR       EQU     0x4001100C
DEL1            EQU     0X10
DEL2            EQU     0X10
    AREA RESET,DATA,READONLY
     
    EXPORT  __Vectors
     
__Vectors       DCD 0X20002000
                DCD Reset_Handler
                 
                ALIGN
                 
                AREA MYCODE,CODE,READONLY
                ENTRY
                EXPORT  Reset_Handler
                 
Reset_Handler   PROC
 
 
 
 
clock_init
                ldr     R6, =RCC_APB2ENR   
                movs    R0, #0x1C          
                str     R0, [R6]
         
                 
                ldr     R6, =GPIOC_CRH
                ldr     R0, =0x3333333     
                str     R0, [R6]
                 
                 
                LDR   r1, =GPIOC_ODR     
                LDR    r0, =0x0A00        
                STR     r0, [r1] 
                ENDP
                 
                 
                B       DELAY
DELAY          
                SUBS    R2,#1
                BNE     DELAY
DEL             SUBS    R3,#1
                BNE     DEL
                 
                B       Reset_Handler
                 
                ALIGN
                END
        

Outcomes