We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [avr]

AVR is the family of microcontrollers used in Arduino boards.

Filter by
Sorted by
Tagged with
2
votes
1answer
189 views

In UART, what mechanism sets the “new data received” flag back to 0?

I was reading documentation on UART on AVR and it looks simple: when a flag (bit RXC0 of register UCSR0A) is set to 1, it means the micro controller has new data for you, and you read this from ...
3
votes
2answers
2k views

AVR - How to know that there is collision between stack and heap or the memory has filled?

I am using the dynamic memory in AVR microcontroller, so How to know that there is collision between stack and heap or if the memory has been filled?
3
votes
2answers
6k views

How to program AVR in Mac OS X?

In our college we are using a module developed by IIT Bombay (called FIREBIRD V[ver 5]). It has ATmega2560 and ATmega8 microcontrollers (master and slave) with bootloader. The staff uses AVR Studio ...
2
votes
0answers
92 views

SPI Interface between Arduino UNO and EVK1100 [closed]

I'm using Arduino Uno board as master and AVR32UC3A0512 as slave. I've written code for arduino using SPI.h library, and Atmel Studio 6.2 using spi.h. I'm sending data from arduino to atmel i.e from ...
2
votes
1answer
658 views

Why does my Arduino keep waking up?

This is my first post. Please excuse me if this is a repost, but I couldn't find a similar question via search. I have some experience with Arduino and I'm looking to utilize AVR's sleep mode in a ...
0
votes
3answers
613 views

How to check if a pin is set from bank?

How would you go about checking if an input pin has been set using the entire bank? I am thinking that I need to use bit twiddling with a bit mask but I have not used this enough to figure out how to ...
2
votes
2answers
915 views

Burning arduino generate hex file to blank atmel chip

Is it possible to burn the hex file to a blank chip, generated by Arduino to burn using USBASP to that particular chip without using Arduino board ? Will the program work ? My main goal is to use ...
1
vote
1answer
405 views

Timer (or other) interrupt happens while servicing an interrupt - how to accurately handle the second one?

This seems like a simple question but I'm not finding an answer so far: at a high level, say I have a timer interrupt and some input interrupt. The input arrives, the ISR is entered, interrupts are (...
0
votes
1answer
304 views

Arduino W5100 AVR

I'm trying to use a W5100 Arduino Ethernet Shield on a ATMega2560 using avr code. There exists a library written in C, which should work http://www.seanet.com/~karllunt/w5100_webserv.zip from http://...
2
votes
1answer
781 views

Atmega168 Watchdog timer

I'm trying to use the watchdog timer to prevent the atmel from being stuck in a loop. Right now, I have the watchdog timer in System Reset Mode, with a 8sec timer. I reset the timer in every loop ...
0
votes
1answer
181 views

AVR+Arduino ADC problem

I have connected a circuit to analog pin 0 in the Arduino.I have this code ,which I understand partially(online resources).The problem is that it prints nothing neither on Tera Term nor on Cool Term ....
1
vote
2answers
326 views

Optimizing an Arduino code

I am working on project and using Arduino Pro Mini (Atmega328p running on 2xAA) to measure the time to charge a capacitor (when the volt level is high). This is the code I used while testing: int ...
1
vote
4answers
1k views

How to program a CLK signal and its inverse with Arduino/AVR

Is it possible to simultaneously output a clock signal and it's inverse using the timer register(s)? I'm using the following code in arduino to output a 1MHz signal on OC1A: //Use Timer/Counter1 to ...
0
votes
1answer
488 views

Unable to upload code to the Arduino Nano

I tried to to upload a hex file I generated for the Arduino Nano using avrdude but I keep getting the error: avrdude: stk500_2_ReceiveMessage(): timeout First the arduino board stops doing whatever ...
1
vote
4answers
809 views

Float arithmetic vs. int arithmetic - is there any power penalty?

It is widely known that float arithmetic takes longer (that is, eats more cycles) than fixed-point (or integer, or bitwise arithmetic), and that surely is something to consider for speed- and time-...
1
vote
2answers
740 views

Programming “Arduino” code to AT90S8515?

I found (from a previous life) an STK500 and a couple AT90S8515's in the recesses of my basement.. that I would like to put to use. Is there a way in which I can write "arduino code" for the 8515? ...
0
votes
1answer
441 views

ATtiny461 PWM CTC mode help

