1.Briefly explain why the digital Input/Output pins on the microcontroller have to be initialized before they are used. Which line of code is responsible for the initialization of the I/O port pin?
2.The initialization in the program is “friendly”. Briefly explain why.
#include “LPC17xx.h”
void delay(volatile int value)
{
for(int i=0; i
{
}
}
int main()
{
LPC_GPIO1->FIODIR |= 1<
while(1)
{
LPC_GPIO1->FIOSET |= 1<
delay(48000);
LPC_GPIO1->FIOCLR |= 1<<5;
delay(96000);
}
}