Thursday, July 12, 2018

AVR EEPROM Library | ATmega328P

Sometimes some data needs to be saved after the microcontroller is powered off. Say you have a rotary encoder to set audio volume. When the user sets the volume, the value is stored in SRAM but when the power goes off, the memory content is lost. In this cases you would use the EEPROM memory to store data. AVR devices have three types of memory:
  • Flash memory - for the program code
  • SRAM memory - also referred as data memory (volatile memory)
  • EEPROM memory


EEPROM stands for Electronically Erasable Read-Only Memory and is a non-volatile memory, meaning that unlike RAM, it will hold the stored information even after power is removed, much like an USB flash drive. Here can be stored settings and data that can not be hard coded, usually taken by the interaction with a user. Keep in mind that the EEPROM has a lifespan of 100,000 writes - reads are unlimited - so is not a good idea to write to this memory every second or even every few seconds.

Normally, to make use of the EEPROM memory, you would have to read the datasheet and implement some read/write functions using some registers. But fear not - the AVR-GCC compiler comes with prebuilt routines making things much easier.

Friday, July 6, 2018

How to tin your PCB using plumber's paste | Homemade PCB

The last step in making your own printed circuit board (PCB) is tinning. Tinning is important because copper oxidize very fast, leading to an ugly look, hard to solder pads and over longer time, breaks in traces.

When you order PCB's from a manufacturer, the pads look all nice a shiny. I was looking for a way to achieve this at home and I found one. It doesn't involve strong chemicals, it's cheap and it only takes a few minutes.


Example of homemade PCB tinning
Example of homemade PCB tinning

DIY PCB tinning at home using plumber's paste
PCB after tinning

PCB before tinning