I am a beginner at AVR and programming. I am using ATtiny461 and asked to make code to use timer in PWM and CTC mode and use interrupts and pin toggle, this code worked for me with normal timer and ...
1
vote
1answer
1k views

Software I2C - ATmega8

I am using ATmega8 with 12MHz crystal, on my breadboard. I can use SDA and SCL pins with default arduino library wire.h, and it works. But I want another pins to use I2C protocol. I tried this ...
0
votes
2answers
2k views

32u4 timer 4 pwm frequency help

I have extracted the following code from the multiwii project. It generates a ~490-500hz pwm signal on pin 6 which is used to drive an esc. I want to change this frequency down to 50Hz to drive a ...
-1
votes
1answer
271 views

PWM timers, channels and pins

I've got this code from the MultiWii project, which is relevant to the hardware, ATmega32u4, I have. It is part of a function called initOutput(). In the comment it says "connect pin 6", which is the ...
2
votes
0answers
237 views

Programming an AVR using ISP

I am trying to program an atmega with arduino sketch using ISP only (mac user). So I know how to burn a boot loader, and then to program the chip using the TX, RX. But I would like to program it ...
5
votes
1answer
786 views

Remove Bootloader on Arduinos

I am trying to move from arduinos to AVR C. Would somebody know how to remove the arduino bootloader from the microcontroller? Is there a different process for the different atmega microcontrollers ...
0
votes
1answer
1k views

Can't use base class and derived class functions

I have made two libraries and one test program.I have made my custom uart library.first i have included all functions for printing in single uart library file.but then i have made print library for ...
2
votes
1answer
1k views

Custom Arduino library problem

I have made my custom serial(UART) library. So I made uart.h and uart.cpp files as following. uart.h #ifndef UART_H #define UART_H #include <avr/io.h> #include <stdlib.h> //creating ...
8
votes
2answers
9k views

Basic makefile for avr-gcc

I would like to make a makefile for compiling c programs for the arduino. I am somewhat familiar with make but have never used it with avr-gcc. What is the simplest way I could put the commands below ...
4
votes
1answer
262 views

How can I indicate that I am using ATmega2560 so that Arduino libraries understand it?

I am developing AVR microcontollers in Atmle Studio and sometimes I am using Arduino libraries(such as LiquidCrystal). When I initialize LiquidCrystal lcd(12, 11, 5, 4, 3, 2); I don't think Arduino ...
0
votes
1answer
2k views

Arduino Attiny 85 IR library compiler error

I'm about to ask a question for the most common problem which everyone has with attiny85 and the IR library. I will try to make this question as simple as possible. Few things about the lib and the ...
0
votes
1answer
2k views

AVR Timer1 OCR1A controls TIMER1_COMPB_vect interrupt!

I was struggling with timer interrupts in my project. I couldn't make it work properly. So I decided writing a simple code and I saw a very interesting case. ISR(TIMER1_COMPB_vect) { PORTB ^= ...
1
vote
0answers
345 views

Can't get LCD(1602A v2) to communicate with AVR ATMEGA2560 [closed]

I have written the following code to communicate with an LCD display yet I can not get data to appear on the screen. All I get is white boxes on the display. I am properly controlling the RW, RS and ...
1
vote
1answer
294 views

Porting Arduino code to AVR/C++ input not working?

So. I'm trying to read an input on the Arduino Nano using C++/AVR/Eclipse instead of the regular arduino IDE. The code below is working in the arduino IDE void setup() { // put your setup code here,...
0
votes
3answers
394 views

Modify the call stack of interrupts on Arduino

I'm working with Arduino's libraries. And my interest in the possibility to change the call stack of the SPI interrupt, this because I want: after the interrupt happen, the program could jump to other ...
0
votes
1answer
252 views

Unusual behaviour when moving data to PROGMEM

I've got some working code with a definition that looks like this: const unsigned char DynTextPositions[10][4][4] = { ... }; Which is defined / referenced via a header: #include <avr/...
1
vote
3answers
468 views

use arduino IDE for USB isp programmer

A few years ago I programmed AVR ATmega8 with AVR studio by USB isp programmer. I was using C language. Now I would like to use arduino(C++) langauge and my external USB isp programmer. Is it possible?...
0
votes
2answers
519 views

Use Arduino Uno to program the on-board Atmega328 in C

