Questions tagged [avr]

AVR is the family of microcontrollers used in Arduino boards.

Filter by
Sorted by
Tagged with
1
vote
1answer
842 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
62 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
527 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
563 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?...
2
votes
1answer
1k views

Uploading .hex to ATTiny13 using Arduino

I would like to upload a .hex to ATTiny13V (or '13A) using Arduino Uno R3. I think I know everything to do, but ATTiny13 ISP support and Arduino IDE is a bit search-and-find, and I have some grey-...
0
votes
3answers
842 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
488 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
1k 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
273 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
126 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
220 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
972 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
200 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
1k 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
55k 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
663 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
183 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
792 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
210 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
144 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
231 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
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 ...
-1
votes
1answer
281 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
93 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
684 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
960 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
11k 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
319 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
461 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
202 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
824 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
837 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
361 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 ...
0
votes
3answers
421 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
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 ...
5
votes
1answer
144 views

Does porting code to different MCU clock frequency affect serial baud rate?

Tried to upload my Arduino Uno sketch that writes to serial UART at 9600 baud rate onto my ATtiny2313 running at 1MHz. Not getting the signal on the ATtiny, does this have to do with my clock ...
5
votes
1answer
832 views

Cannot compile C++11 code via Makefile

I am building my Arduino project with a makefile: BOARD_TAG = uno ARDUINO_PORT = /dev/ttyACM0 USER_LIB_PATH = /home/prakhar/dev/alfred/arduino/libraries CPPFLAGS=-x c++ -std=c++11 -Wall -...
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 ...
2
votes
0answers
244 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 ...
1
vote
4answers
1k views

Using Arduino to learn AVR programming

I want to learn AVR C programming instead of arduino programming. I have an arduino UNO board and few Atmega328 chips that I bought, and Atmel studio for programming. Can I use Arduino Uno board as ...
5
votes
1answer
848 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 ...
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 ...
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 ...