AVR-GCC is part of the GNU Compiler Collection (GCC) collection of open source compilers that targets the popular AVR microntroller produced by Atmel. It supports both the C and C++ languages.
0
votes
0answers
24 views
GLCD t6963 auto write problem
I am trying to send data to a 128x240 display driven by t6963 in autowrite mode by ATMega128 under AVR-GCC.
the code gets stuck when checking DAWRDY bit ( to see if the driver is ready for receiving ...
2
votes
3answers
103 views
'bit' type for AVR Microcontroller programming
I have written a code for 8051 microcontroller, where I used bit type, something like this:
...
0
votes
1answer
62 views
Problem Changing system clock frequency
I have an ATtiny85 and I'm trying to set the clock to 8Mhz. I have read the data sheet and some discussions on how to do this but am not having any luck getting it to work. I have included my code ...
0
votes
0answers
34 views
How to change PORTX register in other place of program?(Codevision & GCC)
i have a question about GCC and CodeVision:
How can i changing PORTX register in other place of program. as you know, normally we setting it at Main function inside DDRX rigester for example like ...
0
votes
0answers
59 views
How can i port this Lib(ProGFX) to CodeVision(compiler)?
i want to port this library to CodeVision(compiler).
http://progfx.org/
How can i do it?
2
votes
1answer
79 views
LED remains off on ATmega16
I wrote this simple program:
#include <avr/io.h>
int main(void) {
DDRA = 0xff;
PORTA = 0xff;
while(1) {
}
}
When I program it to my brand new ...
1
vote
1answer
90 views
AVR-GCC: Ports Undeclared when compiling
My Setup
I'm running Ubuntu 12.10, and I want to be able to use gcc and avrdude to compile and program my ATmega328.
I followed this Ladyada tutorial: Ladyada AVR Tutorial
Everything installed ...
2
votes
3answers
194 views
Short String overflows.text area on ATtiny85, Arduino IDE
I'm using the Arduino IDE with arduino-tiny (https://code.google.com/p/arduino-tiny/) on an ATTIny85. My code is maxing out the RAM, or so it seems:
Adding a ...
1
vote
2answers
268 views
Minimum files for Atmega1284p AVR-GCC?
does someone have the minimum setup (ie. a 1284p Makefile and an example blink.c) for an ATMega1284p and AVR-GCC? I seem to be ...
4
votes
0answers
260 views
Programming an ATmega1284p with Arduino IDE and internal RC Oscillator?
I'd like to program an ATmega1284p with my AVR Dragon and the Arduino IDE. So far I have installed mighty1284p (http://maniacbug.wordpress.com/2011/11/27/arduino-on-atmega1284p-4/), after writing my ...
1
vote
1answer
54 views
How to flash error if a macro is not defined in program
I want my program to flash compile time error like "LCD_PORT not defined" if it is not defined in program itself. For that I modified the header file like this
...
1
vote
1answer
306 views
Pointer Size using eeprom.h with ATmega328p in AVR-GCC
I am working on a project that randomly reads and writes large blocks of data from EEPROM, based on user input. I have used the EEPROM before, but I never really thought about this. In the operations ...
1
vote
2answers
588 views
AVR GCC : Global / Static Array not getting initialized properly
Im having problem with global arrays in my C code. What i am trying to do is to use a display buffer (array of 8 uint8_t with each uint8_t representing a row) to light up the leds in 8x8 led matrix ...
4
votes
2answers
103 views
Global Array Size Affects Clock Frequency Only On Linux (avr-gcc)
I am having the most peculiar problem. When the size of a global array changes, it alters the clock frequency of the ATmega164a. This is on Linux. When compiled on Windows, this problem doesn't occur ...
0
votes
3answers
370 views
Serial communication in Atmega128
I want to send some string to PC via serial port. In cute com (software) its displaying the string but with some chars missing. Also some hex numbers are appended at the start and end of the string. ...
1
vote
2answers
155 views
ATMega16: Run a subroutine for a limited time
I have a problem on ATMega16. I can't seem to be able to make a subroutine run for a set amount of time. Here is the code:
...
1
vote
1answer
954 views
Converting from int to string for AVR ATmega32
I am trying to read data from the ADC and display it on a HD44870 compatible LCD with an ATmega32. As the data from the ADC is a 10-bit unsigned integer, the LCD expects a string, some conversion is ...
-1
votes
1answer
284 views
Merge 2 chars from UART and convert into HEX value [closed]
I receive two characters from the UART:
char UD[2] = {'B','8'}
I need convert this into a hexadecimal value, like:
...
3
votes
3answers
707 views
Fastest moving averaging techniques with minimum footprint
I have tried few running averaging techs for smoothing the change in ADC data in AtMega48 for controlling lights(PWM) when rotating a pot(ADC).
The filters (pseudo codes):
Moving average:
...
3
votes
1answer
200 views
Easiest way to get rid of __clz_tab in winavr compiled code?
I've ported a program from the arduino environment to a makefile build using winavr, which, in turn, is based on avr-gcc (just like arduino).
However, my program started crashing, and after some ...
1
vote
3answers
406 views
Documentation on `avr-as`
I'm starting learn AVR microcontrollers. But my OS is Linux. I have installed avr-binutils with avr-as. But I can't find ...
3
votes
2answers
2k views
ATMega8 - PORT C - Digital Output Issue
What I am trying to do is set pin PC0 of PORT C as output to light an LED.
The code I am using for that is:
...
6
votes
3answers
935 views
Setting pin to high in function instead of main, not full voltage output?
I have a function which turns on a LED by setting PB1 to HIGH. The light from the LED is barely visible. If I set PB1 to HIGH in my main function the light from the LED is as bright as it should be.
...
3
votes
1answer
1k views
How do I create a static library for the AVR Atmega328p?
I am attempting to create a library much like the Arduino in C.
I have tried in the past and although I have lost the code, I remember simply getting loads of undefined references to functions ...
2
votes
2answers
381 views
Accessing data past 64k boundary on atmega1280
I need to be able to store and refer to constant data arrays which must be placed after the 64k boundary in the atmega1280. How do I create the correct data structure, and then access it for the ...
4
votes
1answer
636 views
Modifying Interrupt Vector Table of Atmega32
A project that I'm working on involves a cycle accurate interrupt service routine. This routine is written in AVR Assembly where I just wrote:
...
4
votes
1answer
763 views
Overflow interrupt firing only once
I've run into an issue where, it appears, my interrupt only fires once, then simply refuses to fire again on my ATMega32U2. I have the following (stripped down) code:
...
3
votes
1answer
583 views
PB7, PD7 (on ATMega32) won't work when pull ups enabled. Also PC6 and PC7 don't show output
I am making 16*16 keypad(on PORTB and PORTD) with ATMega32 using proteus 6.9 and AVRstudio5.
My problem is PB7 and PD7 won't work when pull ups on those pins are enabled. Here PD7 is output, so no ...
1
vote
3answers
1k views
AVR: problem with inline assembler
WinAVR seems to produce a lot of useless code, e.g. for following C method
ISR(INT0_vect) {
TCCR1B = 0x09;
}
it produces (...
3
votes
4answers
587 views
Excessive AVR static RAM usage with mixed-type math operations
I've narrowed down an issue in my code which creates an extra 260 bytes of static RAM usage:
...
0
votes
1answer
660 views
avr-gcc(4.4.2)/avr-libc linker issues
So this seems to be a generic issue. "libc.a" is associate with some sort of incompatibility with floating point math and/or the correct library used.
I've added the "-lm" as suggested on the forums, ...
0
votes
1answer
205 views
Mac based AVR development issue
Ok, so I reinstalled my development enviroment on the mac using the latest build of avr-gcc (4.4.2), avr-libc and avrdude from the Fink project.
Problem is when compiling I keep on getting a linker ...
4
votes
2answers
1k views
Macros V/S inline functions while programming for avr-gcc
I have been doing my first serious work of programming these days. I have been exposed to a lot of code by different developers. One thing I find confusing is how do these developers decide when to ...