im currently making a custom pcb with a 32u4 as the controller, which i migrated over from a pro micro. when i look at the schematic of the pro micro, i see that digital pins 11-13 are marked as "not used", but it seems they still have a designation in the arduino ide (i think). can i use these pins for my project or will these pins be inaccesible because im using the pro micro bootloader?
If the pins are not currently selectable, you can look at boards.txt and the version of pins_arduino.h to see how the pins are created and modify it to add them in.
CrossRoads:
If the pins are not currently selectable, you can look at boards.txt and the version of pins_arduino.h to see how the pins are created and modify it to add them in.
i am going to be completely honest here and say that i understood maybe half of that
The ATMega32u4 is the basis of the Leonardo, which has support for pins 11-13. I can't see why they wouldn't be available if you're making your own board and you route them out. I don't know the history of the Pro Micro but I assume they tried to keep the form factor of the pro mini which uses the ATmega328. Since the ATmega328 has 32 pins and the ATMega32u4 has 44, a few pins had to go if they wanted to keep the same form factor and header spacings.
Here is the boards.txt entry for the Leonardo:
##############################################################
leonardo.name=Arduino Leonardo
leonardo.vid.0=0x2341
leonardo.pid.0=0x0036
leonardo.vid.1=0x2341
leonardo.pid.1=0x8036
leonardo.vid.2=0x2A03
leonardo.pid.2=0x0036
leonardo.vid.3=0x2A03
leonardo.pid.3=0x8036
leonardo.upload.tool=avrdude
leonardo.upload.protocol=avr109
leonardo.upload.maximum_size=28672
leonardo.upload.maximum_data_size=2560
leonardo.upload.speed=57600
leonardo.upload.disable_flushing=true
leonardo.upload.use_1200bps_touch=true
leonardo.upload.wait_for_upload_port=true
leonardo.bootloader.tool=avrdude
leonardo.bootloader.low_fuses=0xff
leonardo.bootloader.high_fuses=0xd8
leonardo.bootloader.extended_fuses=0xcb
leonardo.bootloader.file=caterina/Caterina-Leonardo.hex
leonardo.bootloader.unlock_bits=0x3F
leonardo.bootloader.lock_bits=0x2F
leonardo.build.mcu=atmega32u4
leonardo.build.f_cpu=16000000L
leonardo.build.vid=0x2341
leonardo.build.pid=0x8036
leonardo.build.usb_product="Arduino Leonardo"
leonardo.build.board=AVR_LEONARDO
leonardo.build.core=arduino
leonardo.build.variant=leonardo
leonardo.build.extra_flags={build.usb_flags}
You can see the build variant is "leonardo"
These are the pins to names from the variant/leonardo/pins_ardiuno.h:
const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
PD, // D0 - PD2
PD, // D1 - PD3
PD, // D2 - PD1
PD, // D3 - PD0
PD, // D4 - PD4
PC, // D5 - PC6
PD, // D6 - PD7
PE, // D7 - PE6
PB, // D8 - PB4
PB, // D9 - PB5
PB, // D10 - PB6
PB, // D11 - PB7
PD, // D12 - PD6
PC, // D13 - PC7
PB, // D14 - MISO - PB3
PB, // D15 - SCK - PB1
PB, // D16 - MOSI - PB2
PB, // D17 - SS - PB0
PF, // D18 - A0 - PF7
PF, // D19 - A1 - PF6
PF, // D20 - A2 - PF5
PF, // D21 - A3 - PF4
PF, // D22 - A4 - PF1
PF, // D23 - A5 - PF0
PD, // D24 / D4 - A6 - PD4
PD, // D25 / D6 - A7 - PD7
PB, // D26 / D8 - A8 - PB4
PB, // D27 / D9 - A9 - PB5
PB, // D28 / D10 - A10 - PB6
PD, // D29 / D12 - A11 - PD6
PD, // D30 / TX Led - PD5
};
Is it missing pins? The file can be modified and the missing pins added. They need to be described in several places in the file to fully document them.