Anda di halaman 1dari 7

#include "LPC11xx.

h"
int main(void) {
//Toggle a GPIO (FBD48 pin 48, PIO3_3)
LPC_SYSCON->SYSAHBCLKCTRL
|= (1<<6);
3.5.14)
LPC_IOCON->PIO3_3
&= ~(0x10);
pull-up (sec 7.4.42)
LPC_GPIO3->DIR
|= (1<<3);
output (sec 12.3.2)

//enable clock GPIO (sec


//NOT NECESSARY, turn off
//set pin direction to

unsigned int i = 0;
while(1){

//infinite loop

LPC_GPIO3->DATA
|= (1<<3);
for(i=0; i<0xFFFFF; ++i);
LPC_GPIO3->DATA
&= ~(1<<3);
for(i=0; i<0xFFFFF; ++i);

//set pin high (sec 12.3.1)


//delay
//set pin low (sec 12.3.1)

}
return 0 ;
}
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////
#include "LPC11xx.h"
int main(void) {
PCB)

//Toggle a GPIO (FBD48 pin 23, PIO0_7, drives the LED on the LPCExpresso

LPC_SYSCON->SYSAHBCLKCTRL
3.5.14)
LPC_IOCON->PIO0_7
pull up (sec 7.4.19)
LPC_GPIO0->DIR
output (sec 12.3.2)

|= (1<<6);

//enable clock GPIO (sec

&= ~(0x10);

//NOT NECESSARY, turn off

|= (1<<7);

//set pin direction to

unsigned int i = 0;
while(1){

//infinite loop

LPC_GPIO0->DATA
|= (1<<7);
for(i=0; i<0xFFFFF; ++i);
LPC_GPIO0->DATA
&= ~(1<<7);
for(i=0; i<0xFFFFF; ++i);
}
return 0 ;
}

//set pin high (sec 12.3.1)


//delay
//set pin low (sec 12.3.1)
//delay

//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////
#include "LPC11xx.h"
int main(void) {
//Toggle a GPIO (FBD48 pin 24, PIO2_9)
LPC_SYSCON->SYSAHBCLKCTRL
|= (1<<6);
3.5.14)
LPC_IOCON->PIO2_9
&= ~(0x10);
pull up (sec 7.4.20)
LPC_GPIO2->DIR
|= (1<<9);
output (sec 12.3.2)

//enable clock GPIO (sec


//NOT NECESSARY, turn off
//set pin direction to

unsigned int i = 0;
while(1){

//infinite loop

LPC_GPIO2->DATA
|= (1<<9);
for(i=0; i<0xFFFFF; ++i);
LPC_GPIO2->DATA
&= ~(1<<9);
for(i=0; i<0xFFFFF; ++i);

//set pin high (sec 12.3.1)


//arbitrary delay
//set pin low (sec 12.3.1)
//arbitrary delay

}
return 0 ;
}
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////
#include "LPC11xx.h"
int main(void) {
//Toggle a GPIO (FBD48 pin 19, PIO2_4, PIN IS MISLABELLED ON SILKSCREEN)
LPC_SYSCON->SYSAHBCLKCTRL
|= (1<<6);
//enable clock GPIO (sec
3.5.14)
LPC_IOCON->PIO2_4
&= ~(0x10);
//NOT NECESSARY, turn off
pull up (sec 7.4.15)
LPC_GPIO2->DIR
|= (1<<4);
//set pin direction to
output (sec 12.3.2)
unsigned int i = 0;
while(1){

//infinite loop

LPC_GPIO2->DATA
|= (1<<4);
for(i=0; i<0xFFFFF; ++i);
LPC_GPIO2->DATA
&= ~(1<<4);
for(i=0; i<0xFFFFF; ++i);

}
return 0 ;

//set pin high (sec 12.3.1)


//arbitrary delay
//set pin low (sec 12.3.1)
//arbitrary delay

//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////
#include "LPC11xx.h"
int main(void) {
//Toggle a GPIO (FBD48 pin 22, PIO0_6)
LPC_SYSCON->SYSAHBCLKCTRL
|= (1<<6);
3.5.14)
LPC_IOCON->PIO0_6
&= ~(0x10);
pull up (sec 7.4.18)
LPC_GPIO0->DIR
|= (1<<6);
output (sec 12.3.2)

