原创 AVRSTUDIO调试点滴-Creatinganewproject

2007-3-17 11:20 3299 4 4 分类: MCU/ 嵌入式


  1. Create a new project by selecting 'New Project.' from the Project menu.
    This will open the Project Wizard.

     


     



  2. Select AVR GCC as the 'Project Type', specify a project name and select a location for the project. An initial file with the same name as the project will be created and added to the project by default. If you don't want this file to be added to the project you can just clear the 'Create Initial File' box. If you want to change the name of the initial file, just edit the 'Initial File' text.
    Press 'Finish' when you are satisfied with the settings.

     

  3. The Project Tree will be set up. Notice that the initial file created in step 2. has been added to the 'Source Files' tree node.  All source files will be placed under this node regardless of their position on disk. Header files will be put under 'Header Files'.
    Also, the initial file has been opened in the editor.

     

  4. Now, write the following code into the open editor window:

    #include <avr/io.h>
    int main(void)
    {
      DDRB = 0xFF;
      while (1)
      {
         PORTB = PIND;
      }
    }

     

  5. Compile the project by pressing the compile button


     


     
    You should now be ready to start debugging the code by pressing the 'start debugging button'. Change build options by opening the Configuration Options Dialogue.
     

 

PARTNER CONTENT

文章评论0条评论)

登录后参与讨论
我要评论
0
4
关闭 站长推荐上一条 /1 下一条