Tag Archives: ATMega8

This SD card logger library fits on an ATmega8

David Gironi has designed an SD card logger library – with log rotation – that neatly fits on an ATmega8 microcontroller (MCU). Precise date and time are obtained via a DS1307 chip.

“This library implements an SD card data logger that runs on [an] ATmega,” Gironi explained in a recent blog post.

“It has a small footprint, so it can be loaded on an ATmega8, leaving space for user code; [while also] supporting SD and microSD cards formatted with FAT16.”

According to Gironi, the “Petit FAT File System Module” by ChaN is used to facilitate write capabilities to the SD card.

“We had to format the card we would like to use with FAT16 and then load it with a predefined number of empty files of a know dimension,” Gironi continued.

“Once we have files on the card, we can write on those files. You can create empty files by using the python helper provided in code.”

Configuring file dimension and number is executed on the firmware side, although the file dimension cannot be greater than 2^16 bytes as a uint16_t type variable is used to store this information. Similarly, the max number of files is limited to 256, because a uint8_t variable is employed.

“Given the number of files used by the logger and every file size, we just have to record the last written position and the file number we are using to implements the log rotation,” added Gironi. “When a file is filled up with logged data, it skips to the next one, if the file is the last one, we go back to first.”

Interested in learning more? You can check out the project on David Gironi’s official page here.

Video: ATMega8 drives this brushless motor controller

A Maker by the name of Davide Gironi has designed a brushless motor controller powered by Atmel’s ATMega8.

As previously discussed on Bits & Pieces, the low-power sipping 8-bit AVR RISC-based microcontroller boasts 8KB of programmable flash memory, 1KB of SRAM, 512K EEPROM, and a 6 or 8 channel 10-bit A/D converter. The device also supports throughput of 16 MIPS at 16 MHz, while operating between 2.7-5.5 volts.

“Brushless motors have no brushes in them (duh). But what does that really mean? In order to spin the motor a very carefully crafted signal is sent through the motor coils in the stationary portion (called the stator), producing a magnetic field that pushes against permanent magnets in the rotor,” writes HackADay’s Mike Szczys.

“A big part of crafting that signal is knowing the position of the rotor. This is often accomplished with Hall Effect sensors, but can also be performed without them by measuring the back EMF in the coils not currently being driven. The AVR-GCC compatible library which Davide Gironi put together can be tweaked to work with either setup.”

You can find out more about Davide Gironi’s ATMega8-powered brushless motor controller on the project’s official page.