AnsweredAssumed Answered

S32k 14x systick

Question asked by Koorosh Hajiani on May 3, 2017
Latest reply on May 5, 2017 by Daniel Martynek

Hi ,

the code below uses design studio, and the NXP eval board for S32k144.

My systick is not triggered. I must be doing something wrong. Ring to toggle red and green LEDS.

 

typedef struct

{

__IO uint32_t CTRL;

__IO uint32_t LOAD;

__IO uint32_t VAL;

__I uint32_t CALIB;

} SysTick_Type;

 

#define SysTick ((SysTick_Type *) (0xE000E010UL) )

 

void SysTick_Handler(void ) {

PTD->PTOR |= 0x1>>15 | 0x1>>16; // Toggle Blue

}

 

int main()

{

DISABLE_INTERRUPTS();

 

SysTick->LOAD = 0x00FFFFFF; /* set SysTick timer reload value*/

SysTick->CTRL = 0x7; /* start SysTick timer with Interrupt using core clock */

 

ENABLE_INTERRUPTS();

 

//set Peripheral Clock Control for PORTD

PCC->PCCn[PCC_PORTD_INDEX] |= 0x40000000;

 

// set Pin Control Register

//PORTD->PCR[0] = 0x00000100;

PORTD->PCR[15] = 0x00000100;

PORTD->PCR[16] = 0x00000100;

 

// set Port Data Direction Register

PTD->PDDR |= (/*0x1<<0*/0) | (0x1<<15) | (0x1<<16);

 

// set PORT output

PTD->PSOR |= /*(0x1<<0) | */(0x1<<15) | (0x1<<16);

 

while( 1 ) {

//printf("I am here.\n");

}

 

return 0;

}

 

Thanks,

Outcomes