avr-gcc
Is it possible to force particular registers in inline assembly code?
I have the following assembly code: __asm__ __volatile__ ( \"1: subi %0, 1\"\"\\n\\t\" \"brne 1b\" : \"=d\" (__count)[详细]
2023-04-09 19:17 分类:问答ATmega 328p behaving weird with a static function
I\'m trying to use an ATmega 328p (Arduino Ethernet) to control a Wiznet W5100 Ethernet controller. The libraries I\'m using are tested and work, but for me they don\'t. Here\'s what I tracked the pro[详细]
2023-04-06 02:13 分类:问答Arduino (Uno) Ethernet client connection fails after many client prints
I\'m using an Arduino Uno with Ethernet Shield. After sending many HTTP requests, client.println(...), the client starts to fail when connecting. The time to failure appears to be random, and the seq[详细]
2023-04-05 06:47 分类:问答Is it a good practice to include all files in one .h file and include that file everywhere for AVR?
Can I do like this /*includeAll.h*/ #ifndef INCLUDEALL_H_ #define INCLUDEALL_H_ 1 #include <avr/io.h>[详细]
2023-04-01 20:23 分类:问答How to prevent GCC from optimizing out a busy wait loop?
I want to write a C code firmware for Atmel AVR microcontrollers. I will compile it using GCC. Also, I want to enable compiler optimizations (-Os or -O2), as I see no reason to not enable them, and th[详细]
2023-03-28 18:12 分类:问答Avr-gcc: Timer/counter interrupts conflicting with UART?
Please consider the following example (tried on Arduino IDE 0022, Ubuntu 11.04, Arduino AtMEGA 2560), where I\'m trying to start a timer/counter interrupt and use the Arduino Serial class at the same[详细]
2023-03-27 14:03 分类:问答Convert two ASCII Hexadecimal Characters (Two ASCII bytes) in one byte
I want to convert two ASCII bytes to one hexadecimal byte. eg. 0x30 0x43 => 0x0C , 0x34 0x46 => 0x4F ...[详细]
2023-03-25 06:48 分类:问答GCC inline assembly : let compiler decide what register to use for temp value
I need to load 18h and output it to port 60h, following works (inside asm(\"\")). ldi r1, 0x18 ; 0x18 -> r1[详细]
2023-03-24 21:38 分类:问答AVR Studio 5: compile C++ code
When creating a project in AVR Studio 5, it creates a .c file with following content: #include <avr/io.h>[详细]
2023-03-15 06:02 分类:问答Help needed with the ADXL345 SPI bus to AtMega644
Hi I\'m trying to get the SPI bus on a AtMega644 to talk to the ADXL345 accelerometer. I\'m always getting a 0 back and I\'m not where I\'m going wrong. Any help is appreciated. I\'m using avr-gcc and[详细]
2023-03-13 06:57 分类:问答