[ATmega4809 Curiosity Nano Review] Development Environment Setup
[Copy link]
This post was last edited by Ansersion on 2019-10-6 18:50
Next, we will introduce the construction of ATMega4809 development environment, which is divided into the following steps:
1. Install MPLAB X IDE
2. Install the compiler XC8
3. Install the configuration tool MCC
4. Demonstrate a sample project
1. InstallMPLAB X IDE
(Reference: ATMega4809 Curiosity Nano Hardware User Guide )
Download the MPLAB X IDE installation package according to the corresponding operating system
(Download link https://www.microchip.com/mplab/mplab-x-ide )
During the installation process, select the language. In order to facilitate searching for reference information on search engines, English is selected here .
Since you need an account to log in to Microchip to use MPLAB X IDE , you need to configure the network in advance. Some companies or campus networks will set up a proxy server to access the Internet for network security, but generally, home use does not require a proxy server, so here we choose ( No Proxy ).
In order to save computer hard disk space, unnecessary components are removed here, and only MPLAB X IDE and 8 bit MCUs support package are checked.
After the installation is complete, you will be prompted to download and install the XC compiler and MCC configuration tool. Click Finish to automatically open the browser and jump to the corresponding interface.
2. Install the compiler XC8
(Reference: https://www.microchip.com/mplab/compilers )
Using the XC compiler requires a license . The official website provides the following three types of licenses:
Here the authorization method without "payment" is selected → _→ .
The contents of the license are as follows. The most critical item is that you need to log in and renew the authorization every month.
Just download the XC8 compiler for the corresponding operating system .
When installing the compiler, select the License type as "Free"
Check the following two options to configure environment variables
Then just click "Next" and the installation will be successful.
(Here is a link to the official XC installation guide for reference only: http://ww1.microchip.com/downloads/en/DeviceDoc/50002059H.pdf )
2.5 Login and register (optional)
Since I forgot the account and password I registered a long time ago , I need to re-register. If you already have an account and password, you can ignore this step and log in directly in MPLAB X IDE.
After opening MPLAB X IDE , I entered the login interface. For unknown reasons, the registration button hung up as soon as I clicked it, so I chose to use the browser to register on the official website.
After registration, you can log in
3. Install the configuration tool MCC
(Reference: https://www.microchip.com/mplab/mplab-code-configurator )
The official website provides 3 installation methods, here we choose method 2
In MPLAB X IDE , select Tools->Plugins->Available Plugins and check
MPLAB Code Configurator , then install .
After the installation is complete, restart MPLAB X IDE .
4. Demonstrate a sample project
Now let's create a new project to make the yellow LED flash continuously.
First, connect the development board to the computer. The IDE does a really good job, and a window pops up to recognize the development board.
In MPLAB X IDE , select File->New Project and then select Standalone Project .
Select chip type (as shown below)
Select the debugger tool (as shown below). Note that if the computer does not recognize the debugger, there will be no "SN:MCHP30..." option. If there is really no choice, just go to the next step and the subsequent configuration is also possible.
Select the compiler (as shown below)
Select the project directory and language encoding (as shown below)
According to the user manual, we know that the PF5 pin is connected to the yellow LED
Click the blue MCC icon to enter the MCC interface. Follow the post by dcexpert in the forum ( https://en.eeworld.com/bbs/thread-1092358-1-1.html )
First, set PF5 as output under "Pin Module", and then add the Delay library function under "System Module".
Click the blue MCC icon again to exit the MCC interface, open main.c , and type the code as shown in the figure
Compile and download (as shown below)
Finally, let's take a look at the running effect
Summarize
In general, MPLAB X IDE is a highly integrated integrated development environment that can be expanded through plug-ins. The MCC plug-in is a graphical configuration tool that saves a lot of complicated driver settings. For organizations or individuals with low-cost needs, the XC compiler can be used for free through monthly network signing. If more optimized functions are needed, the Pro version can also be purchased for a fee , providing users with multiple choices.
Finally, attach the project compression package
I have said so much, but I just want to clarify.
|