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
224
votes
20 answers

How can I unit test Arduino code?

I'd like to be able to unit test my Arduino code. Ideally, I would be able to run any tests without having to upload the code to the Arduino. What tools or libraries can help me with this? There is an Arduino emulator in development which could be…
Matthew Murdoch
  • 30,874
  • 30
  • 96
  • 127
97
votes
9 answers

Difference between uint8_t, uint_fast8_t and uint_least8_t

The C99 standard introduces the following datatypes. The documentation can be found here for the AVR stdint library. uint8_t means it's an 8-bit unsigned type. uint_fast8_t means it's the fastest unsigned int with at least 8 bits. uint_least8_t…
mic
  • 1,165
  • 1
  • 9
  • 8
38
votes
2 answers

Mixing C and assembly sources and build with cmake

I'm using eclipse for building a avr-gcc project that mixes assembly code and C source files. I want to get rid of the automatic makefile generation of eclipse because I need to automate some process into the makefiles and for other reasons. I used…
andyinno
  • 1,021
  • 2
  • 9
  • 24
36
votes
2 answers

What happens when an ISR is running and another interrupt happens?

What happens if an ISR is running, and another interrupt occurs? Does the first interrupt get interrupted? Will the second interrupt get ignored? Or will it fire when the first ISR is done? EDIT I forgot to include it in the question (but I included…
BenjiWiebe
  • 2,116
  • 5
  • 22
  • 41
33
votes
3 answers

C Macro - how to get an integer value into a string literal

Is it possible to get the value of a #defined integer symbol to be inserted verbatim into a string literal that is part of an assembly section in GCC (AVR Studio)? I want the "LEDS" to be replaced by 48 within the string literal inside the asm()…
user5069935
30
votes
2 answers

Arduino Bootloader

Can someone please explain how the Arduino bootloader works? I'm not looking for a high level answer here, I've read the code and I get the gist of it. There's a bunch of protocol interaction that happens between the Arduino IDE and the bootloader…
vicatcu
  • 5,407
  • 7
  • 41
  • 65
26
votes
6 answers

8 bit enum, in C

I have to store instructions, commands that I will be receiving via serial. The commands will be 8 bits long. I need to preserve transparency between command name, and its value. So as to avoid having to translate an 8-bit number received in serial…
Frames Catherine White
  • 27,368
  • 21
  • 87
  • 137
25
votes
4 answers

Undefined reference to 'operator delete(void*)'

I'm new to C++ programming, but have been working in C and Java for a long time. I'm trying to do an interface-like hierarchy in some serial protocol I'm working on, and keep getting the error: Undefined reference to 'operator delete(void*)' The…
Bracket
  • 432
  • 1
  • 4
  • 9
24
votes
8 answers

How can I visualise the memory (SRAM) usage of an AVR program?

I have encountered a problem in a C program running on an AVR microcontroller (ATMega328P). I believe it is due to a stack/heap collision but I'd like to be able to confirm this. Is there any way I can visualise SRAM usage by the stack and the…
Matthew Murdoch
  • 30,874
  • 30
  • 96
  • 127
24
votes
21 answers

Best platform for learning embedded programming?

I'm looking to learn about embedded programming (in C mainly, but I hope to brush up on my ASM as well) and I was wondering what the best platform would be. I have some experience in using Atmel AVR's and programming them with the stk500 and found…
mdec
  • 5,122
  • 4
  • 25
  • 26
24
votes
9 answers

how bad is it to use dynamic datastuctures on an embedded system?

So in an embedded systems unit, that i'm taking at uni next year, we will learn that dynamic data structures are a bad thing to have in an embedded system program. but the lecture notes don't go into why. Now i'm working on a moderate scale,…
Frames Catherine White
  • 27,368
  • 21
  • 87
  • 137
23
votes
4 answers

Parse double precision IEEE floating-point on a C compiler with no double precision type

I am working with an 8-bit AVR chip. There is no data type for a 64-bit double (double just maps to the 32-bit float). However, I will be receiving 64-bit doubles over Serial and need to output 64-bit doubles over Serial. How can I convert the…
baalexander
  • 2,579
  • 1
  • 25
  • 32
23
votes
5 answers

AVRISP MKII doesn't work with AVRDUDE on Linux

The system sees something is plugged in when I plug and unplug it: bluehat@Matapan:/dev$ tail -f /var/log/syslog Mar 23 15:36:35 Matapan kernel: [156082.112874] usb 7-1: new full speed USB device using uhci_hcd and address 6 Mar 23 15:47:19 Matapan…
Katy Levinson
  • 777
  • 1
  • 6
  • 15
23
votes
10 answers

USB programming

I want to program a microcontroller (AVR) to control some leds through USB. It's just out of interest in how to build and program USB devices. There are some AVR microcontrollers that support the USB protocol or I could implement the USB protocol in…
EDWH
  • 491
  • 2
  • 5
  • 11
22
votes
5 answers

What's the difference/relationship between AVR and Arduino?

I've been interested in hardware programming recently, but I have not started yet. I did some searching working, and have a vague idea: Arduino is a combination of both chip and breadboard. AVR is a single chip, and need to buy a breadboard to…
omg
  • 136,412
  • 142
  • 288
  • 348
1
2 3
99 100