chipKIT® Development Platform

Inspired by Arduino™

Pins 29 and 50 connected to the same microcontroller pin

Created Thu, 25 Oct 2012 17:15:34 +0000 by lffelzmann@gmail.com


lffelzmann@gmail.com

Thu, 25 Oct 2012 17:15:34 +0000

Hello all,

I perceived that the pins 29 and 50 of the ChipKit Max 32 board are connected to the same RG7 pin of the microcontroller. I'm working on a project and I'm using almost all pins of the kit, so I can't change the pins now. The problem is that when I turn a pin on, the other pin will turn on too.

I tried to do it 2 ways and here is just an example. I can't publish the real code here. But I tested these examples and they have the same problem:

First way:

void setup(void)
{
  pinMode(29,OUTPUT);
}
void loop(void)
{
  digitalWrite(29,HIGH); //This should turn only the pin 29 on. But pin 50 goes HIGH too...
  delayMicroseconds(50);
  digitalWrite(29,LOW); //This should turn only the pin 29 off. But pin 50 goes LOW too...
  delayMicroseconds(50);
}

Second way:

void setup(void)
{
  TRISGCLR=0b10000000; //Sets the pin 29 as an output by changing directly the microcontroller register.
}
void loop(void)
{
  LATGSET=0b10000000; //This should turn only the pin 29 on. But pin 50 goes HIGH too...
  delayMicroseconds(50);
  LATGCLR=0b10000000; //This should turn only the pin 29 off. But pin 50 goes LOW too...
  delayMicroseconds(50);
}

Why are these pins connected to the same microcontroller pin? Is there any way to use these pins independently?


EmbeddedMan

Thu, 25 Oct 2012 17:54:53 +0000

These types of questions are best answered by the use of the schematic.

In fact, if you look on page 5 of the Max32 schematic - [url]http://www.digilentinc.com/Data/Products/CHIPKIT-MAX32/chipKIT%20Max32_bysa_d_sch.pdf[/url] you will find your answer! Your pins ARE connected on your board, but it is very easy to separate them.

*Brian


lffelzmann@gmail.com

Thu, 25 Oct 2012 18:08:33 +0000

Thanks for answering.

Your pins ARE connected on your board, but it is very easy to separate them.

Sorry, but I'm not perceiving how easy it is... How can I separate them? Even if I cut the board rail, one pin will have no control! I can't change the pins now... All other pins are being used. The project is well advanced and when I began it, I trusted that all I/Os were independently controlled. So I chose pin 29 for one purpose and pin 50 for another one. When I saw that they were actioning together, I perceived the problem above...


lffelzmann@gmail.com

Thu, 25 Oct 2012 18:24:24 +0000

Sorry sorry sorry.

I was a perfect idiot. I didn't see the jumpers. I can change the jumper JP3 position. This would connect pin 50 to the RG8 pin. This would affect pin 43 and cause the problem again. But this I can solve.

Thanks again.


EmbeddedMan

Thu, 25 Oct 2012 18:51:03 +0000

Nope, you are not an idiot at all. It's very easy to make assumptions about these types of things, and very easy to get bitten by something that the designer had to do on the board that you didn't anticipate. Without checking through all of the relevant documentation, you can never really be sure. That's why it's so awesome that these boards are open source hardware - you can see everything - nothing's hidden.

Good luck on your project, and report back how it goes!

*Brian


rasmadrak

Thu, 01 Nov 2012 21:46:01 +0000

Hi there!

I'm having the exact same problem, but I may be even dafter than the OP. :D If I move the JP3 jumper from master to slave, my SPI device (an SD card reader) stops working. If I move both JP3 and JP4 the sd card stops working AND the display on DSPI1 starts to flicker...

So - If I move only the JP3 jumper - how do I get the SPI to work again? Would the J13 still work?

It's quite a hassle to connect the cables any other way they are currently connected so I'd appreciate feedback before I start pulling cables... :)


rasmadrak

Sun, 04 Nov 2012 22:36:47 +0000

Anyone...? I'm stuck on this one and redesigning the cable layout (including making new cables) would be a major pain...

Maybe Digilent staff could help in this matter?

Thanks in advance!


rasmadrak

Mon, 05 Nov 2012 22:58:50 +0000

I guess it's up to me making new cables then... Too bad the 29'th pin is just in the middle of a 16pin cable. :)


GeneApperson

Tue, 06 Nov 2012 18:40:34 +0000

There are several cases on the Max32 board where the same microcontroller pin is either directly connected to two connector pins or potentially connected to two different microcontroller pins through jumpers. I need to put some additional text into the reference manual to make this more clear.

I did this for a reason (although some people will no doubt think that my reason wasn't good enough :) )

There were more connector pins available than there were I/O signals to connect to them, and I thought that having certain signals show up on two different connectors would make certain things more convenient:

For example: the AREF signal is connected to the PIC32 signal VREF+/PMA6/RA10. This PIC32 signal is also connected to digital pin 44 (on connector J8). By having this signal show up on connector J8 as well as on J3, it is possible to pull all of the signals to use the parallel master port (at least 8-bit data and 7 address lines) entirely from connectors J8 & J9 without the need to snake over to connector J3 to pick up address PMA6. You might argue that this isn't a good enough reason, but that is why I did it that way.

The same argument also applies to PMA4/SDI2A/RG7, which is connected through jumpers to either digital pin 50 or 51 and pin 29. It puts the PMP address line in a realiable accessible place indepenet of the jumper settings.

I think that the biggest problem here is that this particular design quirk wasn't sufficiently well documented in the reference manual.

Gene Apperson Digilent


GeneApperson

Tue, 06 Nov 2012 18:52:04 +0000

Oh... and I forgot to say: Sorry for the inconvenience that this caused.

Gene


rasmadrak

Thu, 08 Nov 2012 16:50:47 +0000

Hehe, I understand why you did this... but I don't understand if it's possible to solve it. ;) Is it possible to keep both the regular SPI intact and still allowing pin 29 to be "independent", as in - not connected to the SPI?

I have not yet started pulling any cables, been busy doing the metalwork needed for the machine...