Questions tagged [atmega]

ATmega is a family in the AVR series of Atmel microcontrollers. It is the main microcontroller of the Arduino prototyping platform. Please specify the specific part number in your question.

The ATmegas are 8-bit RISC microcontrollers using a Harvard architecture. They have 4 to 256 kB program memory. Like all Atmel AVR microcontrollers, they are supported by various (open) toolchains. Most s are based on an chip.

They are the bigger brother of the microcontrollers, and have more memory and features.

Further reading:

related tags:

1265 questions
57
votes
7 answers

How can I get my atmega328 to run for a year on batteries?

Scenario I have created a nice electronic door lock for my dorm room. It is currently an Arduino Diecimila with a servo [un]locking the door. It has a numerical keypad with 3x4 buttons and 5 LED's (2 serie pairs and one single LED). It also…
Pangolin
  • 1,045
  • 4
  • 13
  • 19
41
votes
7 answers

What happens if I omit the pullup resistors on I2C lines?

Just now I realized that the I2C data and clock lines (SDA and SCL) must have pullup resistors. Well, I've built a couple of clocks using the DS1307 RTC (see datasheet) according to the schematic below. Notice that I have omitted both pullup…
Ricardo
  • 6,134
  • 19
  • 52
  • 85
26
votes
6 answers

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 should be externally connected to VCC, even if the …
Peter
  • 385
  • 1
  • 4
  • 5
26
votes
6 answers

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 an 8MHz internal oscillator. My project doesn't…
Earlz
  • 3,346
  • 15
  • 46
  • 66
18
votes
5 answers

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 LED on when it's pressed thing'. Is there a beginner's…
curious
  • 181
  • 1
  • 1
  • 3
17
votes
9 answers

Reading a huge number of analog sensors in real time

I'm trying to build a MIDI-like controller that has a neck like a guitar. On that neck, there is a huge matrix of pressure sensors. The controller will emulate 3 strings. The way this works is: There are 3 long strips of double sided copper tape…
d.oelert
  • 319
  • 2
  • 7
15
votes
2 answers

How can I use my SMD Arduino to program a separate DIP ATmega328?

I have an arduino with a surface mounted (SMD) microcontroller: I know how to use a DIP arduino as a programmer for a DIP ATmega328. It's easy --you just pop your microcontroller in the holder. However, with a surface-mount Arduino, there's no…
Manishearth
  • 2,882
  • 2
  • 22
  • 32
15
votes
2 answers

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 let user to use bootloader to upload new firmware. BLB12/BLB11 and BLB01&BLB02 will…
Pablo
  • 1,551
  • 3
  • 20
  • 41
14
votes
3 answers

What is the minimal set of parts for a circut with this AVR microcontroller?

My Arduino Uno has a ATMEGA328P-PU microcontroller, and bunch of other stuff on the board. I'd like to program the chip without the Arduino software, and only the minimum of other components. I want to eventually create things without the cost of…
Rob N
  • 1,025
  • 4
  • 12
  • 18
14
votes
1 answer

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 usbInit(), all calls to the SD card library fail. If I call the…
dnet
  • 241
  • 1
  • 4
14
votes
3 answers

Driving DC motors with MOSFETs and a microcontroller?

I'm developing a nano quadcopter using an Atmega328 microcontroller, powered at 3.3V, and very small brushed DC motors. The average current used by these motors is about 800mA @ 3.7V. Initially, to drive them, I used an L293D motor driver but this…
supergiox
  • 193
  • 1
  • 1
  • 7
12
votes
1 answer

How should one switch from using an Arduino as a programmer to an external programmer?

Part two of a three part series on transitioning from Arduino to a plain AVR microcontroller and minimum supporting components (part one, part three) I've seen a lot of people ask this on the Internet, so here goes: I already know how to program…
Manishearth
  • 2,882
  • 2
  • 22
  • 32
12
votes
1 answer

TQFP and VQFN on same footprint: good idea or bad?

In order to ease supply issues, I am considering an overlapping footprint for the TQFP-32 and VQFN-32 packages of ATmega48/88/168/328 CPUs. The two packages have the same pinout. It's a commercial project, likely to make a few thousand units over a…
jonathanjo
  • 12,049
  • 3
  • 27
  • 60
12
votes
2 answers

Do the new "PB" variants of ATmega have a bug in the brown-out detector?

We've been using ATmega48/88/168/328 microcontrollers successfully for many years in many of our products. We have now considered to switch from the A and PA variants to the new PB variant (because we will need the extra pins, timers and UARTs in…
vsz
  • 2,554
  • 1
  • 17
  • 32
12
votes
2 answers

How do you determine if a new microcontroller is defective?

I've never dealt with parts being defective strait from digikey, but 3 new Atmel ATmega164A's that I've received have been exhibiting extremely odd behaviour. I narrowed it down to something to do with the clock and it turned out that the resulting…
Jon L
  • 4,258
  • 1
  • 22
  • 33
1
2 3
84 85