Questions tagged [avr]
AVR is the family of microcontrollers used in Arduino boards.
262 questions
0
votes
1
answer
1k
views
Help: convert Arduino code to avr-gcc code [closed]
I need to convert Arduino code to avr-gcc code. This is code:
#include <Servo.h>
Servo myservo;
void setup() {
myservo.attach(11);
}
void loop() {
myservo.write(67);
}
I use Arduino ...
4
votes
1
answer
15k
views
How to convert Arduino example sketch to a complete c++ project?
I'm experimenting something new with my Arduino Leonardo. I removed its original bootloader and flashed it with LUFA mass storage example with added functionalities(now its a firmware). I'm trying to ...
0
votes
2
answers
264
views
Using Arduino libraries for adding more functionalities to a bootloader
I have a short question to ask before putting time for research.
I have an Arduino Leonardo with the LUFA mass storage bootloader flashed. Now what I need to do is to add more functionalities to the ...
4
votes
1
answer
4k
views
How is the bootloader activated when device is running?
For the sake of specificity I am referencing my question to Arduino. It applies to all AVRs with hardware USB and a bootloader though.
The bootloader is capable of receiving new program data over the ...
0
votes
1
answer
246
views
Programming ATMega328p using VP812 programmer (for AVR/Atmel chips)
I bootloaded an ATMega328p (the one that uses the basic Arduino bootloader). Then, I used the VP812 for dumping other programs written in C (in Atmel Studio).
The process of erasing, blank test, ...
1
vote
4
answers
4k
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 ...
0
votes
1
answer
242
views
Problem with uploading LUFA MassStorage .hex file to Leonardo
I have been trying to make my Leonardo board to work as a USB device. So I started with compiling the open source LUFA USB library demo "MassStorage" for the Leonardo board settings. Since I'm using ...
0
votes
1
answer
36
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 ...
1
vote
2
answers
253
views
Temperature sensor and LCD
I have a project which uses a DS18B20 temperature sensor and an LCD with an I2C interface on it. I have connected the sensor to my micro-controller (the DS18B20 has a 12-bit digital output) to the ...
0
votes
1
answer
4k
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
1
answer
89
views
Problem with microSD SPI mode in AVR
I'm trying to read a microSD block. But I don't know why it doesn't work.
I do:
CS_UP;
for(uint8_t i = 0; i <14; i++){ /* Send 74+ clocks */
spi_tranceiver(0xff);
}
_delay_ms(1); /* Wait 1 ms ...
1
vote
1
answer
4k
views
AVR timer overflow interrupt not working
My problem is an interrupt service routine (ISR) that seemingly never executes! Here's some info on my set up: I am flashing an avr attiny85. I have the bare bones of a project set up so far with ...
1
vote
1
answer
218
views
avr-gcc -D is ignored
Im trying to use XCode to compile avr program with arduino libs but seems like something wrong with my Makefile because it throws me warnings like
# warning "F_CPU not defined for <util/delay.h&...
0
votes
2
answers
2k
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
1
answer
225
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 ...
0
votes
2
answers
549
views
BASCOM-AVR stk500_2_ReceiveMessage(): timeout: -1
Arduino Uno R3
Windows 10
Bascom AVR
The ON is alright.
The LED flickers now and then.
The RX and TX flickers when I press the program button on Bascom but then disappears almost immediately.
...
1
vote
2
answers
996
views
From Wiring to pure C
I'm using the Teensy 2.0 (atmega32u4) and decided to switch from Arduino IDE with Wiring to pure C. I think it's much more useful to master programming microcontrollers on that level. Wiring seems to ...
2
votes
2
answers
4k
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:
...
2
votes
1
answer
1k
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 ...
2
votes
1
answer
3k
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
3
answers
4k
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;
...
3
votes
1
answer
142
views
Issues graduating to AVR-C [closed]
I'm trying to make the transition from coding in the Arduino language to AVR-C, but I'm having some issues with my microcontrollers.
I don't have an ISP, so I'm using one of my Arduino UNOs with the ...
0
votes
3
answers
1k
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 ...
1
vote
1
answer
88
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 ...
2
votes
5
answers
2k
views
Good book/reference for AVR coding in pure C/C++?
Can someone recommend a good book/reference for going vanilla (i.e. not using arduino simplified language) on e.g. ATtiny85? I will need to use the equivalents of analogRead() and digitalRead() quite ...
2
votes
1
answer
697
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
2
answers
810
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
vote
1
answer
159
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
1
answer
297
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 ...
2
votes
5
answers
327
views
can homemade arduino be powered up with battery?
I am new to arduino. It is costly for me to buy an arduino uno board. Therefore I am going to make a Arduino with breadboard at my home. I also want to make my Arduino portable. Arduino Uno boards can ...
0
votes
1
answer
78
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
...
0
votes
1
answer
450
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
1
answer
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 HardwareSerial ...
3
votes
1
answer
89
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
1
answer
278
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
1
answer
3k
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 ...
2
votes
0
answers
1k
views
Does Proteus simulate external interrupts properly using Arduino? I can't get them to work
I am trying to simulate an interrupt with an Arduino Uno in Proteus. This is the simple test code that I'm using:
void introutine()
{
digitalWrite(13,HIGH);
}
void setup()
{
pinMode(13,OUTPUT);
...
1
vote
1
answer
216
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 ...
0
votes
2
answers
202
views
Programming an ATtiny85
Recently I ordered some ATtiny85's from Jameco, and I've been trying to upload code to them through an Arduino Uno, following the instructions from this video on YouTube. I've been getting a lot of ...
0
votes
1
answer
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
1
answer
783
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>
//#...
2
votes
2
answers
7k
views
Since double and float represent the same data type (usually), which is preferable?
It looks like on ATMega based boards, float and double are equivalent 32-bit (4-byte) data types.
However, on the Arduino Due, doubles are 64-bit (8-byte) where floats are 32-bit (4-byte), same as ...
0
votes
1
answer
341
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 ...
0
votes
2
answers
373
views
where I can find ground? [closed]
there is AVR AVR ATmega32 and a board within.
there is outputs for all ports (A, B, C, D) on board, and Vcc.
the problem is - I have no external GND output.
to watch current - I should search for ...
0
votes
1
answer
313
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 ...
2
votes
1
answer
558
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
2
answers
4k
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
2
answers
8k
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
0
answers
112
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 ...
3
votes
1
answer
811
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 ...