chipKIT® Development Platform

Inspired by Arduino™

Chipkit max32 pins not working

Created Tue, 10 Jul 2012 12:14:00 +0000 by Vittorio


Vittorio

Tue, 10 Jul 2012 12:14:00 +0000

Hello, I'm trying to port a project i realized on the arduino mega 2560 to the chipkit max32. Although I'm able to compile it in mpide I'm not able to get the board work properly.

it seems I'm not able to control board's pins i.e. using the simple code

void setup() {                
  pinMode(27, OUTPUT);
  pinMode(29, OUTPUT);     
}

void loop() {
  digitalWrite(27, HIGH);   // set the LED on
  digitalWrite(29, LOW);    // set the LED off
  while(1);
}

i don't manage to get the 3.3 V on the digital output 27. I tried to set board both as "chipkit max32' and 'chipkit max32 - usb for serial'

but it seems not to work. I bought 5 max32 and I get the same problem on all of them. Am I really unlucky and i got a delivery of not workin board or am I missing something about how to set it up?

thanks for any hint V.


majenko

Tue, 10 Jul 2012 12:23:52 +0000

Pin 27 is the D+ line for the USB interface. It is a special pin and I have had trouble using it for output before now.

I would avoid using using pins 24 thru 27 for anything other than interfacing to USB.

Pin 29 should be perfectly fine - it is shared with one of the MSSP peripherals, so can't be used if you're using I²C 2 or SPI 2A or UART2A, but other than that should be fine.


nik999389

Tue, 10 Jul 2012 14:34:15 +0000

I think one of the problems might also be the your only setting pin 29 to low. This means that you will always have it at 0v. Why don't you try just connecting one LED to pin 29 and try this code:

void setup() {       
  pinMode(29, OUTPUT);     
}

void loop() {
  digitalWrite(29, HIGH);   // set the LED on
  delay(500);                   // wait half a second
  digitalWrite(29, LOW);    // set the LED off
  delay(500);                   // wait half a second
}

This should Turn on and off the LED every second. Hope this helps!


Vittorio

Fri, 13 Jul 2012 15:16:36 +0000

Thank you... I made it work avoiding the cursed pins ;) ;)