English French German Italian Portuguese Russian Spanish

v1

Survey

Which microcontroller family do you prefer?
 

Did you know?

In 1957 a battery was discovered in Bagdad. It was made by the Parthians, who ruled Bagdad from 250 B.C.E. to 224 C.E., and was used to electroplate silver.

Forum elektronika, schematy, porady, naprawa

FacebookTwitter

 

Home > AVR tutorial
(1 vote, average 5.00 out of 5)
I/O pins

push button debouncing exampleThis article will use one digital input pin (PortA pin 3) to readout state of push-button connected to it. Pull-up resistor must be connected to this pin to differentiate voltage on pin when push-button is pressed and when it is released. In short period of time when push-button is pressed, voltage on input pin connected to is very noisy and this can make problems. This is shown on picture on left side. Microcontroller would interpret this as multiple push-button pressing and releasing. To eliminate this we use debouncing.


Read more...

 
(1 vote, average 5.00 out of 5)
AVR external interrupts

INT0 taster AVRWhen reading pin state it is often needed to react very fast on pin state change.
For this purpose external interrupt is used. External interrupt occurs when dedicated pin changes state. It can be triggered on rising, falling, or both edges of signal state. In this example we will use external interrupt  of AVR microcontroller INT0.  




Read more...

 
(1 vote, average 5.00 out of 5)
AVR PWM

pwmUsing PWM with microcontroller is often needed in projects. Whether you want fine control of electromotor speed, or you want to change intensity of LED lamp or you simply need analog output and do not want to buy expensive Digital/Analog converter (DAC), PWM is ideal solution. In this example we will show how to configure and change parameters of PWM output on AVR microcontroller.



Read more...

 
(1 vote, average 5.00 out of 5)
AVR Analog/Digital converter ADC

AVR ADC inputsWhen interfacing microcontroller to outside world we often need to make Analog/Digital conversions (ADC). In this example, we will make 5 ADC inputs scanning that is driven by interrupt. Data are placed in results buffer and sent to UART by using functions for conversion of integer value to string.


Read more...