Группа: Участник
Сообщений: 46
Регистрация: 2-04-08
Пользователь №: 36 402
При компиляции файла проги, помимо кода, который написан в основном окне, в asm файле появляются макросы инициализации ОЗУ и другие. Как избавиться от этой инициализации, съедается место и по включению, хоть и небольшая, но есть задержка?
Группа: Участник
Сообщений: 163
Регистрация: 10-10-05
Пользователь №: 9 463
In every program the CodeVisionAVR C compiler automatically generates a code sequence to make the following initializations immediately after the AVR chip reset: 1. interrupt vector jump table 2. global interrupt disable 3. EEPROM access disable 4. Watchdog Timer disable 5. external RAM access and wait state enable if necessary 6. clear registers R2 … R14 7. clear the RAM 8. initialize the global variables located in RAM 9. initialize the Data Stack Pointer register Y 10. initialize the Stack Pointer register SP 11. initialize the UBRR register if necessary
The automatic generation of code sequences 2 to 8 can be disabled by checking the Use an External Startup Initialization File check box in the Project|Configure|C Compiler|Code Generation dialog window. The C compiler will then include, in the generated .asm file, the code sequences from an external file that must be named STARTUP.ASM . This file must be located in the directory where your main C source file resides. You can write your own STARTUP.ASM file to customize or add some features to your program. The code sequences from this file will be immediately executed after the chip reset. A basic STARTUP.ASM file is supplied with the compiler distribution and is located in the C:\cvavr2\bin\