chipKIT® Development Platform

Inspired by Arduino™

How to use HID Bootloader in max32?

Created Tue, 03 Jan 2012 18:38:33 +0000 by diodoman


diodoman

Tue, 03 Jan 2012 18:38:33 +0000

Is posible to use the ubw32 bootloader with Max32, i want to use the mmbasic 2.7 (build for ubw32) in my chipkit but seems like that bootloader is not working properly, my chipkit is not detected by my pc, or i am missing something, im using pins 26, 27, 5v0 and gnd to connec an usb port.


EmbeddedMan

Tue, 03 Jan 2012 21:58:41 +0000

I don't see any reason why it would not work. Don't forget to pull up USBID, tie VBUS to the USB 5V, and VUSB to 3.3V.

*Brian


diodoman

Wed, 04 Jan 2012 22:20:49 +0000

You are right i forgot to connect vusb to 5v, now is working, thank you.


Larkin32

Thu, 05 Jan 2012 10:42:24 +0000

chipKIT boards automatically reset the MCU when the FTDI COM port is first opened by the host computer. This behavior can be disabled (which is how I run) by cutting the trace under JP1 on the Uno32 or JP5 on the Max32, and then installing a removable jumper. If you have cut this trace, you will need to manually reset the board immediately before running avrdude, below, or temporarily install the jumper on the board. If you have not cut the trace, then every time you subsequently connect the terminal emulator to the board, the MCU will be reset. During the 4 seconds following reset, you must not enter any input on the terminal emulator or the bootloader will crash! After 4 seconds with no input from the terminal emulator, the bootloader will automatically transfer control to StickOS and then you can then press <Enter> to get a command prompt.

Download the avrdude program for Windows and the avrdude configuration file and possibly the libusb0.dll (.EXE, .CONF, .DLL for chipKIT Uno32 and Max32) Connect the board to the host computer. Determine the COM port used by the FTDI chip:

Download the appropriate avrdude bootloader image file from the CPUStick™ and StickOS® -- Downloads page. Reset the board (only needed if you have cut the trace under JP1 or JP5, above), and then immediately invoke the command below. In a command prompt, invoke avrdude as follows, with your particular COM port and avrdude bootloader image file specified:

avrdude -C avrdude.conf -c stk500v2 -p pic32-360 -P COMX -U flash:w:StickOS.XXX.hex

StickOS should be running, with the heartbeat led blinking slowly. Remember to configure your terminal emulator for XON/XOFF flow control since behind the FTDI COM port is a traditional UART on the MCU! Remember that if you have not cut the trace under JP1 or JP5, above, then every time you subsequently connect the terminal emulator to the board, the MCU will be reset. During the 4 seconds following reset, you must not enter any input on the terminal emulator or the bootloader will crash! After 4 seconds with no input from the terminal emulator, the bootloader will automatically transfer control to StickOS and then you can then press <Enter> to get a command prompt.


Cloee81

Wed, 11 Jan 2012 23:08:57 +0000

Hi everybody

I'm trying to do a kind of USB-RS232 converter, it's a very simple project. I'm using the Microchip DemoBoard with PIC18F4550, and C18 compiler. I succed to do my converter using CDC class. Now, I want to do the same thing but with the HID class, for it doesn't need any .inf file. The problem appears when I try to set the USART interrupt. I'm new to PIC18 devices (and to priority levels stuff), so I used interrupt structure I found in C18 documentation, with a hi and a low level interrupt (Receiving interrupt is set as low priority). This structure worked fine with CDC, so I tryied to do the same with HID. But when I set GIEH = 1, the device becomes unknown. If I doset GIEH = 0, the USART interrupt is never set, even with the CDC class. Anyone can help me? possibly I'm doing a really stupid thing, but I can't found it out!

Thanks! Elisandra

Interrupt setting: RCONbits.IPEN = 1; IPR1bits.RCIP = 0; PIR1bits.RCIF = 0; PIE1bits.RCIE = 1; INTCONbits.GIEH = 1; INTCONbits.GIEL = 1;

Code for interrupt: #pragma code high_vector=0x08 void interrupt_at_high_vector(void) { _asm goto high_isr _endasm } #pragma code

#pragma code low_vector=0x18 void interrupt_at_low_vector(void) { _asm goto low_isr _endasm } #pragma code

#pragma interrupt high_isr void high_isr(void) { }

#pragma interruptlow low_isr void low_isr(void) { if(PIR1bits.RCIF) { output_buffer[index]=RCREG; index++;

    if(index&gt;=5) 
    { 
        mLED_2_Toggle(); 
        Received=TRUE;                
        index=0;                    
        RCSTAbits.CREN=FALSE;        
    }    
} 

} #pragma code


EmbeddedMan

Fri, 13 Jan 2012 07:05:24 +0000

I think you'll get much better support on the microchip forums, as this forum is for chipKIT and MPIDE, which are all PIC32 at the moment, not PIC18.

*Brian


Harnand

Mon, 27 May 2013 05:23:17 +0000

You are right i forgot to connect vusb to 5v, now is working, thank you.

Same problem happened with me first time. I forgot to connect vusb to 5v and that was not working. :lol: