AnsweredAssumed Answered

I undertake a project about Electronic Control Unit for an electric vehicle with S912XEQ512F1MAA MCU. How to create subroutines in C language?

Question asked by Anderson Ardila on May 21, 2015
Latest reply on Jun 14, 2015 by Anderson Ardila

Hello everybody

 

Currently, I am undertaking a project about Electronic Control Unit for an electric vehicle and I want to programme the microcontroller unit in C language. I have more experience with assembler language and I would like to solve some doubts about C language in Freescale microcontrollers. For instance, if I have the following assembler code, how can I implement the subroutines in C language:

 

MOVB      #$FF,PORTB

JSR          Delay

MOVB       #$00, PORTB

JSR          Delay   

 

 

Delay

                 LDAA #$FF

Delay_Loop                

                 DECA         

                 BEQ    End_Delay

                 BRA    Delay_Loop   

End_Delay

                 RTS

 

I await your prompt response.

 

Good day

Outcomes