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.
68 questions
13
votes
2
answers
12k
views
Will a .ino Arduino Sketch compile directly on GCC-AVR?
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 ...
-1
votes
1
answer
123
views
avrdude: stk500_recv(): programmer is not responding avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
I'm working on a linux machine with avrdude and avrgcc. NOT using Arduino IDE.
I'm using Arduino Nano 33 SENSE REV2 BLE, trying to upload a sample blink .c program and getting this error.
This is the ...
0
votes
1
answer
179
views
How to run avr-gcov on a .ino sketch file
I am new to Arduino and gcov. I have a .ino sketch file, avr-gcov, and avr-gcc from Arduino library in the same directory. Could someone guide me to the steps I should take to run avr-gcov on my .ino ...
0
votes
2
answers
317
views
slower clock frequency than expected on attiny202
I am programming an attiny202 which as per datasheet can run up to 20Mhz, but after compiling/uploading this simple code to the attiny202 and watch the PA2 pin on the oscilloscope, I see that the pin ...
0
votes
1
answer
86
views
Do I need to use resisters and ICes for specific sensors.What if I dont use it,Will it impact my arduino board some how like making it useless &faulty
So I was reading about Simple AutomaticLight Controller using LDR. or with the help of LDRSenso. But I have LM393 Photoresistor (LDR) Sensor I like to know are they same thing or somewhat different. ...
1
vote
1
answer
89
views
Why do I have to burn the code to make it run? [closed]
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 ...
1
vote
1
answer
204
views
Why my arduino board does not blink properly?
I have two files
blink1.cpp
typedef unsigned char int8_t;
typedef volatile int8_t * volatile port_type;
port_type portB = (port_type) 0x25;
port_type ddrB = (port_type) 0x24;
void delay_500ms()
{
...
11
votes
2
answers
2k
views
Understanding the compilation/linking/upload process (so I don't have to use the IDE)
I have started to play with and arduino UNO quite recently (without any prior experience with micro-controllers). I would like to use emacs instead of the IDE, and I'd also like to know what the IDE ...
2
votes
3
answers
537
views
How can I control blinking of LED while in timer function?
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 ...
1
vote
1
answer
2k
views
Interleave disassembly + source with avr-objdump
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; ...
1
vote
1
answer
552
views
Reading port register and print
I am playing with port registers directly to improve speed on a Arduino micro. I have no problem writing them, like
PORTF &= B11101111
However, when I try to read and print it, things get funny ...
0
votes
2
answers
93
views
Atmega collecting and relaying interrupt calls
I like to collect all possible interrupt and relay them to an alternative handler interrupt table what the user can set.
In order to do this i have to:
1) collect all/any interrup request
2) ...
0
votes
1
answer
292
views
Running Arduino code for Bluefruit LE on bare ATMega328
I need to hook up Bluefruit LE Breakout (nRF8001-based) to ATMega328 chip (to use it as wireless UART), and it seems like the library provided is for Arduino.
What I have is just bare ATMega328 (note ...
2
votes
2
answers
138
views
Weird behavior (Couldn't pull the pin LOW)
I was trying to implement my own code to control a stepper motor on arduino uno, however I noticed that the pins were always HIGH despite what was written to them. I started to erase the code to leave ...
1
vote
2
answers
4k
views
Why does my Arduino IDE hang/crash so often?
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 ...
21
votes
2
answers
13k
views
Would an infinite loop inside loop() perform faster?
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 ...
2
votes
3
answers
2k
views
Compiling code via terminal
How can I compile my code via terminal? I am working on a Chrome app that allows you to write, compile, and upload code to an Arduino, and I need to know this so I can use the command line compiler on ...
1
vote
1
answer
2k
views
undefined reference to `PPMintIn::PPMintIn(int)'
I am making a new library that will utilize PinChangeInt's library.
My intention is to further simplify repetitive code by creating a library. (This is to allow for multiple PPM channels without ...
1
vote
0
answers
88
views
Error Compiling any coding in Arduino IDE
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 ...
2
votes
1
answer
814
views
Compilation error using arduino-mk on arch Linux (undefined reference to __dso_handle)
I'm compiling a simple sketch that reads values from an analog input
and activates a buzzer on a digital input.
working on an Arduino uno.
the sketch compiles and runs fine on windows and arch linux ...
4
votes
1
answer
10k
views
Does ATMega 328/2560 chips support JTAG-type programmer and hardware debugger?
As stated in www.Arduino.cc FAQ, "Can I use an Arduino board without the Arduino software? Sure. It's just an AVR development board, you can use straight AVR C or C++ (with avr-gcc and avrdude or AVR ...
5
votes
4
answers
241
views
Where in datasheet is the warning about unreliability of reading PINxn?
I use atmega32u4 (but believe it applies to all models). Here is the datasheet.
Consider the following C program (I use AVR-GCC 5.4.0):
#include <avr/io.h>
int main(void)
{
PORTB |= 1 <&...
0
votes
3
answers
293
views
Why atmega168/328p starts to reset?
First we set fuse bits:
avrdude -c usbasp -p atmega328p -U lfuse:w:0xFF:m -U hfuse:w:0xDF:m -U efuse:w:0x07:m # same for atmega168
In the following examples we use the following commands to compile ...
0
votes
1
answer
910
views
UECIDE: linker error with U8g2 library
This sketch:
#include <SPI.h>
#include <Wire.h>
#include <U8g2lib.h>
// OLED display.
U8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
void setup()...
-1
votes
3
answers
1k
views
avrdude flash issues
I want to burn a hex file to a custom ATmega2560 board. I use this USBasp programmer for flashing (firmware version 1.01) on my Mac OS X 10.12.6 system. All hex files are compiled with avr-gcc (GCC) 4....