Questions tagged [avr]

AVR is a 8- and 32-bit microcontroller core developed by Atmel. AVR was chosen as microcontroller for the popular Arduino SBCs.

Filter by
Sorted by
Tagged with
56
votes
3answers
94k views

What is a boot loader, and how would I develop one?

I've met many projects in which an AVR microcontroller uses with a bootloader (such as the Arduino), but I don't understand the concept very well. How can I make a bootloader (for any microcontroller)...
49
votes
17answers
35k views

Complete alternatives to the Arduino IDE? [closed]

I'm not that big of a fan of the official Arduino IDE (in terms of visuals), so I've started looking for nicer alternatives. However, most of the projects I've found are in alpha/beta and are ...
41
votes
10answers
48k views

Why is AVR used in Arduino?

Why is Arduino using AVR? I understand that they are the official processor but there isn't a reason the code couldn't be ported to an ARM or a Freescale architecture other than cost, right? As long ...
36
votes
10answers
17k views

SPI or I2C: which to use for a longish bus

I'm contemplating a project that would require several AVRs talking to each other over a bus. They'd be separated by as much as 6 feet. It seems like both I2C and SPI can let a series of micros ...
34
votes
4answers
3k views

Who receives the value returned by main()?

I know that in computers, value returned by the main() function is received by the operating system. But, what happens in the ...
34
votes
1answer
7k views

Why does my AVR reset when I call wdt_disable() to try to turn the watchdog timer off?

I am having a problem where executing a disable watchdog sequence on an AVR ATtiny84A is actually resetting the chip even though the timer should have plenty of time left on it. This happens ...
31
votes
5answers
12k views

How do devices like the Game Boy Advance achieve their frame rate?

I've been designing my own handheld gaming device based around an AVR microcontroller and a small OLED display. I started off with a monochrome display 128x64 pixels and can comfortably draw to it at ...
30
votes
2answers
7k views

A PCB for a Drone

I'm making a drone, and would love if somebody can review my work on the PCB layout. Image (red is top, blue is bottom, circles indicate holes and side transfers purple is glue): What is supposed to ...
28
votes
6answers
2k views

Due to overcurrent, shouldn't I be extremely cautious when setting an I/O pin as Output?

The question can be applied to any microcontroller with I/O capabilities, but I’m currently working with the popular ATmega328p. Consider the following circuit: A simple SPST Normally Open switch with ...
26
votes
2answers
32k views

What is bit banging

I am new to microcontroller programming. I am using ATmega32-A controller and CodeVisionAVR compiler. I am using the waveform generator(AD9833) to generate a sinewave signal using SPI communication. I ...
25
votes
6answers
26k views

Why are Atmel AVRs so popular?

A recent question asked about the advantages/disadvantages of various types of MCU. AVRs seemed not even worth a mention given the answers. Why then does it seem to an outsider that AVRs are ...
23
votes
2answers
5k views

Firmware protection on AVR and PIC controllers

Can someone extract the HEX file that I burn in a microcontroller I provide them? If that is possible, how can someone ensure that their code is secured in embedded systems? In the case of PIC and ...
23
votes
3answers
9k views

Jtag debugging AVR

Can anyone advise what hardware and software is required for debugging AVR in circuit.
22
votes
3answers
29k views

AVR - How to program an AVR chip in Linux

I recently got an AVRISmkII AVR programmer, and I have an ATtiny85 and ATmega328. I was wondering how I could program these chips (with the programmer) but when I try getting Atmel Studio 6 it is only ...
21
votes
3answers
13k views

What are Atmel Fuses?

What are Fuses in Atmel microprocessors and when I should or need to change the default settings?
21
votes
8answers
7k views

Suggestions for small and handy connector for in-circuit programming?

I have many PCBs that use an AVR in SMD packaging, and since I frequently change the firmware in prototype boards, I'm trying to come with the best solution to program the AVR quickly and easily. The ...
20
votes
5answers
30k views

ATMega8: why do VCC and AVCC have to be connected?

I often read that it is good practice to connect VCC with AVCC. Even in the ATMega8 datasheet it says so: AVCC is the supply voltage pin for the A/D Converter, Port C (3..0), and ADC (7..6). It ...
20
votes
4answers
7k views

