Elastic Sheep

Because elasticdog was already taken

Elastic Sheep header image 4

Entries Tagged as 'atmega168'

Reading an SD card with an ATMEGA168

January 12th, 2010 · 35 Comments · Uncategorized

In this small week-end project, I will connect a SD card to an ATMEGA168 and try to read data from it. The SD card pin-out The SD card can be talked to with three different transfer modes: 1-bit SD mode, 4-bit SD mode and SPI mode. According to Wikipedia, all cards must support all three [...]

[


Software reset of an ATMEGA168

December 30th, 2009 · No Comments · Uncategorized

Could be useful sometime in the future: http://wiblocks.luciani.org/docs/app-notes/software-reset.html #include <avr/wdt.h>   void reboot() { wdt_disable(); wdt_enable(WDTO_15MS); while (1) {} } The watchdog is enabled with the minimum time-out of 15ms. Then a system reset is triggered when the time-out is reached. Note: the reset source can be determined at boot time by reading the MCUSR [...]

[


Testing the serial interface and the GPS

November 3rd, 2009 · 4 Comments · Project Wiggum

In this post I will connect my EM-406A GPS module to the prototype and write some code to test the sending and reception of serial data. Connecting the GPS I already wrote about the connection of the EM-406A GPS module to an ATMEGA168 and Teensy AT90USB162 in this post and this post. I will use [...]

[


Driving a buzzer

October 12th, 2009 · No Comments · Project Wiggum

In this post I will add a buzzer to my prototype and show two ways to test it, first by bit-banging a pin then by using a hardware counter. Connecting the buzzer I am using a CEM-1203 magnetic buzzer (datasheet). This buzzer has peak frequency responses at 400Hz, 800Hz, 2kHz and 4kHz. To connect it [...]

[


Adding switches

October 5th, 2009 · 1 Comment · Project Wiggum

In this post I will add two switches to control the selection of one led among six. One of the button will increase the selection, the other one will decrease it. Connecting the switches I connect the switches on the PC0 and PC1 inputs and on the ground. I don’t need any external pull-up resistor [...]

[