chipKIT® Development Platform

Inspired by Arduino™

USB enumeration is lost upon MCLR assertion

Created Fri, 31 Jan 2014 08:14:09 +0000 by sthachil


sthachil

Fri, 31 Jan 2014 08:14:09 +0000

I am curious to get the fix for the following issue

Board: Fubarino SD Software IDE: MPDIE Program: Serial Communications and MPIDE Serial Monitor in http://pontech.dyndns.org/mtsac/elec74/2013-spring/Week%202/chipKIT%20Lab%202.pdf Functionality: Continuously print hex, dec, oct and binary of numbers < 256

Issue: When MCLR is asserted by pressing reset button the COM connection is lost. Upon power off / on the COM port is detected again. Is there anyway to do USB enumeration after reset is pressed without disconnecting the board?

Many thanks -sthachil


mikes

Fri, 31 Jan 2014 12:23:56 +0000

If you close the Serial Monitor before resetting the board after it reconnects you can reopen it to resume communications.

This is different from other chipkit boards like the Uno32 because the Fubarino uses the Processor for USB and not a FTDI that converts the USB to serial. On boards with FTDI the USB connection is not reset with the processor so you don't have to close the Serial Monitor. The advantage of using the processor is more flexibility it is possible to change the program so the Fubarino connects to the computer as other USB devices like a keyboard or mouse.


EmbeddedMan

Fri, 31 Jan 2014 20:02:37 +0000

No, I do not believe so. I don't think that there's anyway a USB session (enumeration) can survive across CPU reboots. The reset signal inside the PIC32 will reset the CPU peripheral, thus dropping it off the bus.

If this is critical, you may want to use one Fubarino SD as a USB communicator and a second one as your main development system. Then the second one can reset as many times as it wants, while the first remains connected to the USB.

Another option, as above, is to use a board with a separate USB to serial converter chip like the FTDI.

*Brian


Jacob Christ

Sat, 01 Feb 2014 17:30:03 +0000

sthachil,

It may not be apparent in the lab, but in the class we make it very clear to the students that you need to add a 3-5 second delay in your setup() to give you time to open the serial monitor after power is cycled so that you can see the output.

Also, how did you find this lab? Have you tried any others? Any suggestions or comments?

Jacob


majenko

Sat, 01 Feb 2014 17:42:58 +0000

In later versions of MPIDE you can test the status of the Serial object to see if it's connected or not (only on direct USB serial, not FT-232 serial):

void setup() {
  Serial.begin(9600);

  // Wait for a serial port connection
  while (!Serial) {
    continue;
  }

  // Wait a mo to allow the window top open if it's slightly slow
  delay(100);
}

Jacob Christ

Sat, 01 Feb 2014 17:47:53 +0000

majenko,

That's cool...

Jacob


ClarencePJ

Tue, 10 Feb 2015 11:30:54 +0000

This is completely different from additional chipkit boards such as the Uno32 for the reason that Fubarino makes use of the particular Processor for UNIVERSAL SERIES BUS instead of some sort of FTDI that switches the particular UNIVERSAL SERIES BUS in order to serial. On boards having FTDI the particular UNIVERSAL SERIES BUS interconnection is just not reset using the cpu and so you won't have to in close proximity the particular Serial Check.