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
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
  • 2,024
  • 2
  • 15
  • 22
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
19
votes
7 answers

Fast Hypotenuse Algorithm for Embedded Processor?

Is there a clever/efficient algorithm for determining the hypotenuse of an angle (i.e. sqrt(a² + b²)), using fixed point math on an embedded processor without hardware multiply?
Tim
  • 4,790
  • 4
  • 33
  • 41
18
votes
2 answers

Why is reinterpret_cast not constexpr?

Consider the following snippet: static constexpr uint8_t a = 0; static constexpr const int8_t *b = reinterpret_cast(&a); This fails to compile with error: a reinterpret_cast is not a constant expression, because the C++ standard…
Conor Taylor
  • 2,998
  • 7
  • 37
  • 69
18
votes
8 answers

Protocols used to talk between an embedded CPU and a PC

I am building a small device with its own CPU (AVR Mega8) that is supposed to connect to a PC. Assuming that the physical connection and passing of bytes has been accomplished, what would be the best protocol to use on top of those bytes? The…
user3458
17
votes
5 answers

AT+CMGS returns ERROR

I am using SIM900 GSM module connect to my AVR Microcontroller. I tested it with FT232 to see transmitting data. First Micro sends AT it will response OK AT OK AT+CMGF=1 OK AT+CMGS="+9893XXXXXX" returns ERROR and doesn't show ">" Could anybody…
Mohammad Farahi
  • 1,006
  • 4
  • 14
  • 38
16
votes
8 answers

Atmel AVR Disassembler

Can somebody suggest me any disassembler for Atmel AVR 8-bit microcontrollers? There are opensource projects for this? Thanx.
Eugene Burtsev
  • 1,465
  • 4
  • 24
  • 45
16
votes
4 answers

Using Google 'Protocol Buffers' in Arduino

Is it possible to make Google Protocol Buffers work in Arduino? I have been trying for about a week and can't make it work, and I would like to know if it's even possible.
Manuel Araoz
  • 15,962
  • 24
  • 71
  • 95
14
votes
2 answers

Compilation gcc 4.6.2 (cannot compute suffix of object files)

Problem when compiling gcc 4.6.2: checking for avr-gcc... /data/data6/soft/src_build/gcc-4.6.2/host-x86_64-unknown-linux-gnu/gcc/xgcc -B/data/data6/soft/src_build/gcc-4.6.2/host-x86_64-unknown-linux-gnu/gcc/…
Alex T
  • 2,067
  • 4
  • 20
  • 27
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,253
  • 5
  • 32
  • 64
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,197
  • 1
  • 11
  • 24
14
votes
4 answers

Go port to the AVR architecture?

Ever since I heard about google's new language Go I wanted to use it for microcontroller programming. In particular Atmel AVR micro-controllers like the Atmega series. Is there a Go port for this architecture?
hacim
  • 281
  • 1
  • 3
  • 9
14
votes
5 answers

Is it possible to generate random numbers using physical sensors?

I've heard about people using light sensors, geiger counters, and other physical sensors to generate random numbers, but I'm skeptical. Is there really a way to generate random numbers from taking measurements of the physical world (using an…
Harlo Holmes
  • 5,145
  • 1
  • 23
  • 20
13
votes
2 answers

Is there a way to pass multiple values to macro function as single defined macro value in C?

I want to declare pin definition in global header as a simple line like: #define STATUS_LED B,7 Then I want to pass this pin definition to function above: CMBset_out(STATUS_LED); I don't know how to approach this - MY_PIN is in proper format to be…
bajtec
  • 145
  • 6
13
votes
1 answer

AVR 8bit, C standard compliance regarding bit accessing of SFRs

One of my colleagues ran in some strange problems with programming an ATMega, related to accessing input - output ports. Observing the problem after some research I concluded we should avoid accessing SFR's using operations which may compile to SBI…
Jubatian
  • 2,171
  • 16
  • 22