This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Recently i bought a new kit supporting cortex m0+ processor ! I read the complete datasheet but could not find the instruction for using GPIO !!

I searched about programming the processor using assembly language only in KEIL 4.0 ! All i found is codes written in c !! can anyone please suggest me the direction to program the board in ASSEMBLY LANGUAGE ONLY  ??

I bought freescale kl25z supporting cortex m0+ processor !!

Thanks in advance

  • Hi d3ck and welcome to the community.

    I'm no expert on the Kinetis platform, but I believe I can still point you in the right direction.

    All Cortex-M based microcontrollers reads and writes hardware addresses in order to access the GPIO pins.

    So in assembly language, you will want to know the LDR and STR instructions, plus a few more; see the ARM Information Center for information about the instruction set:

    Cortex-M series processors > Cortex-M0+ > Revision: r0p1 > Cortex-M0+ Technical Reference Manual > Programmers Model > Instruction set summary.

    Now, what you really want is a Reference Manual (or User's Manual). In your case, I believe this is the one you're looking for.

    It contains information on how you use the hardware and the hardware addresses.

    If you jump directly to chapter 41, you will find the information you're looking for.

    Normally, a simple LED-blinker program would do the following (on any Cortex-M device):

    1: (optional) System initialization

    2: Set the direction of the pin used for the LED to be output.

    3: Enter an infinite loop, which turns the led on, waits 500 milliseconds, then turns the LED off and waits 500 milliseconds.

    Some of the Cortex-M devices have a GPIO 'toggle' register. Then the above 'program' would be reduced to...

    1: (optional) System initialization

    2: Set the direction of the pin used for the LED to be output.

    3: Enter an infinite loop, which toggle the led on/off, waits 500 milliseconds.