Questions tagged [avr]

AVR refers to two families of either 8- or 32-bit RISC microcontrollers

The AVR is a modified Harvard architecture 8-bit RISC single chip microcontroller which was developed by Atmel in 1996. The AVR was one of the first microcontroller families to use on-chip flash memory for program storage, as opposed to One-Time Programmable ROM, EPROM, or EEPROM used by other microcontrollers at the time.

External links:

2299 questions
0
votes
3 answers

Compiling an Assembly Program using avr

why do we need to initialize stack pointer in the begnning of the program of AVR assembly programming
0
votes
1 answer

AVR GCC local array initialization

I want to initialize local (const) array: void foo() { const uint8_t arr[] = {1, 2, 3, 4, 5}; } And for that initialization I pay 5 bytes of global RAM: those 5 constants are being copied to RAM at the start of the program and stay there…
Alex Cat
  • 21
  • 4
0
votes
1 answer

Good way around initializer element is not constant error in C?

Getting an initializer element is not constant compile error when using avr-gcc. Is there any good way to do what I'm trying to do here? file.c #include "file.h" #include "../notes/octave_two_notes.h" //F2 is defined in octave_two_notes.h //This…
kibowki
  • 4,206
  • 16
  • 48
  • 74
0
votes
1 answer

avra assembler -- pragma?

I would like to use a simple assembler compiler for AVR MCU under Linux. I generally don't prefer the full complete development environment for MCUs (like AtmelStudio under win). E.g.: I wrote a small C program under Linux to send bytes via parallel…
0
votes
2 answers

How is inline assembly possible on AVR 8-bit?

I know this fits close to the "stupid-question" category, but I've been researching how to execute machine code after bootloading on AVR 8-bit and have come to an understanding that the Harvard Architecture that is used on the AVR 8-bit MCUs makes…
JSON
  • 1,819
  • 20
  • 27
0
votes
2 answers

Saving graphic to EEPROM, compressing graphic by filter repeating 0x00 and 0xFF to save space

As part of firmware, I want to save a graphic or graphics into the EEPROM of a MCU. The space is not much, 1K, however it can save some program space. And yes you can seperate the glyphs of the graphic to save space however it is not easy to manage…
Codebeat
  • 6,501
  • 6
  • 57
  • 99
0
votes
1 answer

Ultrasonic sensor interfacing with AVR

I'm working on a project part of it to have some reads with ultrasonic sensor and send it with serial communication, i wrote code and it gives random reads and sometimes gives 0 as a read, is the formula i used for finding distance right !?, or…
0
votes
1 answer

How to limit the range of PWM duty-cycle values?

I'm having a hard time finding what I suspect is a pretty silly mistake in my code. I'm using an ATmega328. What I need is to generate a PWM signal whose duty cycle varies not between 0% and 100%, but between two other values. This is taken into…
Tendero
  • 1,136
  • 2
  • 19
  • 34
0
votes
2 answers

FatFs on AVR, are there strategies to maximize write speed?

Good evening, I am using an Atmega32 (2kB RAM) at 14.7456MHz to log data to a SD card via SPI that runs at ~1.5MHz. FatFs is set to FF_FS_TINY 0 (0 or 1 doesn't seem to influence the write speed as far as I could observe) The data I want to log…
Winter
  • 23
  • 4
0
votes
3 answers

AVR-GCC Linker: "Data"-Section overflows

I am using the Atmel AVR-GCC for compiling a project based on Atmel's Zigbee Bitcloud. On the Atmega256rfr2( 256k Flash, 32k RAM) After adding more code, I am approaching the limit of the memory (seems like it). I figured out, that if the linker…
LasseSte
  • 9
  • 3
0
votes
1 answer

AVR half duplex receiver interrupt error

I am attempting to implement half duplex UART with an ATTiny841. The idea of the code is that when I transmit anything but the character 'd' I receive nothing back and when I transmit the 'd' I get that letter back. After testing this out, with…
danieljimeneznz
  • 449
  • 6
  • 12
0
votes
1 answer

LowPower library: Powerdown (sleep) an ATMega32u4 works but wakeup doesn't happen

Situation: I made/developing this controller (with many functions) with use of a Pro Micro (ATMega32u4) and want to extend it with a wake-up functionality when touching it (with use of a touch sensor). This all to save some energy when not used. So…
Codebeat
  • 6,501
  • 6
  • 57
  • 99
0
votes
1 answer

AVR (debugging) PWM generation

I wrote a simple program to generate PWM wave with 50% duty cycle. Then I went for debugging in AtmelStudio. All registers except OCR0 were assigned there respective values. Why OCR0 not assigned any value. ATmega32, Fast PWM. #include…
Ganesh S
  • 21
  • 1
  • 4
0
votes
1 answer

Why isn't PWM signal coming out?

I'm doing a project for which I need two measurements from two different ADCs and two different PWM signals related to them. The values measured are stored in the variables freq and duty. As the names state, I want one PWM signal's frequency to vary…
Tendero
  • 1,136
  • 2
  • 19
  • 34
0
votes
1 answer

AVR: Help me understand assembly to HEX conversion

I am trying to understand a very simple assembly to hex conversion. This is the assembly code for AVR: Assembly Code ldi R17, 20 and corresponding Hex code :020000020000FC..:0200000014E109..:00000001FF.. Now this is how I add delimiters: …
user3891236
  • 607
  • 1
  • 9
  • 23
1 2 3
99
100