Forums

disabling PWM & I2C on P0.02 and P0.03 on a LPC2103

Started by Csaba Zvekan March 25, 2009
I am having difficulties disabling the multiplexed stuff on P0.2 & P0.3. I am trying to use it as a simple GPIO pins.

I tried disabling the I2C and PWM with these two commands but it won't work

I2C_I2CONCLR = 0x0; // Disable I2C
PWM_MCR = 0x0; // Match Control register off

Now this might be totally wrong , please remember "newbi" here . I have a dimmed led on P0.2 when I probe it . The other pin P0.3 is always off/low.

Here is my initialization code:
#define LEDPIN 26

#define SWPIN 16

#define Clk 2
#define Data 3
static void PerInit(void) // Peripheral initialization
{
I2C_I2CONCLR = 0x0; // Disable I2C
PWM_MCR = 0x0; // Match Control register off
IODIR |= (1< IODIR |= (1< IODIR |= (1<
IOSET = (1< IOSET = (1<
IODIR &= ~(1<
}

Any help greatly appreciated.

Thanks

Csaba

An Engineer's Guide to the LPC2100 Series

I think I got it :

I think I need external pull up resistors. Is 10K too high for 3.3.V pins or should I go 3.3k or something ?
Csaba

--- In l..., "Csaba Zvekan" wrote:
>
> I am having difficulties disabling the multiplexed stuff on P0.2 & P0.3. I am trying to use it as a simple GPIO pins.
>
> I tried disabling the I2C and PWM with these two commands but it won't work
>
> I2C_I2CONCLR = 0x0; // Disable I2C
> PWM_MCR = 0x0; // Match Control register off
>
> Now this might be totally wrong , please remember "newbi" here . I have a dimmed led on P0.2 when I probe it . The other pin P0.3 is always off/low.
>
> Here is my initialization code:
> #define LEDPIN 26
>
> #define SWPIN 16
>
> #define Clk 2
> #define Data 3
> static void PerInit(void) // Peripheral initialization
> {
> I2C_I2CONCLR = 0x0; // Disable I2C
> PWM_MCR = 0x0; // Match Control register off
> IODIR |= (1< > IODIR |= (1< > IODIR |= (1< >
> IOSET = (1< > IOSET = (1< >
> IODIR &= ~(1< >
> }
>
> Any help greatly appreciated.
>
> Thanks
>
> Csaba
>