//enable clock GPIO (sec


//NOT NECESSARY, turn off
//set pin direction to

unsigned int i = 0;
while(1){

//infinite loop

LPC_GPIO0->DATA
|= (1<<6);
for(i=0; i<0xFFFFF; ++i);
LPC_GPIO0->DATA
&= ~(1<<6);
for(i=0; i<0xFFFFF; ++i);

//set pin high (sec 12.3.1)


//arbitrary delay
//set pin low (sec 12.3.1)
//arbitrary delay

}
return 0 ;
}
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////
#include "LPC11xx.h"
int main(void) {
//Toggle a GPIO (FBD48 pin 27, PIO0_8)
LPC_SYSCON->SYSAHBCLKCTRL
|= (1<<6);
3.5.14)
LPC_IOCON->PIO0_8
&= ~(0x10);
pull up (sec 7.4.23)
LPC_GPIO0->DIR
|= (1<<8);
output (sec 12.3.2)

//enable clock GPIO (sec


//NOT NECESSARY, turn off
//set pin direction to

unsigned int i = 0;
while(1){

//infinite loop

LPC_GPIO0->DATA
|= (1<<8);
for(i=0; i<0xFFFFF; ++i);
LPC_GPIO0->DATA
&= ~(1<<8);
for(i=0; i<0xFFFFF; ++i);

}
return 0 ;

//set pin high (sec 12.3.1)


//arbitrary delay
//set pin low (sec 12.3.1)
//arbitrary delay

//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////
#include "LPC11xx.h"
int main(void) {
//Toggle a GPIO (FBD48 pin 31, PIO2_11)
LPC_SYSCON->SYSAHBCLKCTRL
|= (1<<6);
3.5.14)
LPC_IOCON->PIO2_11
&= ~(0x10);
pull up (sec 7.4.27)
LPC_GPIO2->DIR
|= (1<<11);
output (sec 12.3.2)

//enable clock GPIO (sec


//NOT NECESSARY, turn off
//set pin direction to

unsigned int i = 0;
while(1){

//infinite loop

LPC_GPIO2->DATA
|= (1<<11);
for(i=0; i<0xFFFFF; ++i);
LPC_GPIO2->DATA
&= ~(1<<11);
for(i=0; i<0xFFFFF; ++i);

//set pin high (sec 12.3.1)


//arbitrary delay
//set pin low (sec 12.3.1)
//arbitrary delay

}
return 0 ;
}
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////
#include "LPC11xx.h"
int main(void) {
//Toggle a GPIO (FBD48 pin 36, PIO3_0)
LPC_SYSCON->SYSAHBCLKCTRL
|= (1<<6);
3.5.14)
LPC_IOCON->PIO3_0
&= ~(0x10);
pull up (sec 7.4.32)
LPC_GPIO3->DIR
|= (1<<0);
output (sec 12.3.2)

//enable clock GPIO (sec


//NOT NECESSARY, turn off
//set pin direction to

unsigned int i = 0;
while(1){

//infinite loop

LPC_GPIO3->DATA
|= (1<<0);
for(i=0; i<0xFFFFF; ++i);
LPC_GPIO3->DATA
&= ~(1<<0);
for(i=0; i<0xFFFFF; ++i);
}
return 0 ;

//set pin high (sec 12.3.1)


//arbitrary delay
//set pin low (sec 12.3.1)
//arbitrary delay

}
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////

#include "LPC11xx.h"
int main(void) {
//Toggle a GPIO (FBD48 pin 37, PIO3_1)
LPC_SYSCON->SYSAHBCLKCTRL
|= (1<<6);
3.5.14)
LPC_IOCON->PIO3_1
&= ~(0x10);
pull up (sec 7.4.33)
LPC_GPIO3->DIR
|= (1<<1);
output (sec 12.3.2)

//enable clock GPIO (sec


//NOT NECESSARY, turn off
//set pin direction to

