The LED of no reason to light. On the LPC11C24

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

The LED of no reason to light. On the LPC11C24

636 Views
vnv
Contributor II

I used a few examples of NXP downloaded to the LPC11C24. To debug. I found IO port PIO2-11, the corresponding light is always on. But the code does not initialize it and does not light it. Why is that?IMG_0920.JPG

I blocked the entire main function,the LED is still on.Who knows to give me a reminder?

132.PNG

Labels (1)
0 Kudos
2 Replies

393 Views
soledad
NXP Employee
NXP Employee

Hi,

Since you already remove all the available code, that handle the PIN,  I strongly suggest that you check the schematics of the board, to review where is attach the GPIO and the LED,  Since there is no chance that the LED it is always on, by the software.

By the way, this board it is not an official NXP board, so if you can share the schematics, we can take a look. But it is out of our scope, since there is no way to test from our side. I apologize for this inconvenience.


Have a great day,
Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

393 Views
vnv
Contributor II

Hi,

I am very happy to share the schematic,Software can not control GPIO, I have no way to solve this problem.

There are some Chinese on the map.

111.PNG

The code from NXP official example of this "lpcopen_v2_00a_keil_iar_nxp_lpcxpresso_11c24",but I use the following example to be controllable.

#include "LPC11XX.H"

#define LED1_ON LPC_GPIO1->DATA &= ~(1<<8)
#define LED1_OFF LPC_GPIO1->DATA |= (1<<8)

#define LED2_ON LPC_GPIO0->DATA &= ~(1<<2)
#define LED2_OFF LPC_GPIO0->DATA |=(1<<2)

#define LED3_ON LPC_GPIO2->DATA &= ~(1<<7)
#define LED3_OFF LPC_GPIO2->DATA |=(1<<7)

#define LED4_ON LPC_GPIO2->DATA &= ~(1<<8)
#define LED4_OFF LPC_GPIO2->DATA |= (1<<8)

#define LED5_ON LPC_GPIO2->DATA &= ~(1<<1)
#define LED5_OFF LPC_GPIO2->DATA |= (1<<1)

#define LED6_ON LPC_GPIO0->DATA &= ~(1<<3)
#define LED6_OFF LPC_GPIO0->DATA |= (1<<3)

#define LED7_ON LPC_GPIO2->DATA &= ~(1<<11)
#define LED7_OFF LPC_GPIO2->DATA |=(1<<11)

#define LED8_ON LPC_GPIO0->DATA &= ~(1<<10)
#define LED8_OFF LPC_GPIO0->DATA |=(1<<10)


/***********************************/
/***********************************/
void delay()
{
uint16_t i,j;

for(i=0;i<5000;i++)
for(j=0;j<200;j++);
}

/***********************************/
/***********************************/
void led_init()
{
LPC_GPIO2->DIR |= (1<<1); 
LPC_GPIO2->DATA |= (1<<1); 
LPC_GPIO2->DIR |= (1<<8); 
LPC_GPIO2->DATA |= (1<<8); 

LPC_GPIO2->DIR |= (1<<7);
LPC_GPIO2->DIR |= (1<<11);

LPC_GPIO1->DIR |= (1<<8);
LPC_GPIO1->DIR |= (1<<10);
LPC_GPIO0->DIR |= (1<<2);
LPC_GPIO0->DIR |= (1<<3);

}
/***********************************/

/***********************************/
int main()
{
led_init();

while(1)
{
delay();
LED1_ON;
LED2_ON;
LED3_ON;
LED4_ON;
LED5_ON;
LED6_ON;
LED7_ON;
LED8_ON;

LED7_OFF;
}

return 0;
}

Have a great day,

VN

0 Kudos