Page 1 of 2

P0.29 vs P1.29

Posted: Sun Jan 25, 2015 10:21 pm
by danlee58
I use P0.29 as an Output pin. I also set P0.30 to be an Output pin, although I don't use P0.30.

I use P1.29 as an I2C Data Output pin. I pass that pin in the I2COUT procedure from Cor_bitbang.c.

I2COUT (29, 26, 0xE0, 1, list1);

Pin P1.29 is the I2C SDA pin, and Pin P1.26 is the SCL pin.

How do I call P1.29 in I2COUT, and not P0.29?

Re: P0.29 vs P1.29

Posted: Mon Jan 26, 2015 1:20 am
by danlee58
This should be the right code in Cor_bitbang.c.

#define SET_SCL_HIGH INPUT1(scl_pin)
#define SET_SDA_HIGH INPUT1(sda_pin)

#define SET_SCL_LOW {OUTPUT1(scl_pin);LOWx(scl_pin);}
#define SET_SDA_LOW {OUTPUT1(sda_pin);LOWx(sda_pin);}

That works for the I2C interface, but P0.29 will not go high (HIGH(29);) in my Main program.

Re: P0.29 vs P1.29

Posted: Mon Jan 26, 2015 4:16 am
by olzeke51
wouldn't you have to do an offset of 32 or 64 added to the pin number to
come up with the correct IO(pin) value ?? -- Like in the BASIC ??
Just an idea - haven't done much C on the Coridium boards.
olzeke51

Re: P0.29 vs P1.29

Posted: Mon Jan 26, 2015 1:37 pm
by basicchip
The bit banged routines in C as well as BASIC use "pins" 32 through 63 for P1.0 through P1.31

The INx, OUTx, ... are used in the i2c code in C (in cor_bitbang.c) and are defined in coridium_pcb.c

Re: P0.29 vs P1.29

Posted: Mon Jan 26, 2015 3:50 pm
by danlee58
Something is wrong with the I/O. P0.29, P0.10, P0.16, & P2.8 seem to be stuck Low. The rest of the I/O appears to be OK.

Re: P0.29 vs P1.29

Posted: Mon Jan 26, 2015 8:34 pm
by basicchip
You should check what you have connected to those pins. With almost 1500 in the field now, no one else is reporting this.

Re: P0.29 vs P1.29

Posted: Tue Jan 27, 2015 12:38 am
by danlee58
This is a new problem, they used to work. I have nothing connected to those pins now. I am testing the I/O outputs with the board disconnected from anything but the USB cable.

Is there a common failure mode for just those pins?

Re: P0.29 vs P1.29

Posted: Tue Jan 27, 2015 12:55 am
by basicchip
Is there a common failure mode for just those pins?
No

P0.29 and P0.30 have to be both inputs or outputs, mixing input and output on those 2 pins is unpredictable -- NXP "feature"

Re: P0.29 vs P1.29

Posted: Tue Jan 27, 2015 3:04 pm
by danlee58
P0.29, and P0.30 are both set as outputs.

What would cause these outputs to fail in a Low state?

Re: P0.29 vs P1.29

Posted: Tue Jan 27, 2015 3:39 pm
by danlee58
It's something in my program. I commented out most of the program, and now P0.29 does go High.