Questions tagged [avr-gcc]

avr-gcc is a suite of executable software development tools for Atmel AVR RISC processors

avr-gcc is a suite of executable software development tools for Atmel AVR RISC processors, hosted on the Windows platform, has GNU GCC compiler for C/C++.

Atmel provides also an AVR Toolchain, which is a collection of tools/libraries used to create applications for AVR microcontrollers. The collection includes compiler, assembler, linker and Standard C & other math libraries.

Most of these tools are based on efforts from GNU (www.gnu.org), and some are developed by Atmel.

614 questions
-1
votes
2 answers

How does this compile in Arduino IDE?

I have noticed the following code, which is obviously invalid C++, compiles in Arduino IDE (using AVR-GCC): // The program compiles even when the following // line is commented. // void someRandomFunction(); void setup() { // put your setup code…
FlatAssembler
  • 667
  • 7
  • 30
-1
votes
2 answers

_delay_ms seems not to work when using pwm

I'm relatively new to programming microcontrollers, so I started experimenting on an ATtiny85. First program was simply turning on an LED and off with a little delay (classic blinky program). Now I wanted to slowly increase the brightness of the…
Stefan
  • 652
  • 5
  • 10
-1
votes
1 answer

WinAVR no rule for main.elf

I am trying to generate .hex file to be burned on micro-controller. I'm using WinAVR. With MFile I generated makefile for my ATmega8. Here is the makefile main.c Now when I try to make all from Programmer's Notepad it gives me error saying : >…
Maifee Ul Asad
  • 3,992
  • 6
  • 38
  • 86
-1
votes
2 answers

Storing data in program memory(PROGMEM) and send it through usb serial communication to puTTY screen

I am trying to store data in the PROGMEM and retrieve it later. Then send them through USB serial comms to screen. int8_t serial_comm_write(const uint8_t *buffer, uint16_t size){ //Here contains the code from the lib which I don't understand. …
Jack Hu
  • 43
  • 6
-1
votes
2 answers

How to instruct avr-gcc to optimize volatile variables?

Code for an interrupt service handler: volatile unsigned char x = 0; void interruptHandler() __attribute__ ((signal)); void interruptHandler() { f(); g(); } Calls: void f() { x ++; } // could be more complex, could also be in a different…
feklee
  • 7,555
  • 9
  • 54
  • 72
-1
votes
1 answer

What is the algorithm to convert .ino files to .hex?

I need to convert my Arduino code (.ino) to .hex file. I don't want to use the IDE. Is there a way to do this? I'm sorry if the question is too basic.
Vignesh
  • 54
  • 8
-1
votes
1 answer

Servos not running properly on AVR

I'm not gonna waste your time, and just post the code along with the explanation #define F_CPU 8000000UL #include #include #include int main(void){ sei(); //Enable interrupts DDRB = (1 <<…
Shahe Ansar
  • 314
  • 2
  • 12
-1
votes
1 answer

Best Way to Reduce Overloading when Casting is Sufficient in C++

The avr-gcc compiler offers the F() macro as a good way to define strings in my statements and then place the strings in program memory. The strings end up being of type __FlashStringHelper, however, and I will get an error if I try to pass them to…
BigBobby
  • 423
  • 1
  • 3
  • 17
-1
votes
1 answer

Looping timer function in avr?

I recently had to make an Arduino project using avr library and without delay lib. In that i had to create an implementation of the delay function. After searching on the internet i found this particular code in many many places. And the only…
darth
  • 169
  • 1
  • 16
-1
votes
1 answer

difference between "loop_until_bit_is_set" macro and while() expression

this piece of code in running on ATmega2560, so what is the difference between these two: while(UCSR0A & 0b00100000 == 0); // check UDRE0 bit if it is 1 and: loop_until_bit_is_set(UCSR0A, UDRE0); as you can see this is for UART transmission, but…
zrs5532
  • 1
  • 2
-1
votes
1 answer

real time online push button based counting system

I am doing this project: I have 4 inputs. These are push buttons, connected to a microcontroller. Each time a push button is pressed, say for example pushbutton_1 is pressed, the press of a switch button should be recognised as a HIGH. In its normal…
adrian
  • 284
  • 2
  • 4
  • 14
-1
votes
2 answers

ATMega peformance for different operations

Has anyone experiences replacing floating point operations on ATMega (2560) based systems? There are a couple of very common situations which happen every day. For example: Are comparisons faster than divisions/multiplications? Are float to int…
dgrat
  • 2,214
  • 4
  • 24
  • 46
-1
votes
1 answer

Changing phase value of the signal using microcontroller

I am trying to generate sine wave using programmable waveform generator AD9833 with ATmega32-A micro controller.(MCLK =8MHz clock frequency). I am using USART communication and so if i change frequency or phase in hyper terminal then the waveform…
verendra
  • 223
  • 3
  • 18
-2
votes
1 answer

How to get full performance from atmega8 controller?

I'm using avr-gcc from the Debian Linux repository. I have noticed that the program on a real breadboard is 1000 times slower than it should be. For example, with the code #define F_CPU 8000 #include _delay_ms(1000); the delay is…
-2
votes
2 answers

How to stringify a string which contains extended characters, such as degree character ° - C preprocessor

In How to stringify a string which contains a comma? it is described how to stringify a string. However, it does not work with specials characters, for instance: #include #define TOSTR_(...) #__VA_ARGS__ #define STRINGIFY(...)…
user2718593
  • 111
  • 8
1 2 3
40
41