AnsweredAssumed Answered

k60f120m toggle led with onboard button

Question asked by Philipp Adolph on Nov 29, 2016
Latest reply on Nov 29, 2016 by Mark Butcher

I wanted a easy start in the development with the evalutationboard. So i started to turn leds on , toggle them ....

But i can't find a simple way to toggle a onboard LED with sw1 or sw2 of of the board.

I set the systemclock

SIM_SCGC5 |= SIM_SCGC5_PORTA_MASK ;

set the sw1 as gpio

PORTA_PCR19 |= (PORT_PCR_MUX(1));

and set the resistors

PORTA_PCR19 |= PORT_PCR_PE_MASK;

 

If i press the button nothing happens and the GPIO_PDIR_PDI (19) don't have a high state

 

tmp=(GPIOA_PDIR & GPIO_PDIR_PDI(1<<19)); 

Outcomes