AnsweredAssumed Answered

How can i enable disable interrupts in KDS with k64f

Question asked by Edriano Araujo on Aug 21, 2014
Latest reply on Aug 22, 2014 by Garabo

I am trying to make a simple program where i will toggle leds when i press a button.

i am using FRDM K64F.

 

I am trying to do that without cmsis as i have ever done. i have just configured the ports no problem but i can not see how to configure the interrupt.

using NVICICPR0 and  NVICISER0 registers.

 

is there any simple example. without all this pe and cmsis?

 

//HABILITA CLOCKS PARA OS PORTS A B C D e E
SIM_SCGC5 |=  SIM_SCGC5_PORTA_MASK + SIM_SCGC5_PORTB_MASK + SIM_SCGC5_PORTC_MASK + SIM_SCGC5_PORTD_MASK + SIM_SCGC5_PORTE_MASK ;

 

// CONFIGURA PORTS DO LED COMO PINOS DIGITAIS
PORTB_PCR21 |= PORT_PCR_MUX(1);
PORTB_PCR22 |= PORT_PCR_MUX(1);
PORTE_PCR26 |= PORT_PCR_MUX(1);
//CONFIGURA PINOS COMO SAIDA
GPIOB_PDDR |= GPIO_PDDR_PDD(GPIO_PIN(21) + GPIO_PIN(22));
GPIOE_PDDR |= GPIO_PDDR_PDD(GPIO_PIN(26));

Outcomes