chipKIT® Development Platform

Inspired by Arduino™

PIC32MX250 pin blocked

Created Fri, 03 Apr 2015 11:26:02 +0000 by GastonLagaffe


GastonLagaffe

Fri, 03 Apr 2015 11:26:02 +0000

Salut,

I experiance a strange issue: When blinking an LED on the Port RB5 and RB14, all works fine either using digitalWrite or direct port manipulation. However, when inserting a Serial.begin(9600) in setup(), the ports no longer blink. Is this a bug or a feature? In the datasheet I was not able to find an information that linked these two ports to the serial interface. I tested all other pins and they are not changing due to Serial.begin()

Ciao, Mathias


majenko

Sat, 04 Apr 2015 00:02:07 +0000

Which board configuration are you using?


EmbeddedMan

Sat, 04 Apr 2015 00:07:08 +0000

Mathias,

I'm assuming you're using a 28 pin DIP part.

RB5 is also USBID, which is 'taken over' by the USB peripheral when you enable the USB module (using the Serial.begin() call) RB14 is VBUSON, and same story as RB5.

*Brian


GastonLagaffe

Sat, 04 Apr 2015 12:37:19 +0000

Salut,

thanks, that explains it. This is similar to the blocking of D0/D1 at the Arduino.

Have a nice Easter Break! After having played with the ChipKit platform for some months, I can sum up my experiance as a very positive one. This is mostly due to the exvellent support I experianced in this nice community

Ciao, Mathias


GastonLagaffe

Tue, 14 Apr 2015 09:05:45 +0000

Salut,

I tried to handle the blocking of the pins by calling Serial.end() after the serial output but this did not help. To my surprise, when using the PIC32MX270, I have no blocking effect on the pins.

This is the simple code I am testing:

const int ledPin =  7; 
void setup() {
	delay(2000);
	pinMode(ledPin, OUTPUT);     
}

void loop()
{ 
	Serial.begin(9600);
	Serial.println("loop");
	Serial.end();
	digitalWrite(ledPin, HIGH);
	delay(500);
	digitalWrite(ledPin, LOW);
	delay(500); 
}

Ciao, Mathias