I have an Arduino Uno board. I have seen how it is possible to program external AVR's through the Arduino Uno board, for instance an ATtiny. But I'm starting with c for atmel µc and I just want to ...
3
votes
1answer
3k views

Storing in a global variable using inline assembly

What I'm trying to do is pretty basic: I have a global variable and I'm trying to store some value in it (specifically, the SP_H and SP_L values). The variable is an array of structs and I'm trying ...
0
votes
1answer
138 views

Which Arduino is compatible for atmega164pa

I am working on a project using 5 pins of ADC, 5 pins for PWM, and LCD. I need to use Atmega164pa. I would like to know how I can transfer it to Arduino. Is there any Arduino compatible with this chip?...
1
vote
0answers
432 views

Arduino Due - Multiple Serial Lines

I'm trying to interface with a serial device utilizing Serial1 (pins 18,19) on the Arduino Due. The normal serial port (Serial) is working just fine and is acting as a debug port at the moment - It's ...
0
votes
1answer
97 views

Arduino-like boards with other microcontrollers

Are there any Arduino-like board designs that are NOT using an AVR chip, but perhaps a chip like the Z80 or the 6502?
2
votes
4answers
15k views

New to Arduino: Should I learn C, C++ or both (C & C++)?

From what i've researched here is my thoughts on both C++ I heard that you can create libraries using C++ in arduino. And you can use the Arduino IDE to do that stuff. Here is the proof http://...
1
vote
2answers
3k views

Unable to flash bootloader on ATmega32U4 with AVR dragon

I am flashing a naked ATmega32U4, but the process fails in the end where it is verifying. avrdude -c dragon_isp -p m32u4 -P usb -U flash:w:Caterina-Micro.hex -U lfuse:w:0xff:m -U hfuse:w:0xd8:m -U ...
1
vote
2answers
149 views

In system programming for avr?

I generally use sockets for AVRs in standalone circuits, but sometimes I sell my items and therefore I soldier the chip on the circuit. As you guess I can upgrade the code inside the chip with socket ...
3
votes
2answers
1k views

Can I program AVR Microcontrollers using Arduino Development board with AVR Studio?

I know and I can program any AVR microcontroller with Arduino IDE and Arduino Uno board. Can I use Arduino board with AVR Studio? Or I have to buy an AVR Development board?
2
votes
2answers
1k views

Is Arduino IDE enough to program with C or C++?

I am using Arduino IDE to program my ATmegas with bootloaders. I can directly manipulate ports, use timers, interrupts, PWM pins and timers, etc. Everything is working. But this question arises: Does ...
3
votes
1answer
671 views

How can I make pinMode calls faster?

I'm trying to use 3 pins as capacitive pins along side the Mozzi. I had several attempts and so far the closest I had was using code from the ADCTouch library straight into the main code, but with ...
-1
votes
1answer
245 views

Can Arduino's open design be “scaled” to 64-bit CPUs?

If Arduino is OSH that simply uses 8-bit Atmel AVR MCU as a design component, then can Arduino somehow be tweaked to work with a 64-bit CPU/MCU? If so, what might this entail?
2
votes
4answers
437 views

How are Arduino's OSH if Atmel AVR is proprietary?

I keep reading how Arduinos are "open source", but my understanding of OSH is that all its components must be open source. Arduino uses an Atmel AVR CPU - but Googling this shows the Atmel is ...
0
votes
1answer
1k views

Driving conveyor belts using Arduino Unos

We are planning to drive conveyor belts with Arduino Unos using stepper motors. We are planning to use easy drivers, so that we control at least 3 motors with one Uno. Currently we are still at an ...
0
votes
1answer
194 views

Interrupts don't work

I tried to run a sketch that tests my AVR's interrupts, I have an UNoriginal Arduino Uno, and I've checked pins 2 and 3 like the following: - at void setup() attachInterrupt(2, inter, CHANGE); - at ...
0
votes
1answer
48 views

AVR ATmega328p-pu operating circuit?

I used to work with PIC micro-controller so i know what it needs to work from operating circuit to crystal oscillators needed and other components to power it up , my question here where can i find ...
0
votes
2answers
491 views

Is it possible to use Arduino UNO programmer for other AVR microcontrollers?

I got an Arduino UNO which I started using with microc for avr to add more customizations. I'm wondering if it is possible to use the Arduino UNO programmer to program other AVR microcontrollers (I ...