Questions tagged [avr]

AVR is the family of microcontrollers used in Arduino boards.

Filter by
Sorted by
Tagged with
1
vote
4answers
2k views

Reset and Remove Arduino ATmega328P?

So I have 2 Arduinos, and im wanting to remove the chip from one and reset it to like it came from the factory and then breadboard it and attempt to program it using an AVR programmer (Or maybe an ...
1
vote
1answer
125 views

Unable to replicate Arduino code into ATmega8 code

I am trying to replicate an LTC Audio Decoder code from Arduino Uno into AVR ATmega8 which I got from here. My Arduino Uno code is working great. Here is my Arduino Uno code: #define one_time_max ...
0
votes
1answer
466 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 ...
0
votes
1answer
22 views

8 bit arduinos: What happens to the data in registers during a function call? During an interupt?

If I have one function that uses registers heavily calling another that does the same thing, what happens? Does the data get destroyed? What, then, would happen on return to the first function? Is ...
0
votes
1answer
3k views

10 bit PWM on Arduino UNO

I am using this code to make 10 bit PWM on port number 9, it seems like everything printed is 0,1022 rather than printing 0, 512, 1023. Is there a problem in my code ? I wired pin9 to A3 to get the ...
0
votes
3answers
2k views

Why can't the Atmel ATtiny family delay over a minute?

I have some really simple code and tested on an 8 MHz ATtiny85 and ATtiny2313. It's basically a blocking blink: int relayPin = 7; long offPeriod = 1 * 60 * 1000; long onPeriod = 1 * 60 * 1000; ...
2
votes
1answer
446 views

Cannot enter programming mode on Arduino Uno

I have an Arduino Uno that I've been programming with an AVR Dragon through Atmel Studio 7. I did two things in close proximity, and I'm not entire sure which action is the culprit. I tried using the ...
0
votes
2answers
1k views

Arduino uno board not detected when connected via USB no matter what OS

I was working with Arduino in Win 8.1, when suddenly it stopped work. I tried to reinstall the drivers and IDE several times, but it didn't solved. In Win 8.1, when I plug the arduino, I get the pop ...
0
votes
1answer
162 views

Using Atmel Studio with Arduino Starter Kit (Uno MCU)

Can someone tell me if it's possible AND safe to use Atmel Studio with Arduino Starter Kit? I'm a newbie to firmware in general and I don't want to "brick" my Arduino Uno Microcontroller. I don't ...
1
vote
2answers
2k views

AVR (Arduino Uno) Serial.print and Serial.println only printing 1 or 2 chars

I first used the Arduino IDE but now I'm using PlatformIO which is awesome. But I have some big trouble with Serial.print() and Serial.println(). To show this error I have the following example code: ...
1
vote
1answer
900 views

Atmega328p programming with Arduino libraries

I'm trying to use the serial communication to work between a naked AVR Atmega328p and a computer (OS X and Linux Ubuntu). I can program the atmega (using a pololu programmer), I make it blink a LED ...
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 ...
1
vote
1answer
63 views

Complete Bread board arduino

I bought a ATmega328 microcontroller and burn the bootloader. Now I want to upload code directly from pc to the microcontroller on bread board. I have max232 ic for the communication but I recently ...
0
votes
1answer
546 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
3answers
614 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
3answers
855 views

Is the Arduino bootloader really the Atmel bootloader? Can I use Flip to upload?

I've been asked to do a small project using an Ada BlueFruit board. It has a ATMega32U4. The 32U4 comes from the factory with a bootloader pre-installed. I've never used an Arduino before, but I have ...
0
votes
2answers
509 views

does eeprom_write_block function of avr.eeprom.h writes a NULL terminated string or we have to manually null terminate it

http://www.nongnu.org/avr-libc/user-manual/group__avr__eeprom.html I am trying to figure out that if we use eeprom_write_block function or eeprom_update_block function do we need to manually null ...
-1
votes
1answer
2k views

Error uploading to ATtiny

I followed Great Scott's video on YouTube for uploading to an ATtiny85. When I tried I got the following error messages: Arduino: 1.6.7 (Windows Vista), Board: "ATtiny85 (internal 8 MHz clock)&...
0
votes
1answer
275 views

Porting ATMega8 AVR based program to Intel Curie Processor

I'm currently trying to port a program called 'ArduinoUSBLinker' to work on my Arduino 101 (which has an Intel Curie CPU instead of the standard ATMega CPU). The program is used to flash ESCs without ...
0
votes
1answer
46 views

IO Control and Configuration

I am using Eclipse to program a ATMega2560 and would like to stay away from the Arduino library, While looking through AVR Examples I have seen the syntax #include <avr/io.h> PORTD.0 = 1 or ...
1
vote
1answer
128 views

Using AVR Timer Within an ISR

I'm trying to create an ISR which operates for 15 seconds when a particular button is pressed. I'm attempting to use the AVR functions on my Arduino Uno to start counting when it enters the ISR, then ...
-1
votes
1answer
232 views

AVR has no vprintf_P?

Well this was unexpected. AVR libc has many the variants of printf, including vprintf, but is missing vprintf_P. Is this really just not present or implemented elsewhere?
3
votes
1answer
1k views

How to use printf with Arduino's serial ports without an intermediary buffer?

How to use printf with Arduino's streams without an intermediary buffer? The following seems unnecessary: char buf[256]; sprintf(buf, ...); Serial.print(buf); Is there a way to connect ...
1
vote
0answers
41 views

Why am I only receiving the first address byte? (I2C Protocol)

Expecting the slave to ACKnowledge and return data, but it does not. This is my protocol. This is my Datasheet. Also FYI I'm on an Arduino Fio but I am not inheriting the Arduino library. #include &...
1
vote
1answer
201 views

How do I use SNAP protocol, correctly?

I've reviewed the documentation I'm still a little lost when it comes to applying the functions. Each of the redundancy check methods take in an unsigned char and return an unsigned char. Shouldn't ...
1
vote
1answer
2k views

How do I use an AtTiny85 (or other AtTiny) with Arduino?

Please mind that this is an "example" question. How to make a "tiny arduino"? I've ordered a bunch of ATtiny85's off E-bay, they're like tiny Arduino's. I've set up the latest Arduino IDE and would ...
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?
9
votes
4answers
56k views

Arduino compatible's serial port not showing Mac OSX

I bought an Arduino-compatible Freaduino board atmega8 (I selected the board type as Arduino ng or older atmega8). I installed the Arduino IDE on Mac OS X and the FTDI drivers. But my serial port ...
0
votes
1answer
676 views

Timer/Counter programming Arduino

I'm trying to blink an LED on an ATMega328P (same MCU as Arduino I think..) using the internal timer but I'm stuck since it doesn't seem to light the LED at all.... #include <avr/io.h> //#...
-1
votes
1answer
2k views

Arduino Mega 2560 as ISP for ATTINY2313 / ATMEGA328P

I have posted this on the Arduino forum also, but I give it more chance if posted here also. I've been trying to use my Arduino Mega as an ISP for programming two different ATMEGA328P's and a ...
0
votes
1answer
185 views

Switching LED on and off using microcontroller

I am new to microcontrollers and just become confused trying to solve the following problem: An ATmega32 chip is connected to four on/off switches (SW0-SW3) and 4 LEDs (LED0-LED3). SWi is connected ...
1
vote
2answers
820 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
220 views

How to upload Arduino sketches to Atmel chips

I am new in this Arduino coding world and I was trying to make a project. I normally used Arduino Unos all the time, but I was facing a problem and that is that the Arduino Uno has only 13 digital ...
0
votes
1answer
150 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?...
2
votes
1answer
255 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
7k 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 ...
-1
votes
1answer
284 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
94 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
694 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 ...
2
votes
2answers
984 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 ...
9
votes
5answers
12k views

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

I'd always thought Arduino was a microcontroller platform but the actual microcontroller is an AVR chip made by Atmel, or something like that made by someone else, based on a RISC ISA, and Arduino is ...
0
votes
1answer
329 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://...
1
vote
1answer
490 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 (...
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
224 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 ....
7
votes
3answers
28k views

I2C 2 way communication between Arduino Uno and Arduino Mega

If I remove the transmission code from slave this works properly but I need to transmit from slave. Here is my master code #include <Wire.h> void setup() { Wire.begin(3); Wire.onReceive(...
2
votes
1answer
838 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 ...
1
vote
4answers
873 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-...
2
votes
2answers
377 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
3answers
435 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 ...