Skip to main content

Questions tagged [avr-gcc]

AVR-GCC is a compiler that takes C language high level code and creates a binary source which can be uploaded into an AVR micro controller.

Filter by
Sorted by
Tagged with
21 votes
2 answers
13k views

When you're writing a typical sketch, you usually rely on loop() being called repeatedly for as long as the Arduino is running. Moving in and out of the loop() function must introduce a small overhead ...
Peter Bloomfield's user avatar
13 votes
2 answers
12k views

Okay, we all have seen those questions all over the web such as Arduino v.s. C++, or other similar questions. And a vast majority of the answers do not even touch compilation differences other than ...
RedDogAlpha's user avatar
10 votes
1 answer
4k views

I would like to set up a timer in order to call a function 800 times per second. I'm using the Arduino Mega and Timer3 with a prescaler of 1024. To choose the prescaler factor I've considered the ...
UserK's user avatar
  • 559
6 votes
1 answer
3k views

On an embedded system we use global variables often to keep dynamic memory consumption on heap and stack low. But global variables are also considered bad programming practice if they aren't used in a ...
Ariser's user avatar
  • 577
5 votes
2 answers
181 views

I'm taking my first wobbly steps outside the Arduino IDE and I'm not having much success with timers / interrupts. I can set a pin to output and light an LED with registers fine but I cannot for the ...
Ashlyn Black's user avatar
3 votes
1 answer
2k views

I think the arduino board is awesome. Though I'm not interested in the library and IDE at all... Is there a way, to use an AVR 328p, as you normally would, on an arduino board? I like how arduino's ...
aaa's user avatar
  • 2,715
2 votes
2 answers
2k views

I need to initialize several buttons and LEDs connected to my Arduino. To store data related to an individual button or LED, I decided to define my own data type using two different structs. One for a ...
albert's user avatar
  • 205
2 votes
1 answer
479 views

I wrote the following code: #include <avr/io.h> __attribute__((noinline, section(".app_start"))) void app_start() //app_start section starts at 0xFA0 { //register_packet_dispatch(...
Dankó Dávid's user avatar
2 votes
3 answers
537 views

When I am in the 30-second standby function, I want to turn the LED on and off at 5-second intervals. How can I do what I want using the read_counter() function? The problem here is that I am already ...
harun caliskanoglu's user avatar
2 votes
1 answer
1k views

I'm trying to flash pure c-code to arduino Mega2560 board from linux using avr-gcc & avrdude. Compilation is done , now trying to flash using avr-dude, getting error as "avrdude: stk500_recv(): ...
sankar's user avatar
  • 93
2 votes
2 answers
917 views

I'd like to write a function like this: void lcdPositionPrint(int row, int col, content) { lcdPosition(row, col); LCD.print(content); } but I'm not certain how to declare "content", because ...
John's user avatar
  • 123
2 votes
0 answers
191 views

I have a 3.5" TFT LCD communicating in parallel connected to Arduino UNO. I expect it draws a white circle on a black background but all it does is to show a white screen. How to fix this? main.c ...
ar2015's user avatar
  • 173
1 vote
1 answer
89 views

Why do I have to burn the code twice to actually burn it on to the Arduino board? I have to execute this command twice - only then is the chip getting programmed. I'm using this command to burn the ...
user137442's user avatar
1 vote
1 answer
2k views

I have a C program for the attiny85, that I want to disassemble and display with interleaved source code. Here's my program: test.c #include <avr/io.h> int main() { for(int i=0; i<100; ...
Timo's user avatar
  • 113
1 vote
1 answer
1k views

I am using the PubSubClient library in my own Arduino library. I'm having trouble with trying to assign a class member as the client library setCallback callback function. MyClass.cpp: #include <...
Hemant Bhargava's user avatar
1 vote
1 answer
2k views

I am exploring the ATmega328p MCU via a standard Arduino UNO, with the help of avr-gcc toolchain and AVRdude (All in the WINAVR package). I have successfully programmed the board a few times with it. ...
Kraken's user avatar
  • 113
1 vote
1 answer
5k views

I am writing my own code for the Arduino Uno. I compile my code with AVR-gcc, and then upload it with AVRdude. I am not using the Arduino software, but I do have it installed and working on my PC. I ...
user avatar
1 vote
1 answer
218 views

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&...
user840250's user avatar
1 vote
2 answers
4k views

I've traditionally used a text editor with avr-gcc and makefiles for working with Arduino boards. I'm now trying to develop projects for the wider Arduino user-base, so I am trying to use the Arduino ...
Cybergibbons's user avatar
  • 5,430
1 vote
2 answers
109 views

Let's take a very simple sketch, any simple one-.ino sketch. Say, just a led blinker like this void setup() { pinMode(LED_BUILTIN, OUTPUT); digitalWrite(LED_BUILTIN, LOW); } void loop() { ...
AnT stands with Russia's user avatar
1 vote
1 answer
1k views

I'm trying to flash the repetier Firmware to my Prusa i3 3D Printer, which uses Melzi 2.0 board. I uploaded it successfully 2 days ago with same settings but now is failing always. @avrdude -p ...
Regtoy's user avatar
  • 11
1 vote
1 answer
265 views

I am using a custom library for Arduino Mega which uses AES library for AES-128 encryption. However, when I try to use that library in Intel Genuino 101 development board, it shows compilation error ...
goddland_16's user avatar
1 vote
2 answers
636 views

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 ...
Ognan's user avatar
  • 13
1 vote
0 answers
88 views

I was using the example code of "Blink", and when I try to compile it, it pop out an error as below. I tried to: uninstall and installed back the Arduino IDE installed different versions of Arduino ...
Edward Khor's user avatar
1 vote
0 answers
156 views

I’d like to connect two Arduinos over serial port so that they can communicate with each other. Initially, I put all necessary code onto one device and now connected another via serial port. As soon ...
zmechanic's user avatar
  • 121