Crystals and load capacitance

If a crystal has a rated load capacitance of 6 pF, is the right thing to do to put a 6 pF capacitor to GND on either leg of the crystal? I'm using it as the clock source (TOSC) for an XMEGA and it's ...
18
votes
6answers
30k views

Using the ATMega328 with the internal oscillator?

I have a project that I think would be best suited for an ATMega328P. However, in every simple project I've seen, people always hook up a 16MHz external oscillator. From what I can see, it should have ...
18
votes
5answers
87k views

How do I read digital input on ATmega16?

What do I have to do to read a digital input (pushbutton) on ATmega16? Do I have to enable pullup-resistors or can I use a 10 kohm one? What would some simple code be be? Just a simple 'Turn the ...
18
votes
9answers
12k views

Ideal WiFi to Serial (or SPI) bridge?

What are some recommendations on an ideal WiFi to Serial bridge? My ideal qualities would be: Simple connectivity, SPI or Serial Reasonable fast speed, at least 1mbit/sec ideally (though probably ...
17
votes
3answers
19k views

Use AVR Watchdog like normal ISR

I'm trying to wrap my head around the watchdog timer on the ATTinyX5 series. So things I've read made it seem like you could use it for making the program do something specific ever N seconds but ...
17
votes
1answer
6k views

AVR 1.1V Internal ADC Reference Over-Voltage

If I use the internal 1.1V reference for the ADC, and my Analog input exceeds 1.1V, lets say 2.5V, is that harmful to my microcontroller? Or will ADC value simply clip (to 0x3FF) at 1.1V? For ...
16
votes
3answers
2k views

From C to Assembly

Suppose that we have the following piece of C code for an avr-8bit: int v1=1; int v2=2; v2=v2+v1; I expected the following disassemble ...
16
votes
4answers
12k views

Is it possible to use AVR ISP programmer to program a PIC chip?

I want to try programming a PIC chip and just see, how much different it is compared to an AVR. I've got an AVRtinyISP and would like to know, if it would be possible to use that to program a PIC chip ...
15
votes
2answers
1k views

Why would the VCC/GND pins of an ATtiny26 not be aligned?

In the following pinout diagram for an ATtiny26 microcontroller, a 20-pin IC: The VCC/AVCC and GND pins aren't aligned. Surely it would be easier for PCB design to connect these by going straight ...
15
votes
2answers
21k views

What values of resistor and capacitor to use for AVR reset pin isolation?

Background... I'm a newbie to AVR applications. I recently built two ATTINY13-based circuits (glorified LED blinkers) which worked correctly (independently) on the breadboard. When I combined them on ...
15
votes
2answers
34k views

Protecting AVR flash from reading through ISP?

I'm trying to protect whole flash from reading through ISP. It has bootloader, able to self program application section. Setting lock byte to: LB1/LB2 will not ...
14
votes
3answers
3k views

C Integer Promotion on 8-bit MCUs

Using avr-gcc as an example, int types are specified to be 16-bits wide. Performing operations on 8-bit operands in C results in those operands being converted to 16-bit int types due to integer ...
14
votes
1answer
1k views

How can V-USB screw up the built-in SPI of an ATmega328p?

I'm working on a V-USB project that shows up as a Keyboard using an ATmega328p. The USB part is working great (it's not my first V-USB project), but after I start the V-USB stack with ...
13
votes
3answers
976 views

Non-manufacturer microcontroller selection site?

I'm looking for a site which I can input my desired micro-controller characteristics. I have found the manufacturer websites...but those will only show their micro-controllers. I.E. there's a site ...
13
votes
3answers
5k views

Switching from PIC to AVR [closed]

I have worked with PIC16 and PIC18s for over three years now and would like to get to know AVR as well. I have no specific project in mind, but would like to try around with the different ...
13
votes
4answers
5k views

Waking Up From Deep Sleep Modes

Most microcontrollers (e.g. AVRs,MSP430s, PICs, etc) support a number of different sleep modes. The "deepest" sleep mode is the one that purports the lowest power draw (e.g. "Power Down", "Shut Down"),...
13
votes
4answers
2k views

