lpcware

Disabled Port output

Discussion created by lpcware Employee on Jun 16, 2016
Latest reply on Jun 16, 2016 by lpcware

Content originally posted in LPCWare by Thucydides on Sun May 20 00:46:06 MST 2012
Hello,

 

I encountered a strange behavior of LPC1343's port output.
For just blinking LED I used following 10 ports.
P1.1, P1.10, P0.7, P2.0, P1.7, P1.6, P0.11, P1.2, P1.5, P1.0
But only three ports (P1.10, P0.7, P1.5) was justly toggled but other ports didn't work.
For example as for P1.10, it once rose High and remained High ever.
Anyone knows why such behavior occurs?
After that I added here IO config codes before GPIOSetDir() but the result was same.

 

Thanks,
Thucydides
http://knowledgebase.nxp.com/member.php?u=1317

 

My source codes.

 

struct ENABLE_PIN {
    unsigned char port_num;
    unsigned char bit_num;
};
struct ENABLE_PIN enable_pin[10] = {
    {1, 1}, {1, 10}, {0, 7}, {2, 0}, {1, 7}, {1, 6}, {0, 11}, {1, 2}, {1, 5}, {1, 0},
};

 

// Enable AHB clock to the GPIO domain.
LPC_SYSCON->SYSAHBCLKCTRL |= (1<<6);
for (i=0; i < 10; i++){
// ** I added here IO config codes later
    GPIOSetDir(enable_pin.port_num, enable_pin.bit_num, 1);
}

while (1)
{
    for (i=0; i < 10; i++){
        GPIOSetValue(enable_pin.port_num, enable_pin.bit_num, 1);
        delay32Ms(0, 250);
        GPIOSetValue(enable_pin.port_num, enable_pin.bit_num, 0);
          delay32Ms(0, 250);
    }
}

Outcomes