P0.29 vs P1.29

basically miscellaneous, if it doesn't fit another sub-forum enter it here, we might even promote it to its own sub-forum
danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

P0.29 vs P1.29

Post 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?



danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Re: P0.29 vs P1.29

Post 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.

olzeke51
Posts: 414
Joined: Sat May 17, 2014 4:22 pm
Location: South Carolina

Re: P0.29 vs P1.29

Post 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

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: P0.29 vs P1.29

Post 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

danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Re: P0.29 vs P1.29

Post 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.

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: P0.29 vs P1.29

Post 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.

danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Re: P0.29 vs P1.29

Post 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?

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: P0.29 vs P1.29

Post 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"

danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Re: P0.29 vs P1.29

Post by danlee58 »

P0.29, and P0.30 are both set as outputs.

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

danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Re: P0.29 vs P1.29

Post by danlee58 »

It's something in my program. I commented out most of the program, and now P0.29 does go High.

Post Reply