PIO1_11 does not read correctly

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

PIO1_11 does not read correctly

201 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by syed on Wed Jun 15 10:00:05 MST 2011
Hi All,

            I am using LPC1114 in my project. I am trying to set PIO1_11 as digital input and and it does not read the correctly.

I have initialised the pin direction correctly which I can confirm using the debugger.  The pin is tied to a  3V3 line. [B]I am getting the pin status as low. The pin status read using the debugger is also low but I can see using [COLOR=Red]oscilloscope that its high[/COLOR][/B].

I have tried this on the LPC Expresso board (LPC1114)

#define HDW_IP_BTN_P_11_BIT            11
bool
GIO_get_p1_11(
    void
) {
    bool status;

    status = (LPC_GPIO1->DATA & ( 1 << HDW_IP_BTN_P_11_BIT)) ? FALSE : TRUE;
   
    return status;
}

Can anyone please let me know whats happening ?

Regards,
Syed
0 Kudos
2 Replies

192 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by syed on Wed Jun 15 10:32:37 MST 2011
Solved. Was not setting the Digital functional mode.

Regards,
Syed
0 Kudos

192 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Jun 15 10:17:16 MST 2011
LPC_IOCON->PIO1_11?


Quote:
  The pin is tied to a  3V3 line

I hope you've used a resistor  :eek:

 LPC_IOCON->PIO1_11 = 0xD0;
should reset IOCON (with pull-up)
0 Kudos