AnsweredAssumed Answered

FRDM-KE02Z with IAR

Question asked by Manjit Duhan on Jan 21, 2014
Latest reply on Jan 30, 2014 by Manjit Duhan

Hi, I am new to ARM. I had a FRDM-KE02Z board. When I program it with demo code it works but when I make my project it doesn't.

 

is startup.s fille is required?

 

my code is given below:-

 

#include "MKE02Z2.h"

 

 

#define LED0_Init()    GPIOB_PDDR |= (2<<24)    
#define LED0_Toggle()      GPIOB_PTOR = (2<<24)
#define LED0_On()          GPIOB_PCOR = (2<<24)
#define LED0_Off()          GPIOB_PSOR = (2<<24)

#define LED1_Init()    GPIOB_PDDR |= (4<<24)   
#define LED1_Toggle()      GPIOB_PTOR = (4<<24)
#define LED1_On()          GPIOB_PCOR = (4<<24)
#define LED1_Off()          GPIOB_PSOR = (4<<24)

#define LED2_Init()    GPIOB_PDDR |= (0x01<<7)
#define LED2_Toggle()      GPIOB_PTOR = (0x01<<7)
#define LED2_On()          GPIOB_PCOR = (0x01<<7)
#define LED2_Off()          GPIOB_PSOR = (0x01<<7)


/********************************************************************/
int main (void)
{
    LED0_Init();
    LED1_Init();
    LED2_Init();

    LED0_Off();
    LED1_Off();
    LED2_Off();

    while(1)
  {
                  LED0_On();
                  LED0_Off();
                  LED1_On();
                  LED1_Off();
                  LED2_On();
                  LED2_Off();
    
  }
}

Outcomes