AVRWARE++ Development Notes 9: Using Atmel Studio to learn C language

Publisher:快乐兔子Latest update time:2019-07-13 Source: eefocusKeywords:AVRWARE++  Atmel  Studio Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    This blog post explains how to learn C language using Atmel Studio. To learn C language programming, we can choose from many development environments, such as TC, VC or Eclipse, etc. If you want to get familiar with the Atmel Studio development environment while learning C language, then this blog post can help you. This blog post introduces how to use Atmel Studio as a C language development and simulation environment, without hardware support. Its purpose is to learn C language programming and get familiar with the Atmel Studio development environment.


    Specific steps are as follows:

    1. Start Atmel Studio, File-New-Project, and a dialog box as shown below will appear. Select the GCC C Executable Project project type and enter the name and path.

picture 

    2. After clicking the "OK" button, you will be asked to select the chip type. Here we choose ATmega168PA.

 picture  

    3. Next, we right-click on the project and select Properties in the pop-up menu.

 picture 

    4. In the dialog box shown in the figure below, we select Toolchain and set the optimization level to level 0, which means no optimization.

 picture 


    5. In the dialog box shown in the figure below, we select the simulation type as AVR Simulator, which is software simulation.

picture 


    6. After completing the above work, we can enter the program. For example, if we want to solve the sum of 2 numbers, the program is as follows:

picture 


    7. We click the "Start Debugging" button to compile and run the program, as shown below:

 

picture 

    8. Then click the "Pause" button to stop the program.

picture 


    9. The program is now paused in the while loop. Open the Localc form and we can see the running results, as shown in the figure below.

 

picture 

    In this way, through the above methods, we can verify most of the programs in the current C language textbooks, and further familiarize ourselves with and master the Atmel Studio development environment. Of course, I still recommend that it is best to simulate on hardware. For example, we can first adjust the serial port, and then use the serial port to implement the printf and scanf functions, which is also a very good choice.

Keywords:AVRWARE++  Atmel  Studio Reference address:AVRWARE++ Development Notes 9: Using Atmel Studio to learn C language

Previous article:AVRWARE++ Development Notes 10: Selection of crystal frequency
Next article:AVRWARE++ Development Notes 8: Atmel Studio removes spell check

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components
Guess you like

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号