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
-2
votes
1 answer

AVR photocell not working with Arduino UNO

I was following a tutorial I found to get a photocell to light an LED as a first step to building a morse coder/decoder. I only have an arduino UNO available instead of the ATmega328P chip itself to work with. I have connected the photocell to…
winterx0
  • 17
  • 7
-2
votes
1 answer

Arduino impulse counter

I wanted to write fast impulse counting code for Arduino, to run at 100khz. I wanted to count fast square impulses from generator. I can’t find anything on the internet.
-2
votes
1 answer

How stack pointer works

I'm trying to make an multithreading kernel for atmega328p micro an for that i need to know how the stack pointer it works.
Radu
  • 73
  • 1
  • 3
  • 10
-2
votes
2 answers

Error message "error disabling serialEvent for "COM3" null" using Arduino

I have simplified the question very much. I am trying to send the encoder motor feed back to Processing which will be displayed on the processing. But the error is coming something like: error disabling serialEvent for "COM3"…
Saad Anwar
  • 41
  • 7
-2
votes
1 answer

avr-gcc compiler optimized out a global variable

here, My origin code OCR0A=30; uint16_t start=TCNT1; uint16_t w; for(uint8_t i=0;i<6;i++){ pwm=pgm_read_byte(&forward[i]); // mark here // delay do{ w=TCNT1; } while(w-start>300); } OCR0A=127; compile it, and look into asm, I found…
howard
  • 83
  • 1
  • 5
-2
votes
1 answer

How can I make a .o file to .elf file?

I have a file named lab7.c and when I compile to make it a .o file everything is fine. However then I go to make it a .elf file with avr-gcc -mmcu=atmega324a -o lab7.elf lab7.o I get the error message of lab7.o:(.data+0x8): undefined…
P. Blang
  • 1
  • 4
-2
votes
4 answers

AVR C Programming - Why is the code after the while loop not executed?

Essentially, the aim of the piece of test code is to: *Start a timer (hardware timer) - turn on two LEDs - wait until the timer finishes - turn off both LEDs - delay for 0.9s - start again. for (;;) //forever { PORTB &= ~_BV(PINB7);…
Mike Roberts
  • 11
  • 1
  • 4
-2
votes
1 answer

ASM program to get the sum of integers 1 to 10 in R16

develop an ASM program to get the sum of integers 1 to 10 in R16.. hope someone can help total newbie
banana
  • 1
-3
votes
2 answers

Store pointer to const into vector of structs

I have an issue doing the following: Class "A": const uint8_t arr1[] = {0x00, 0x00, 0x03, 0x00, ...}; const uint8_t arr2[] = {0xA1, 0x00, 0xFF, 0x00, ...}; struct s1 { String name; uint8_t const * arr; }; …
Sergio
  • 5
  • 5
-3
votes
1 answer

C PROGRAMMING CODEVISION AVR

i cant understand some lines of this code please describe me what theise code do: this code is witten in atmelstudio and is a sample code of AVR443 application note of ATMEL unsigned char *pTemp; fastTemp.word = ((PIN_HALL & hallMask)>>1); pTemp =…
-4
votes
0 answers

avr-gcc optimisations are not always optimal?

Please consider this bit of assembly code: 924: 70 e0 ldi r23, 0x00 ; store 0 in r23 926: 76 2f mov r23, r22 ; copy r22's value to r23 (It was generated by avr-gcc with the (default) -Os option active.) Why does it do…
-4
votes
2 answers

C doesnt parse array first element - AVR GCC

The code is pretty straight forward, i am storing the last 10 values and outputting the mean value. However, the 0 element of the array remains unchanged with initialized value '0'. long int avg[10] = {0,0,0,0,0,0,0,0,0,0}; int i; float temp2; for…
-5
votes
1 answer

convert uint16_t hexadecimal number to decimal in C

I have browsed so many questions regarding converting hexadecimal number to a decimal number but I couldn't find a way to convert a uint_16t hexadecimal number to decimal number.Can you help me in this case?Thanks for any advice.
Pavindu
  • 2,684
  • 6
  • 44
  • 77
-5
votes
2 answers

C nested macros

A problem occurred to me. Somebody might show me how to remove the @. I am writing C for a UC and I am lazy; so I want to solve easy problems with macros, e.g. switching on an LED. I managed to do something like that: #include #define…
Hert
  • 11
  • 2
  • 3
1 2 3
40
41