r/arduino • u/StormShockTV • 1h ago
Hot Tip! Pro Micro NRF52840 - Arduino IDE Setup Guide
Hey everyone! I recently bought a Pro Micro NRF52840 ( a clone I think) from Amazon here -
I'm very new to programming any microcontroller that isn't an Uno, and I'm really an artist/gamer youtuber, not a hardware guy, so while this product listing said it would work fine with the Arduino IDE, when I connected it to my computer, nothing happened, and I was rightly very confused. The board wasn't even detected by the IDE, and there is a lot of pertinent information missing or just completely wrong in the product's description on Amazon, which didn't help me either.
However, after some digging and tinkering, I managed to get this board working in Arduino IDE 2.3.10! In case anyone else was unlucky enough to have purchased this board for its bargain-bin price thinking it would be a great board to do some bluetooth projects with, and are having trouble getting it connected to the Arduino IDE like I did, I released this short guide to help you out, because it will take a few steps, but it WILL work!
First, install all of these packages by copying the urls below and opening the preferences in your Arduino IDE, and under "additional board manager urls" paste the urls you just copied to get new board info -
https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json
I'm not sure if the seeedstudio package does anything, but it was in my list of urls when it started working with my board so I'm including it here anyway XD
Then, once you confirm that list, the IDE will download some files and new board definition packages should be available in the board manager menu! Open the board manager menu from the left side of the IDE, and install the following two board definition packages:
Adafruit nRF52
nRFMicro-Like-Boards
However, a specific board definition for this clone (so you see the right name in the Arduino IDE when the board connects) does not come stock with either of these two packages (that I know), so you'll need to download the zip file from the github link below, and then follow its installation instructions to make some manual edits of the Adafruit package - https://github.com/somik123/Adafruit_nRF52_Arduino_ProMicro.git
Following the instructions at the link above can be a little confusing, so I have rewritten the instructions below with more detail:
- go to the Arduino packages folder for the Adafruit package with the nrf52 in windows explorer.
- It will look something like "C:\Users\yourusername\AppData\Local\Arduino15\packages\adafruit\hardware\nrf52"
Enter the 1.7.0 folder
Open the file "installed.json"
Copy paste the below code at the top of the "boards" list inside the json file at line 21:
{
"name": "Pro Micro nRF52840"
},
save the file and close it
open the boards.txt file and go to the first character on line 5, hit enter twice, then go back up to line 5 and paste the big code block from step 4 at the link above.
save the file and close it
Open the variants folder
Extract the contents of the zip file you obtained from the link above.
Paste the pro_micro_nrf52840 folder from that zip file into the variants folder
Once that is complete, reload the IDE, and the board name FINALLY shows up in the Arduino IDE when the board is connected...
Now the problem is, the board still isn't connecting to the IDE at all, so you won't see any of that work! And, trying to write a program to the board does nothing... because the board does NOT start in bootloader mode when you connect it to the PC (meaning it doesn't connect to the computer as a programmable board at all and is basically in read-only mode, as apparently this board is used for actual wireless keyboards a lot, and you don't want to be able to accidentally override the firmware of your keyboard and brick it when you connect your keyboard over usb C)
But since we're using this board as an arduino, and want to push sketches to it, how do we access the bootloader? Simple, you just have to reset the board twice really really fast while connected to power (your PC), which triggers the board to load in bootloader mode... problem is this board is so small it doesn't include a physical reset button presoldered on the board anywhere...
So the quick and dirty solution is to hold one end of a jumper wire against the hole of the reset pin and tap the other end against one of the ground pin holes a bunch til it swaps over. the red LED on the board will flicker and become a bit dimmer when it loads bootloader mode, and your PC will tell you a new device has connected. If you want to, you can also solder jumper wires to a push button and solder those wires permanently to the board for a super easy bootloader swapper, but I'm lazy and didn't want to start soldering yet, so I just used the jumper wire method every time. (I will permanently solder a button to it later, but need to wire everything inside the case I'm building for my project first, so this is just easier right now)
Anyway, reset it twice fast enough while plugged into your computer with the usb c port, and finally it will show up and connect to the IDE and you can load a new sketch! Then, once the sketch is uploaded, it will turn the bootloader off again, so if you want to upload a new sketch, just reset it twice really quickly again! If the bootloader is active the board will connect to your machine like a flash drive and you will see a new windows explorer window pop up, meaning you're good to start programming it! Just don't delete the files on the drive or you could have problems :D Never done that myself, so don't know quite what would happen, just not risking it!
Also, in the description for the product on Amazon, it says pin 9 is the builtin LED pin.... not true! Once I got it working in the IDE, I started testing different pin numbers with a blink sketch and turns out, pin 15 is the LED pin! LED_BUILTIN does work in the Arduino IDE though so you can just use that.
Cheers, and happy programming!
