I am a starter with Freescale products. I am working on a LED blinking program.
I found two lines of port control code would lead to debugger complaining bad communication with MCU.
With the two port control lines, the code actually is correct because I saw the led blinking after downloading.
However, the break points or stop are not available due to the communication issue.
Without the two port control lines of code, communication problem doesn't occur. LED will then not blinking because ports not configured correctly
I am using Tower system TWR-K60100M with a MK60DN512VMD10 MCU.
Following is the code.
#include "derivative.h" /* include peripheral declarations */
SIM_SCGC5 |= (SIM_SCGC5_PORTA_MASK ); /*clock gating*/
PORTA_GPCLR=0xFFFF0000|PORT_PCR_DSE_MASK|PORT_PCR_MUX(1) ; /*Port Control*/
PORTA_GPCHR=0xFFFF0000|PORT_PCR_DSE_MASK|PORT_PCR_MUX(1) ; /*Port Control*/