unsigned int i = 0;
while(1){

//infinite loop

LPC_GPIO3->DATA
|= (1<<1);
for(i=0; i<0xFFFFF; ++i);
LPC_GPIO3->DATA
&= ~(1<<1);
for(i=0; i<0xFFFFF; ++i);

//set pin high (sec 12.3.1)


//arbitrary delay
//set pin low (sec 12.3.1)
//arbitrary delay

}
return 0 ;
}
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////
#include "LPC11xx.h"
int main(void) {
//Toggle a GPIO (FBD48 pin 38, PIO2_3)
LPC_SYSCON->SYSAHBCLKCTRL
|= (1<<6);
3.5.14)
LPC_IOCON->PIO2_3
&= ~(0x10);
pull up (sec 7.4.34)
LPC_GPIO2->DIR
|= (1<<3);
output (sec 12.3.2)

//enable clock GPIO (sec


//NOT NECESSARY, turn off
//set pin direction to

unsigned int i = 0;
while(1){

//infinite loop

LPC_GPIO2->DATA
|= (1<<3);
for(i=0; i<0xFFFFF; ++i);
LPC_GPIO2->DATA
&= ~(1<<3);
for(i=0; i<0xFFFFF; ++i);
}
return 0 ;

//set pin high (sec 12.3.1)


//arbitrary delay
//set pin low (sec 12.3.1)
//arbitrary delay

}
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////
#include "LPC11xx.h"

int main(void) {
//Toggle a GPIO (FBD48 pin 43, PIO3_2)
LPC_SYSCON->SYSAHBCLKCTRL
|= (1<<6);
3.5.14)
LPC_IOCON->PIO3_2
&= ~(0x10);
pull up (sec 7.4.38)
LPC_GPIO3->DIR
|= (1<<2);
output (sec 12.3.2)

//enable clock GPIO (sec


//NOT NECESSARY, turn off
//set pin direction to

unsigned int i = 0;
while(1){

//infinite loop

LPC_GPIO3->DATA
|= (1<<2);
for(i=0; i<0xFFFFF; ++i);
LPC_GPIO3->DATA
&= ~(1<<2);
for(i=0; i<0xFFFFF; ++i);

//set pin high (sec 12.3.1)


//arbitrary delay
//set pin low (sec 12.3.1)
//arbitrary delay

}
return 0 ;
}
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////
#include "LPC11xx.h"
int main(void) {
//Toggle a GPIO (FBD48 pin 45, PIO1_5)
LPC_SYSCON->SYSAHBCLKCTRL
|= (1<<6);
3.5.14)
LPC_IOCON->PIO1_5
&= ~(0x10);
pull up (sec 7.4.39)
LPC_GPIO1->DIR
|= (1<<5);
output (sec 12.3.2)

//enable clock GPIO (sec


//NOT NECESSARY, turn off
//set pin direction to

unsigned int i = 0;
while(1){

//infinite loop

LPC_GPIO1->DATA
|= (1<<5);
for(i=0; i<0xFFFFF; ++i);
LPC_GPIO1->DATA
&= ~(1<<5);
for(i=0; i<0xFFFFF; ++i);
}
return 0 ;

//set pin high (sec 12.3.1)


//arbitrary delay
//set pin low (sec 12.3.1)
//arbitrary delay

}
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////
#include "LPC11xx.h"
int main(void) {

//Toggle a GPIO (FBD48 pin 13, PIO2_1)


LPC_SYSCON->SYSAHBCLKCTRL
|= (1<<6);
3.5.14)
LPC_IOCON->PIO2_1
&= ~(0x10);
pull up (sec 7.4.9)
LPC_GPIO2->DIR
|= (1<<1);
output (sec 12.3.2)

//enable clock GPIO (sec


//NOT NECESSARY, turn off
//set pin direction to

unsigned int i = 0;
while(1){

//infinite loop

LPC_GPIO2->DATA
|= (1<<1);
for(i=0; i<0xFFFFF; ++i);
LPC_GPIO2->DATA
&= ~(1<<1);
for(i=0; i<0xFFFFF; ++i);

}
return 0 ;

//set pin high (sec 12.3.1)


//arbitrary delay
//set pin low (sec 12.3.1)
//arbitrary delay