I have been using winavr as the avr development tool before. Versions after AVRstudio 5 directly include the GCCAVR tool chain. The development environment has also changed a lot. Overall, it is still very powerful, so I have been following the version updates. The original program cannot be compiled by directly copying it. The most common error is this:
错误 __builtin_avr_delay_cycles expects an integer constant.
After searching, it was found that it was caused by the header file version update. The description of line 214 of the delay.h file is as follows:
Note: The new implementation of _delay_us(double __us) with
__builtin_avr_delay_cycles(unsigned long) support is not backward compatible.
User can define __DELAY_BACKWARD_COMPATIBLE__ to get a backward compatible delay.
Also, the backward compatible
algorithm will be chosen if the code is compiled in a freestanding
environment (GCC option \c -ffreestanding), as the math functions
required for rounding are not available to the compiler then.
The solution is obvious. The new definition is incompatible with the previous one, so just add define __DELAY_BACKWARD_COMPATIBLE__ before calling the header file.
Finally, I have to sigh that AVR is out of date and has no advantages anymore. I don't need to consider 8-bit AVR for future projects. The emulator is still so expensive. Alas.
Previous article:Translated and modified AVR-gcc3.3 makefile. (Usage: make clean /make all)
Next article:CPLD and AVR communication PWM control program
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Brief Analysis of Automotive Ethernet Test Content and Test Methods
- How haptic technology can enhance driving safety
- Let’s talk about the “Three Musketeers” of radar in autonomous driving
- Why software-defined vehicles transform cars from tools into living spaces
- Start with a Routine
- Share a reference book on servo motor drive
- Is FPGA a big deal in the field of artificial intelligence?
- 【GD32F310G-START】Voltage meter
- C language algorithm to calculate the age of beautiful women
- LOTO virtual oscilloscope about trigger sensitivity function
- [ST60 short-distance test] Part 2: Communication rate test
- PT4115 cannot be completely shut down
- STM32 Linux development board recommendation | PHYTEC development board: Help you reduce development risks and improve product stability
- FAQ|Beineng International's new glass breakage detection solution