hello guys , I m new to the community!! i just brought a new kl25z and have studied the datasheet of cortex m0 .

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

hello guys , I m new to the community!! i just brought a new kl25z and have studied the datasheet of cortex m0 .

500 Views
deepaksiyal
Contributor I

my question how to program a simple gpio pin to on or off by using "Just" assembly language programing and not using c++ in KEIL MDK.?

Tags (1)
0 Kudos
2 Replies

320 Views
pratiekbhadrana
Contributor III

Hello Deepak,

You remind me of myself whenI started out on ARM. Take my advice - Don't go for assembly programming. There are ways to do so, but its a real pain to do so for ARM.

I suspect you've come from a PIC/AVR/8051 background (like myself). 8-bit programmers tend to think that 32-bit programming is just an extension of 8-bit work. But it isn't so. Just turning a GPIO pin on or off will take you probably a page of code in assembly. You have to set its direction, pull-up or pull-down, filter, clock source, etc etc, followed by turning it on through a bitfield (you can't turn on only that particular bit). I learned this the hard way.

Use KDS. It is a free, no limitations toolchain maintained by Freescale. Start programming in C. The only benefit of assembly is you learn how the hardware actually works. If you're interested, go through the header files.

Regards,

Pratiek

0 Kudos

320 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi Deepak Siyal,

I think you may firstly debug the C code and know the assembly implementation via the Disassembly window just below:

2.png

Please kindly refer to the following for more details on the assembly language: http://infocenter.arm.com/help/topic/com.arm.doc.dui0662b/DUI0662B_cortex_m0p_r0p1_dgug.pdf

Hope that helps,


Have a great day,
Kan

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos