Arduino pro micro pinouts
3$) and perfect for small boards (less than 81 keys). With a little hack though, it can drive a keyboard with up to 100 keys.
Number of pins: 18+2
The Arduino Pro Micro has 18 easily accessible pins, that’s theoretically enough for a board with up to 81 keys (9*9).
However, there are 2 more pins, used by the onboard LEDs, which can be quite easily turned into usable pins. Just follow my Pro Micro upgrade guide and solder your wire to the pad of the removed resistors of the RX/TX LEDs. This way you can wire up a board with up to 100 keys (using the 18+2 pins in a matrix of 10 rows and 10 columns).
The additional pins are B0 and D5 as described in the ATmega16U4/32U4 data sheet.
The Atmega32u4 has even more GPIO pins (26), which could be available by soldering directly to the microcontroller, but that’s not really for beginners.
Pinout & pin names
If you use the Pro Micro outside the Arduino IDE (e.g. with QMK), you’ll have to translate the pin names marked on its PCB to the AVR ones. E.g. pin 3 on the Pro Micro is called D0 on the Atmega32u4.
Arduino makes it confusing by not mapping its pin numbers to AVR ports, but this is for a reason. Some pins on the AVR can also be used for special purposes such as serial, timer input, PWM output, etc. and they are therefore sometimes labelled by those functions on the Pro Micro.
Here is the mapping:
Arduino pins to AVR ports. This is a table to translate the Arduino pin names marked on the silk screen into ARV ports, ordered more or less alphabetically:
Arduino | AVR |
---|---|
TX0 | D3 |
RX1 | D2 |
2 | D1 |
3 | D0 |
4 | D4 |
5 | C6 |
6 | D7 |
7 | E6 |
8 | B4 |
9 | B5 |
10 | B6 |
14 | B3 |
15 | B1 |
16 | B2 |
A0 | F7 |
A1 | F6 |
A2 | F5 |
A3 | F4 |
LED pin (left of crystal) | B0 |
LED pin (right of crystal) | D5 |
AVR ports to Arduino pin names. The same data as above, this time in order of the AVR codes to make translating from AVR to Arduino easier:
AVR | Arduino |
---|---|
B0 | LED pin (left of crystal) |
B1 | 15 |
B2 | 16 |
B3 | 14 |
B4 | 8 |
B5 | 9 |
B6 | 10 |
C6 | 5 |
D0 | 3 |
D1 | 2 |
D2 | RX1 |
D3 | TX0 |
D4 | 4 |
D5 | LED pin (right of crystal) |
D7 | 6 |
E6 | 7 |
F4 | A3 |
F5 | A2 |
F6 | A1 |
F7 | A0 |
Voltage
The Pro Micro has a built-in voltage regulator (it was designed to run on batteries).
There are two variants of the Pro Micro: One which feeds the AVR 3.3V, and one which is made to feed it 5V — the 5V version being the most common.
If you do feed it with +5.0V from USB, however, there is a penalty — the voltage regulator will deliver only +4.9V.
The AVR should run well on 4.9V, but you could also bypass the voltage regulator by bridging J1 with solder.
- RAW = +5V from the USB port (or power IN if you use battery).
- VCC = +4.9V (or 3.3V) from the voltage regulator, or +5V if bypassed.
On 3.3V, the AVR is limited to 8 MHz and the firmware needs to be made for it but since most firmwares are made for the Teensy 2.0 which runs always on 5V, if you have the 3.3V of the Pro Micro you should bridge J1 to run that firmware.
Conclusion
The Pro Micro is a great choice if its 18+2 pins are sufficient for your project. For more pins the Teensy is a good alternative (Pro Micro vs. Teensy comparison), or check this ever growing list of common controllers with similar form factor (not just for keyboard projects).
Credits
References
About
DIY electronics, logical layout design, keyboard building and restoring vintage boards.
Arduino Pro Micro
Manufacturer | Sparkfun (and others) |
---|---|
License | Creative Commons Share-alike 4.0 International |
Host port | USB Micro B |
Microcontroller | ATMega32U4 |
MPU | AVR (8-bit) |
Voltage | 3.3V or 5V |
Clock speed | 8 MHz or 16 MHz |
Digital I/O pins | 18 |
RAM | 2.5 KB |
Program memory | 32 KB |
EEPROM | 1 KB |
Boot loader | Caterina |
Website | www.sparkfun.com/products/12640 |
The Pro Micro is an Arduino-compatible microcontroller board developed under an open hardware license by Sparkfun. Clones of the Pro Micro are often used as a lower-cost alternative to a Teensy 2.0 as a basis for a DIY keyboard controller/converter when a lower number of pins would suffice.
Contents
Description
Like the Teensy 2.0, it sports an AVR ATmega32u4 8-bit microcontroller which has an integrated USB controller. It has a micro-USB type B port (Teensy 2.0: mini-USB), 18 I/O pins (Teensy 2.0: 25 I/O pins) and an integrated voltage regulator for 3V operation.
The Pro Micro is sold in a 3.3 V version (8 MHz) and a 5 V version (16 MHz).
On the 3.3 V version, shorting a solder bridge (J1) on the chip bypasses the 3.3 V voltage regulator on the board. This would allow 5 V operation and running at 16 MHz clock. At 3.3 V, the ATmega32u4 is otherwise limited to 8 MHz clock.
The ProMicro has three LEDs:
Colour | Function | ATmega32u4 port |
---|---|---|
red | power on | |
yellow | USB receiving data | PB0 (active low) |
green | USB sending data | PD5 (active low) |
Pinout
Arduino | AVR | ↑ | AVR | Arduino | ||
---|---|---|---|---|---|---|
USB port | ||||||
TX | D1 | PD3 | RAW (+5V from USB) | |||
RX | D0 | PD2 | GND | |||
GND | Reset | |||||
GND | Vcc (+3V*) | |||||
SDA | D2 | PD1 | PF4 | D21 | A3 | |
SCL | D3 | PD0 | PF5 | D20 | A2 | |
A6 | D4 | PD4 | PF6 | D19 | A1 | |
D5 | PC6 | PF7 | D18 | A0 | ||
A7 | D6 | PD7 | PB1 | D15 | SCLK | |
D7 | PE6 | PB3 | D14 | MISO | ||
A8 | D8 | PB4 | PB2 | D16 | MOSI | |
A9 | D9 | PB5 | PB6 | D10 | A10 |
- Two more pins are accessible by soldering directly to the bottom of the two lower most LEDs — the one above the P in the «Pro» label (beside the number 8), and the o in the «Micro» (beside the 1 of the number 16 in the image). These are Pins PB0 and PD5 of the AVR.
The pinout is nearly identical to the Arduino Pro Mini which has pin 3 as an additional Reset line instead of Ground.
Programming
Uploading native software to run on the Pro Micro works different than for the Teensy 2.0. There is no reset button on the board, instead two pins have to be shortcut twice to bring the device in bootloader mode for 8 seconds. While the Teensy comes with an graphical uploader tool, the Pro Micro is programmed using a command line tool called avrdude. Sparkfun’s and scottc’s tutorials explain this further (see links).
Clones
- See the Pro Micro category for controller boards that are pin-compatible.
- See the ATmega32U4 category for controller boards with the same microcontroller (but different pinout).
Beware that there are clones that differ from the original in incompatible ways:
Longer circuit board Pin-compatible alternatives for the keyboard community may be longer for extra functionality, such as fitting a USB-C port (which is larger), more pins, buzzer (for «click») and/or circuitry for a Bluetooth transceiver. They will not fit all keyboard PCBs or cases. Wider circuit board Wider, with the rows of pins one or two positions farther apart. [1] These will not fit a (keyboard) PCB made for the proper hole spacing. Shorts VBUS to Vcc Some 5V clones have no 5V voltage regulator and diode or connect the regulator only to the RAW pin. This can be a problem for some split keyboards with a Pro Micro in each half of which only one is connected to the host: voltage on the VBUS input is usually used to determine which side should be master and which should be slave. 8 MHz crystal Both 5V and 3.3V Sparkfun Pro Micros have a 16MHz clock crystal. The max clock for 3.3V is 8 MHz, and software intended to run on Pro Micros at 3.3V could set the prescaler to halve the input frequency — and then instead run at 4 MHz. Wrong pinout Pro Micro clones with USB-C have been spotted where the PB1 and PB3 pins have been swapped. [2]
Arduino Micro и Arduino Pro Micro
Arduino Micro — это миниатюрная плата совмещающая в себе все необходимые возможности, простоту в использовании и низкую стоимость. Она может определяться как периферийное устройство.
Arduino Micro не сильно отличается от своих собратьев. На плате расположены 12 аналоговых вводов и 20 цифровых вводов/выводов. 7 из них могут быть использованы как ШИМ выходы. Так же имеется кварцевый генератор с частотой 16 МГц, кнопка перезагрузки и разъем микро-USB. Основное отличие ардуино микро от ардуино нано заключается в самом микроконтроллере. Здесь использован ATmega32u4. Он имеет встроенную поддержку USB соединения. Благодаря этому Arduino Micro может определяться компьютером не только как последовательный COM порт, но и как периферийное устройство. Можно сказать что это уменьшенная копия Arduino Leonardo
Версия Arduino Pro Micro отличается меньшими размерами и имеет 22 пина. Из них 5 могут быть использованы в качестве ШИМ выводов и 4 как аналоговые входы.
Arduino Pro Micro выглядит вот так:
Arduino Micro
Так как ардуино микро и про микро практически не отличаются друг от друга, я расскажу подробнее про одну из них.
Характеристики:
- Микроконтроллер: ATmega32u4
- Предельное напряжение питания: 5-20 В
- Рекомендуемое напряжение питания: 7-12 В
- Цифровых вводов/выводов: 20 (18 в Pro версии)
- ШИМ: 7 цифровых пинов могут быть использованы как выводы ШИМ (5 в Pro версии)
- Аналоговые выводы: 12 (4 в Pro версии)
- Максимальная сила тока: 40 mAh с одного вывода и 500 mAh со всех выводов.
- Flash память: 32 КБ
- SRAM: 2,5 КБ
- EEPROM: 1 КБ
- Тактовая частота: 16 МГц
Подключение питания к Arduino Micro
Этот микроконтроллер можно питать через порт micro-USB от компьютера, паувербанка или от адаптера, подключенного в розетку.Так же пин +5V является не только выводом, но и вводом. Можно подавать ток на него и все это будет работать только при условии, что напряжение подаваемого тока строго равно пяти вольтам!
Еще можно подавать постоянный ток с напряжением от 6 до 20 вольт на пин VIN. Это предельные значения! При подачи напряжения 20 вольт на плате будет сильно греться стабилизатор напряжения вплоть до выхода из стоя. Если же подавать 5 вольт, то ардуинка может вообще не заработать. Если и заработает то на цифровых пинах напряжение будет ниже 5 вольт. Это связанно с тем, что стабилизатор напряжения имеет не 100% КПД. Рекомендуемое напряжение для питания через пин VIN — от 7 до 12 вольт.
Распиновка Arduino Micro
Как уже было написано выше, плата имеет 20 цифровых пинов. Они могут быть как входом так и выходом. Рабочее напряжение этих пинов составляет 5 В. Каждый из них имеет подтягивающий резистор и поданное на один из этих пинов напряжения ниже 5 вольт все равно будет считаться как 5 вольт (логическая единица).
Аналоговые входы: A0 — A5, A6 — A11 (на цифровых выводах 4, 6, 8, 9, 10 и 12). Всего Micro имеет 12 аналоговых входов, причем входы с A0 по A5 маркированы непосредственно на выводах, а другие, к которым также можно получить доступ в программе с использованием констант с A6 до A11, распределены соответственно на цифровых выводах 4, 6, 8, 9, 10 и 12. Все они также могут использоваться в качестве цифровых вход/выходов. Они измеряют поступающее на них напряжение и возвращают значение от 0 до 1024 при использовании функции analogRead(). Эти пины измеряют напряжение с точностью до 0,005 В.
Широтно-импульсная модуляция (ШИМ) Arduino Micro
У ардуино микро есть 7 выводов ШИМ, это пины 3, 5, 6, 9, 10, 11 и 13. Для использования ШИМ у Arduino есть специальная функция analogWrite().
Другие пины:
- Пины 0 (RX) и 1 (TX) используются для передачи данных по последовательному интерфейсу.
- Выводы для связи по интерфейсу SPI не подключены к цифровым пинам.
- Так же на выводе D13 имеется встроенный в плату светодиод.
- Пины 2 (SDA) и 3 (SCL) могут использоваться для связи с другими устройствами по шине I2C. Подробнее про этот интерфейс вы можете почитать на википедии. В среде разработке Arduino IDE есть встроенная библиотека «wire.h» для более легкой работы с I2C.
Физические характеристики
Arduino Micro имеет следующие размеры: длина 48 мм и ширина 18 мм. Однако разъем USB немного выпирает за пределы печатной платы. Arduino Micro весит всего около 12 грамм. Плата имеет 4 отверстия для возможности ее закрепления на поверхности. Расстояние между выводами равняется 2,54 мм.
Принципиальная схема Arduino Micro
Добавить комментарий Отменить ответ
Для отправки комментария вам необходимо авторизоваться.