Questions tagged [atmega]

ATmega is a product line within Atmel's AVR micro-controller family.

The official website can be found here.

761 questions
17
votes
8 answers

Arduino: Lightweight compression algorithm to store data in EEPROM

I want to store a large amount of data onto my Arduino with a ATmega168/ATmega328 microcontroller, but unfortunately there's only 256 KB / 512 KB of EEPROM storage. My idea is to make use of an compression algorithm to strip down the size. But…
RngTng
  • 1,221
  • 2
  • 12
  • 22
15
votes
5 answers

Testing Code for Embedded Application

Background: I am developing a largish project using at Atmel AVR atmega2560. This project contains a lot of hardware based functions (7 SPI devices, 2 I2C, 2 RS485 MODBUS ports, lots of Analogue and Digital I/O). I have developed "drivers" for all…
SRoe
  • 425
  • 4
  • 8
14
votes
4 answers

C - AVR - Simple PORTB, DDRB, PINB explanation

I am working on school project and need to learn the basics of C with a AVR atmega controller. I don't understand how everything is set up. For example PORTB, PORTD, DDRB; DDRD, PINB, PIND and stuff like that. And I don't know how everything works…
Mike_NotGuilty
  • 2,081
  • 4
  • 26
  • 57
14
votes
3 answers

Arduino Uno PWM pins conflict

I built this motor shield based on the L298N chip to control two motors of a tank. It uses pins 5 and 6 for one motor, and pins 10 and 11 for the other. While trying to add a TSOP 4838 in order to control the tank with an IR remote I noticed that…
binar
  • 1,177
  • 1
  • 11
  • 24
9
votes
2 answers

Pulse width modulation (PWM) on AVR Studio

I'm trying to use PWM for an LED on an ATmega8, any pin of port B. Setting up timers has been a annoying, and I don't know what to do with my OCR1A. Here's my code, and I'd love some feedback. I'm just trying to figure out how use PWM. I know the…
michaeljiz
  • 216
  • 1
  • 2
  • 10
9
votes
7 answers

ATMega328P "AVRDude: Could not find USBTiny Device (0x1781/0xc9f)"

Good afternoon, I recently assembled an ATMega328P based micro-controller PCB of my own design. I feel good about the circuit itself as I managed to upload the Arduino Blink sketch via the Sparkfun AVR Pocket Programmer. After uploading this sketch…
user3185748
  • 2,330
  • 8
  • 24
  • 41
8
votes
5 answers

Schrödinger bug disappearing when breakpoint is set

I have a strange bug in my code which disappears when I try to debug it. In my timer interrupt (always running system ticker) I have something like this: if (a && lot && of && conditions) { some_global_flag = 1; //…
vsz
  • 4,451
  • 6
  • 35
  • 69
8
votes
3 answers

Arduino/AVR ATmega microcontroller, random resets, jumps or variable/data corruption

I thought many programmers of Arduino/AVRs MCUs could share some of knowledge. My specific problem was this: In my case on an Atmel Atmega128 AVR. Based on ADC data I was running a loop which was doing some calculations into serial console, also…
John
  • 6,400
  • 2
  • 44
  • 49
8
votes
1 answer

Arduino Nano Timers

I want to know more about Arduino Nano timers. What timers are there? Do they produce interrupts? What code would attach an interrupt handler to them? How is delay() and delayMicroseconds() implemented... Do they use timer interrupts? (If so, how…
CL22
  • 13,696
  • 23
  • 83
  • 147
7
votes
4 answers

Is it bad if all variables are defined as volatile on AVR programming?

I read that in some cases (global variable, or while(variable), etc.) if the variables are not defined as volatile it may cause problems. Would it cause a problem if I define all variables as volatile?
Johan Elmander
  • 437
  • 1
  • 6
  • 10
7
votes
8 answers

what is the fastest algorithm for permutations of three condition?

Can anybody help me regarding quickest method for evaluating three conditions in minimum steps? I have three conditions and if any of the two comes out to be true,then whole expression becomes true else false. I have tried two methods: if…
shafeeq
  • 141
  • 3
  • 13
6
votes
1 answer

ATmega328 + SPI Flash Memory

Preface: This question is about a project I am working on with a professor at my university. It is NOT for a grade, but my reputation with this professor does matter. So while my success on this project is important to me, I do not see it as unfair…
NickHalden
  • 1,429
  • 2
  • 20
  • 30
6
votes
9 answers

Is a logical right shift by a power of 2 faster in AVR?

I would like to know if performing a logical right shift is faster when shifting by a power of 2 For example, is myUnsigned >> 4 any faster than myUnsigned >> 3 I appreciate that everyone's first response will be to tell me that one shouldn't…
Will
  • 79
  • 1
  • 3
6
votes
1 answer

Cannot compile and link AVR program in OS X

I am working on a Mac with Yosemite OS X and I'm trying to compile a program in C that I could then upload onto my Arduino. I am following a tutorial. I tried going through and reinstalling avr-gcc, but I got the same output. I tried searching for…
6
votes
6 answers

Advantages of atmega32

What are the advantages of using ATmega32 than other microcontrollers? Is it better than PIC, ARM, and 8051?
Komal
  • 85
  • 1
  • 2
  • 7
1
2 3
50 51