lpcware

Definition of IOCON Mode

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by Patrick_W on Wed Apr 29 00:57:31 MST 2015
Hey Guys,

On my board i am using a LPC1763 and i connected a switch with external pulldown resistors to Port 1 Pin16-19.
I wanted to read in the value of this pins but i always read high (internal pullup is on by default).
So i used the Chip_IOCON_PinMux to switch of the internal Pullup resistor like this:


Chip_IOCON_PinMux(LPC_IOCON,PORT_1,PIN_19,IOCON_MODE_INACT,FUNC0);


But during debugging i saw that in the PINMODE Register the value is first set correctly and after setting the next pin,
the value is again overwritten (default mode again = pullup).
So i checked the definition of IOCON_MODE_INACT:


#if defined(CHIP_LPC175X_6X)
#define IOCON_MODE_INACT        (0x2 << 2)/*!< No addition pin function */


So the value is 8.
I then changed my code to this:

Chip_IOCON_PinMux(LPC_IOCON,PORT_1,PIN_19,2,IOCON_FUNC0);


The value 2 is written in the manual (page 114)
With the change my code behave like expected (PINMODE Register set correct).

So can anybody explain me the thought behind the definition of IOCON_MODE_INACT? Because it seems to be wrong in my case or had somebody
the same problem?

Regards




Outcomes