Arduino ProMicro - remove bootloader?

I find I’m running low on flash space with my ProMicro 3.3 and I’m wondering if I can remove the bootloader and load my sketch directly using an AVR Pocket programmer?

I’ve been trying all the tricks I know to optimize my sketch, including editing the libraries I’m using to weed out anything that’s not being used. Still, I’m down to less than 400 bytes remaining in the flash, and there is more functionality I still want to include.

From what I understand, I just need to connect MISO, MOSI, SCK, /RESET, and Ground from the 6-pin connector on the AVR Pocket programmer to the appropriate pins on the ProMicro, then if I write the sketch through the programmer that should overwrite the bootloader and let me use the full 32k of flash?

Thanks!

Yep. If you connect to the ISP pins with a programmer, the normal procedure will overwrite the bootloader.

In Arduino 1.0, the Shift-Upload button will “upload using programmer” (assuming you have one of the programmers that Arduino recognizes) instead of using the bootloader…

Fantastic - thank you Westfw!

Many programmers also need the processor’s Vcc connected to the 6th pin. It’s often used to power level translators on the programmer or for the programmer to know that the target is powered up. Note that most programmers do NOT use this pin to supply power to the target.

/mike

Thanks for the tip, N1ist!

I didn’t want to risk having 5v from the programmer get into my project as I’m using the 3.3v version of the ProMicro. I know the 32u4 can handle 5v but I already have some sensitive 3v peripherals soldered in and they would not be able to cope with 5v.

I’ll try it with just the 5 connections first; if that does not work then I’ll hook up the last one. I think the AVR Pocket has a switch anyways to turn on/off powering the target device.

Yeah, I think you need to set the switch to ‘No Power’, so that the programmer is powered by the target. By doing so, and supplying 3.3v on the VCC pin, the programmer will run at 3.3V. Otherwise the logic levels on the MOSI and SCLK will still be +5v.