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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

553件の閲覧回数
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.?

タグ(1)
0 件の賞賛
返信
2 返答(返信)

373件の閲覧回数
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 件の賞賛
返信

373件の閲覧回数
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 件の賞賛
返信