You need to check data for device description (should be the same as in the device) and PID and VID number. To get that info just click on the apple sign (on the top left side of the screen), select About This Mac and press button System Report. Under USB you will find the device and copy the name (at the top) and Product ID and Vendor ID. Copy that to the interface file.
Choose the target you want to program (lpc2103.cfg in my example)
Last week I bragged about managing to compile simple blinky code for nrf51 dongle on Mac OS X.
The problem was that I couldn’t make BLE work. After banging my head against the wall and trying to tackle the problem I slowly got the info I need to add softdevice to the code and flash it before the program code.
At the end I tried to compile the softdevice and program code on Windows and it worked, so the problem was with the way JLinkExe is working on Mac OSX. After some googling I found out there is also a rknrfgo app for Mac OSX.
I’ve installed it and it worked like a charm. Just had to add link of softdevice and code to the app and finish everything by clicking the button Both.
Since I need to work on very small form factor device I searched for a tiny microcontroller with BLE and found Nordic Semiconductor with their nRF1822 and it is a perfect thing for my needs.
Since the customer will order the elements I ordered a nRF51 dongle so I can play with programming it before starting “proper” work on it.
The device came today and I tried to flash a blinky example which is more or less an easy thing… on Windows. But I wanted to do it on Mac OSX so … here are the findings:
1. Download the J-Link software from SEGGER webpage – Mac OSX version, obviously.
2. Under developer on Nordic web page download latest SDK (you might need to create an account there – by using My Page on their home page).
3. Go to <SDK directory>/components/toolchain/gcc and correct links in Makefile.posix (if needed).
4. Go to <SDK directory>/examples/peripheral/blinky/pca10028/blank/armgcc and compile the code with make command
5. The easiest way to upload the code to the dongle is to use the nrfjprog.sh script and the syntax is ./nrfjprog.sh –flash <hex code>. You might need to reset it before that with ./nrfjprog.sh –reset.
I tested OLED display I bought on ebay just to see if it works. What better way to do it than use Arduino platform. Libraries are more or less available and you can do quick test. Unfortunately it took me some time, since there are a lot of different ways to connect displays – not to mention different pins.
Luckily – I managed to finally get the display working by using Adafruit library. Had to use SPI communication since the display uses only that.
Anyway – the success was nice, but what I really wanted was use ATMEL and connect the display to microcontroller and not use the whole board. So here we go with coding for the microcontroller, right?
Well, so I thought and then it dawned on me (I know, I know – obvious thing) – why not add Arduino bootloader to ATMEGA16 and do it like that. Unfortunately ATMEGA16 was too small (16k was not enough) and since I have ATMEGA32A lying around – let’s do it on the 32k micro, then.
And this is the story of how to do it:
You need to add the “board” (well, microcontroller in our case) to Arduino IDE. This can be easily done by following this. Although it is created for old version of Arduino IDE it works ok with latest one (1.6.4). You just need to hack it to make it work with larger memory and (possibly) different fuses. I did that: