LPC1788 144 pin QFP type: W-type IO having problem in input mode.

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

LPC1788 144 pin QFP type: W-type IO having problem in input mode.

527 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by awadhesh on Thu Sep 04 04:06:41 MST 2014
Hi,
I want to interface micro SD card to ssp1 on pin 113, 112, 111, 109. But I had checked that problem in MISO pin i.e. 111(P0.8) not receiving anything from SD card. I checked it and there are data on that pin on oscilloscope.

Now I am going to check that  this pin can work in input mode or not. But it is always low whatever voltage applied on pin. After that I check the details of this pin, I got that these are W-type pin P0.7, P0.8, P0.9. I do same on all these pin, but these never read applied logic voltage.

After I configured these as output and making these to high and low with some delays to blink four leds. All leds are blinking as per expectation. But when I read PIN register, only changing is in P0.6, which is D-type, all W-type cannot read these are always low, even connected leds are blinking. I configured these pins in every setting like-pull up, pull down, filter enable/disable, hys enable/disable etc, but never get result. code is here.

========================================================================
LPC_IOCON->P0_6 = 0x00;//SSEL->SPI
LPC_IOCON->P0_7 = 0x330;//CLK->SPI
LPC_IOCON->P0_8 = 0x330;//MISO->SPI
LPC_IOCON->P0_9 = 0x330;//MOSI->GPIO
//LPC_GPIO0->DIR &= ~(0x1<<8);
//LPC_GPIO0->DIR &= ~(0x1<<7);
//LPC_GPIO0->DIR &= ~(0x1<<9);
LPC_GPIO0->DIR |= (0x1<<6);
LPC_GPIO0->DIR |= (0x1<<8);
LPC_GPIO0->DIR |= (0x1<<7);
LPC_GPIO0->DIR |= (0x1<<9);

while (1)                                      // repeat forever
{
sprintf((char*)g_buf, "LPC_GPIO0 = %x\n\r", LPC_GPIO0->PIN);
DebugPuts(g_buf);

//if(LPC_GPIO0->PIN & (1<<8))DebugPuts((uint8_t*)"High ...\n\r");
//elseDebugPuts((uint8_t*)"Low ...\n\r");
LPC_GPIO0->SET = 0x3C0;
DelayMS(10000);
sprintf((char*)g_buf, "LPC_GPIO0 = %x\n\r", LPC_GPIO0->PIN);
DebugPuts(g_buf);
LPC_GPIO0->CLR = 0x3C0;
DelayMS(10000);
}

=====================================================================

I am getting like below.
LPC_GPIO0 = 7bfc07f
LPC_GPIO0 = 7bfc03f
LPC_GPIO0 = 7bfc07f
LPC_GPIO0 = 7bfc03f
LPC_GPIO0 = 7bfc07f
LPC_GPIO0 = 7bfc03f
LPC_GPIO0 = 7bfc07f
LPC_GPIO0 = 7bfc03f
LPC_GPIO0 = 7bfc07f
LPC_GPIO0 = 7bfc03f
LPC_GPIO0 = 7bfc07f
LPC_GPIO0 = 7bfc03f


Please let me the solution if anyone have.
Labels (1)
0 Kudos
1 Reply

491 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Pacman on Fri Sep 05 07:33:52 MST 2014
The only difference between W and D pins is the filter function, as far as I can see.

Try setting P0_7, P0_8 and P0_9 to input and P0_0, P0_1 and P0_2 as output ...

    LPC_GPIO0->DIR &= ~((1 << 7) | (1 << 8) | (1 << 9));  /* P0[9:7] are inputs */
    LPC_GPIO0->DIR |= (1 << 0) | (1 << 1) | (1 << 2);  /* P0[2:0] are outputs */


... then configure all 3 pins using the following value ...

    LPC_IOCON->P0[7] = ((1 << 5) | (1 << 7));
    LPC_IOCON->P0[8] = ((1 << 5) | (1 << 7));
    LPC_IOCON->P0[9] = ((1 << 5) | (1 << 7));


... and read them and output them to each their own LED using ...

    while(1)
    {
        p0_7 = (LPC_GPIO0->PIN >> 7) & 1;
        p0_8 = (LPC_GPIO0->PIN >> 8) & 1;
        p0_9 = (LPC_GPIO0->PIN >> 9) & 1;
        LPC_GPIO0->PIN = (p0_7 << 0) | (p0_8 << 1) | (p0_9 << 2);
    }


The LEDs should connect on pin 66, 67 and 141. I recommend a 1K resistor from VCC to the LED's anode and then connect the LED's cathode to the pin on your LPC1788.

Now connect a 4K7 resistor to GND and the other end of the 4K7 resistor to a wire (I prefer single-strand).
"probe" the wire on pin 109, 111 and 112 and see if there's any difference on the 3 LEDs.
Connect the 4K7 resistor to 3V3 instead and repeat the above action.
(You can use any value between 1K and 10K for the 4K7 resistor; it's not important)

Can you make any of the LEDs change by touching pin 109, 111 and 112 with the probe-wire ?
0 Kudos