Showing posts with label AVR. Show all posts
Showing posts with label AVR. Show all posts

Sunday, September 28, 2014

nokia 5110 LCD display AVR


Now i will write about nokia 5110 display.

Saturday, September 27, 2014

Working with LCD display on HD44780 AVR

If you need only ready to use library, you can get it here.

Datasheet


I ordered display from ebay, 2 lines by 16 symbols.


How to work with AVR MC pins and their additional functions

I will write an overview about different AVR ATmega8 pins and show some coe examples for working with tem.


Tuesday, August 19, 2014

How to work with Sharp Infrared sensor

I already wrote how to work with ADC In this article.



( In the simplest case ) Infrared Proximity Sensor - Sharp has 3 output pins: Vcc - Power, GND - Ground and Vo - Data. Depending on the distance varies the voltage at the output Vo, all that left is transform that data to digital information.




AVR Tutorial - ADC (Analog to Digital Converter)

ADC as you can guess converts analog voltage to digital number, so we could work with it in microcontroller. We can build simple ADC with comparator, it's a device which compares 2 signals (1 of them is some constant reference voltage) gives one otput if 1 signal is bigger and other if smaller.

ADC accuracy depends on it's resolution. e.g. if we have reference voltage = 5 V and our ADC is 10-bit, then on every bit we have 5 / ( 2^10 - 1 ) = 0.00489 or 5 mV, so we can't measure changes less than 5 mV.

Monday, August 18, 2014

Playing music on AVR with PWM

At first I tried to write code myself, but I failed many times.
So i searched for a working project and found it, AVR is using PWM and simple Piezo Buzzer.

Code taken from aquaticus.info
Sources on Github

Sunday, August 17, 2014

AVR Tutorial - PWM Signal Generation using Timers


In AVR microcontrollers PWM is implemented in hardware, all that left is configure it, by setting required bits in timer registers.

Saturday, August 16, 2014

AVR Tutorial - Introduction to Timers

Avr microcontrollers have several timers (counters). They can be 8 bit (max == 2^8 = 256), or 16 bit (max == 2^16 = 65536).


  • Timers can count with different speeds and compute ticks
  • Count from external oscillators
  • With them we can compute time and time intervals (accuracy more than 0.5%)
  • Generate ADC signals.
  • Generate interrupts.

Friday, August 15, 2014

Servomotors practise, Servo Motor Control using AVR ATmega8

I had bought some chinese servomotors and decided to make a laser toy for my cat.



AVR library for HD44780


Creator's site
Library itself.
I will show some code explaining how to work with this library.

Saturday, July 26, 2014

AVR Tutorial - Fuses

Fuses are bits which you can programm to change some settings of your microcontroller, like frequency, start up time etc.

It's better to always check datasheet before changing them, they can differ from MC to MC.

Atmel uses this notation: 0 = ON, 1 = OFF, that's the way the write their datasheets, also different programms for loading .hex in MC use different notation.

Saturday, July 19, 2014

How to program the AVR microcontroller with USBASP

I will write how to programm ATmega32 with "Khazama AVR Programmer" and "USBASP"
USBASP - it's a programmer which you can build yourself or buy (3$ on ebay).
Drivers and additional information available on the creator site


Khazama AVR Programmer - it's a programm which uploads .hex file in microcontroller.