Work in Progress: MiKro 328 BLuE
Hello everyone
well maybe it is time to tell you about the project that still keeps me busy. Of course I’m not a company behind all the developments so it takes a little more time 🙂
The initial idea was similar to what Punch Through Design finally delivered with their Bean. If you are not familiar with the Bean you can take a look at it here, but promise to come back after you visited the Bean description.
The Story is similar, but I wanted to create something that is in the form factor of an Arduino UNO R3 and compatible with 5V. This will support all the Shields that are available and can be used with the MiKro 328 BLuE directly.
But you no longer need a PC or Mac to program it. I want to cut the USB cable and program the MiKro 328 BLuE using Bluetooth Low Energy (BLE). So I started to work on a prototype setup which is currently divided into two boards. An Arduino UNO Clone called MiKro 328 and the MiKro BLuE Shield. Both will be melted together once the new bootloader is finished and the PoC done. But at this time the boards are divided as you can see in the picture below:
Hardware wise the MiKro BLuE Shield is a BLE-Shield that can be updated OTA using an additional SPI flash which is necessary for the BLE112 since this bluetooth modules does not have enough memory compared to the BLE113-256 which does not need the external SPI. But here in this setup I need the external SPI flash, since it is shared between the BLE112 and the Atmega328.
And that’s finally the trick. I changed the OTA implementation in the BLE112 modules firmware to support OTA updates of the BLE112 but also use the mechanism to upload a compiled Arduino Sketch using the OTA mechanism to the SPI flash. In this case not the BLE112 bootloader is activated, but the BLE112 module resets the ATmega328 in order to start is bootloader to reflash itself. I’m currently working on the necessary bootloader changes on the hardware end.
On the software side a prototype version of an iPad IDE is already in the PoC state and finished. Compiling the Arduino Sketch is done in the MiKro Cloud. Compiling the code directly using an avr-gcc port should be technically feasible (Matthias Ringwald @mringwal already tried but encountered that there will be much more work involved to get it done, so we stopped it!) but there are some licensing issues with integrating the avr-gcc into an iOS app and finally Apple might reject such an app.
So my implementation is based on a simple Java Servlet implementation calling avr-gcc and some other command line tools necessary for the hex to bin conversion on the server. The “BLuE” called iPad IDE currently looks as illustrated the the screenshot below:
The IDE can currently deal with multiple sketches, compile and show the error in case of any, the size of the compiled bin file, search for MiKro 328 Boards, connect to them and upload the bin file into the SPI flash attached to the BLE112 module. Once the upload is finished, the BLE112 module resets the ATmega328 and dumps the content of the SPI Flash to the Arduino Console which is implemented to see if the bin file was received correctly. Not the only step that is missing is the changed bootloader. I think to get this done during february and need to optimize and melt the hardware design together from 2 boards to one as well as adding some other gimicks to the board such as a LiPo Charger and Boost converter to power the board using a LiPo. I really want to add a small LCD display but I don’t know yet if there is enough space left on the PCB.
Tell me what you think and what you would like to see on the final hardware regarding features etc.
Thanks for reading
Michael