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:

2091 questions
203
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
  • 28,946
  • 26
  • 89
  • 125
80
votes
7 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
  • 985
  • 1
  • 8
  • 8
32
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,397
  • 5
  • 35
  • 53
27
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
  • 871
  • 2
  • 7
  • 22
26
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
  • 1,885
  • 3
  • 20
  • 39
25
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…
Lyndon White
  • 24,284
  • 15
  • 77
  • 126
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
  • 4,644
  • 4
  • 23
  • 26
23
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
  • 28,946
  • 26
  • 89
  • 125
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,531
  • 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
  • 767
  • 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
  • 493
  • 2
  • 5
  • 11
21
votes
6 answers

Faster 16bit multiplication algorithm for 8-bit MCU

I'm searching for an algorithm to multiply two integer numbers that is better than the one below. Do you have a good idea about that? (The MCU - AT Tiny 84/85 or similar - where this code runs has no mul/div operator) uint16_t umul16_(uint16_t a,…
Sir Jo Black
  • 1,800
  • 1
  • 13
  • 20
21
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
  • 123,990
  • 135
  • 275
  • 341
20
votes
3 answers

Using the Arduino libraries for regular AVR code

I have an Arduino Uno and a Linux environment. Though the Arduino IDE is great and all, however it doesn't give me much inputs if something goes wrong. And it also becomes excruciatingly slow and stops communicating with the chip sometimes. The…
Adwait Dongare
  • 301
  • 1
  • 3
  • 13
1
2 3
99 100