AVR SEI instruction

The AVR SEI instruction (http://www.atmel.com/webdoc/avrassembler/avrassembler.wb_SEI.html) waits for the next instruction to finish before enabling interrupts. If I use another instruction to set ...
13
votes
2answers
2k views

Hobby oscilloscope based on AVR. How to remove op-amp noise?

I'm building a hobby oscilloscope on an ATmega16 microcontroller. The main problem is that I receive a large amount of noise while measuring the signal. I used LF353 amplifiers to shift voltage and I ...
12
votes
5answers
5k views

“Overclocking” an AVR

In AVR datasheets under the Electrical Characteristics section you will typically find a graph like this (this one is from the ATMega328): I've seen designs that seem to "work" but operate outside ...
12
votes
3answers
3k views

Is it safe to abruptly remove Arduino power? [closed]

If I have an Arduino, can I abruptly turn the power on and off without corrupting it? If I am designing a product that has an on/off switch, do I need to incorporate a delay before turning off the ...
12
votes
6answers
2k views

Critique on my first schematic?

To practise designing schematics (and possibly making it too), I have designed a simple AVR based blinker assuming it is already preprogrammed. The schematic is here: I've seen many Atmega/arduino ...
12
votes
10answers
7k views

Efficient inverse (1/x) for AVR

I'm trying to find an efficient way of calculating an inverse on an AVR (or approximating it). I'm trying to calculate the pulse period for a stepper motor so that I can vary the speed linearly. The ...
12
votes
7answers
7k views

AVR Random Number Generator

I've read an appnote from TI (slaa338) that describes a technique for generating "for real" (as opposed to "pseudo") random numbers. It exploits the somewhat exotic clock subsystem of the MSP430 to ...
12
votes
2answers
2k views

How fast is 1 MHz?

How fast is 1 MHz in an AVR microcontroller? Is it actually 1,000,000 Hz or is it 1,048,576 Hz (1,024 Hz * 1,024)?
12
votes
3answers
2k views

Monitoring voltage without a known reference

I'm working on a little sensor platform that runs off of batteries. I'd love to be able to trigger an alert when the voltage gets too low. The problem is that anything I use to measure that voltage ...
12
votes
4answers
2k views

How does the Harvard architecture help?

I was reading about arduino and the AVR architecture and got stuck at the point that how does pipeline stall or bubbling is solved by Harvard architecture introduction in the AVR.I mean what Harvard ...
12
votes
8answers
24k views

Arduino With Assembly?

Since for my venture into Microprocessing I decided to go with Atmel AVR due to the vast resources available. And Arduino seems to has alot as well, not to mention their starter kits seem more "at my ...
12
votes
3answers
6k views

How do I plan for in circuit programming of an AVR?

My usual method of reprogramming AVRs (so-far limited to ATtiny13 and ATtiny2313) is to disconnect the chip from the host circuit, plug it into another breadboard with all of the ICSP hookups in place,...
12
votes
2answers
8k views

Connecting ethernet to AVR

I am getting pretty familiar with microcontrollers and now want to connect it to the internet. What are the minimum requirements for a microcontroller to be able to do this, specifically, an AVR one ...
12
votes
4answers
2k views

Anyone ported the QP state framework for Arduino?

In reviewing possible approaches for my data logging project, I have found the book "Practical UML statecharts in C/C++" to be very interesting for more serious work with the Arduino. QP is a family ...
12
votes
2answers
2k views

Are my theoretical power consumptions of this avr correct?

After being inspired by a simple ATMEGA 168 based darkness alarm that has a theoretical life span of 3 years on batteries utilising sleep mode, I had decided to make something similar of my own (a ...
11
votes
5answers
2k views

Designing circuits with a longer lifetime

I have learned about the pic microcontroler for a period of time and have a reasonable amount of knowledge about handling digital electronics. I have worked on basic electronic projects and now I need ...
11
votes
10answers
9k views

Linux / Mac AVR Programming Suite?

I have been coding and using Arduinos for quite some time now. However I am ready to move up to using straight AVR chips without the arduino bootloader. My question is what are resources to do this? ...