First of all I realy appreciate your help. I try to write a code that make bilink the both LEDs (green and red) of the FRDM-KL46Z and I think that my startup routine handles all configs needed to make the code work, such as clock gating, pins direction....
I dont wont want bother you by the entire code so this is juste the start-up routing and some defines:
#include "derivative.h"
#define RED_LED_LOC (1<<27)
#define GREEN_LED_LOC (1<<5)
void delay(int a)
{
int i;
for(i=0;i<a;i++)
{
}
}
int main(void)
{
SIM_COPC = 0x00; /* Disable the watchdog timer */
SIM_SCGC5 |= (SIM_SCGC5_PORTB_MASK | SIM_SCGC5_PORTD_MASK); /*clock gating*/
PORTD_PCR5 = (PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK) ; /*module selection*/
PORTE_PCR27 = (PORT_PCR_MUX(1) | PORT_PCR_DSE_MASK) ; /*module selection*/
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
GPIOD_PDDR |= RED_LED_LOC; /*Pins direction*/ | it jumps just before executing this line
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
GPIOE_PDDR |= GREEN_LED_LOC; /*Pins direction*/
thank you, and sorry for the english :smileyhappy: