USART, FreeRTOS and C++ on nRF51

Now that we have set up the programming environment the next thing I personally like to implement on any microcontroller is a simple UART communication. Since it is really simple to do using nRF51 SDK, I thought of explaining how to implement USART and FreeRTOS in C++. Even though C is a very capable language on its own I feel restricted without OOP, I know some people might disagree but personally OOP enables me to structure my code better and is easier to pick it up after couple months of idle time. Nonetheless, this article won’t cover FreeRTOS in details; it is expected from you to know more or less what is an RTOS and what is it capable of. Also I prefer not to use printf/scanf whenever I can in embedded projects due to its large memory footprint. Since we will have the luxury of C++ we will implement a similar “Serial” library to Arduino. Honestly serial library is one of the things people behind Arduino got right.


Continue reading...

Starting with nRF51 BLE and Qt Creator

Recently I came across an interesting little ARM Cortex M0 microcontroller nrf51822, which has an integrated low energy Bluetooth (BLE)  and overall is a very capable to do other tasks besides BLE especially due to its immense FLASH memory  and RAM which is 256kb and 32kb accordingly (varies between models).  Immediately I thought of trying to make a simple smart-watch for various reasons like low energy mode, which I think was 0.1µA in sleep mode.  Only drawback compared to other ARM Cortex series microcontrollers is that it’s not really the fastest in the market, however a new one will be coming soon by first quarter of 2016, which will be more efficient, faster and overall more capable SOC. Luckily for us, their SDKs are pretty much identical, and once you learn and understand how nrf51 series SDK is structured and how to use it then switching to nrf52 shouldn’t be a problem. In any case I bought the development board BLE400 which is pictured above to play around; nonetheless I highly recommend buying the original nrf51-DK board just to support Nordic for developing an awesome micro.


Continue reading...

Touch gesture recognition using body capacitance

Main board

For my final year project, I tried to replicate and possibly improve the Disney's touche device using much cheaper components than they did. It was a partial success, but a great learning experience nontheless. These days most touch sensitive devices are designed either to recognize where it has been touched or whether is touched or not. Many objects around us in everyday life can be potentially used as touch interactive surface providing they are made out of conductive material. With the conventional way it would only be possible to detect whether the object has been touched or not. However, by exciting the object with different frequencies it is possible to detect how much skin is touching it. Essentially the system could recognize whether the object is grabbed, pinched, touched by one or more fingers or any other gesture which have different amount of skin touching it. There are many surfaces, objects and liquids which can be transformed into touch sensitive devices without additional buttons or touchscreens like door handles, mobile phones, lamps, desks, walls etc. 


Continue reading...



Introduction to data encryption

With the recent personal data leaks regarding celebrities, I noticed that I’ve some data on my cloud storage which should have an extra layer of protection. And NO, I don’t have any private pictures, but a document or two with some very sensitive data. You never know when you might be a victim of phishing or from a weak password. In any case, I decided to investigate some encryption algorithms. More precisely, XOR cipher, Feistel cipher and blowfish. In this article I’ll try to give some guidelines regarding these ciphers and example implementation in C++ with Qt. This article should be structured and written in a way, if you don’t know anything about cryptography, at the end you should understand most of the basic underlying theories. Also each algorithm will be introduced in a sequence where the next algorithm described will reference to previous one. Note that the intention of this article is to explain how to use them, rather than analyze their security etc. 


Continue reading...

MEMS (Part 2) – Guide to using gyroscope L3G4200D

Gyro

Taken from wikipedia

 

For most of the people probably the next step in the world of MEMS is to interface gyroscope. Most likely use gyroscope data to fuse with accelerometer data. If you have implanted acc before, you’ll know that acc is very responsive and noisy when it comes to measuring pitch and roll. It is possible to smooth out the data via sensor fusion. In this tutorial I will explain what data we will be getting from gyroscope, how to use the data to calculate pitch, roll and yaw and finally how to fuse sensor data with complimentary filter.


Continue reading...

MEMS (Part 1) - Guide to using accelerometer ADXL345

Acceloremeter

Recently I’ve been playing with cheap GY-80 module, more precisely 10DOF module with accelerometer, gyroscope, magnetometer and barometer.  Eventually I’ll write how to use all four of them. I’ll start with accelerometer (accel). This guide could potentially be used for interfacing most of the MEMS accels, and definitely as a guide how to interpret data coming from the accel, not only from MEMS but also how to use the data coming from Smartphone, wiimote etc. They are basically the same thing. However, I won’t be describing features as tap sensing and double tap sensing, this will be only an introduction about the raw accelerometer.


Continue reading...

Programming micro-controller (Arduino) with cheap HC-06 Bluetooth

I and my friend Zenios Agapiou thought of constructing a simple two wheel balancer robot. At the beginning we thought we will just program our Atmega88pa micro-controller through standard JTAG. However, we quickly realized we have Bluetooth connected to the RX/TX device, so we thought whether we can upload Arduino bootloader to the atmega and program it wirelessly.  However it wasn’t that simple as we initially anticipated.



Continue reading...



QHotkey

 

QHotkey logo

QHotkey is simple application for changing the MS Windows volume with your prefered keys. Also it will show nice popup with the current level of volume.

Basically, I had problems with my laptops hotkey application, it has a very long response time which renders the volume keys and all the other function keys unusable. So I decided to make QHotkey, so at least I can change volume as quick as possible. There were already some solutions available, but I found them either not looking as good as I want to or lacking key customization.

 


Continue reading...

Guide to Xmega USART aka. Serial communication

data brain

Most of my projects involves having some sort of communication between PC and my micro. Either useful data is being transmitted between those two, or just for the sake of debugging, since I don't have any of the high end AVR debugging tools. Whatever reason, serial communication is always useful and I view it as a must have and very important module of any micro. In this article I'll be describing how to set up serial communication with XMEGA, also how to use standard printf and scanf functions in your C and C++ code. I won't be explaining what is a USART, I expect you to already be comfortable with the theory behind it and I'll leave out interrupts.


Continue reading...

Configuring xmega system clock

quartz crystal

For me, one of the first things I wanted to test is how to setup the system clock. In this tutorial I'll be explaining how to set up external oscillator from 8-16Mhz and how to set up the xmega to use internal 32MHz clock. I think, by providing instructions for these two types of system clocks, anyone should be able to understand the logic behind the datasheet and set up whichever clock he/she wants.


Continue reading...

Favourite quote:

"We live in a society exquisitely dependent on science and technology, in which hardly anyone knows anything about science and technology."

Carl Sagan


RockTube
  RockTube


  EEWeb

Electrical Engineering Community


Top 10 articles



© Raivis Strogonovs, 2009 - 2016