Microchip PIC32CM2532LE00064 Handleiding

Microchip Niet gecategoriseerd PIC32CM2532LE00064

Lees hieronder de ๐Ÿ“– handleiding in het Nederlandse voor Microchip PIC32CM2532LE00064 (43 pagina's) in de categorie Niet gecategoriseerd. Deze handleiding was nuttig voor 27 personen en werd door 2 gebruikers gemiddeld met 4.5 sterren beoordeeld

Pagina 1/43
User's Guide
Atmel START to MPLAB Harmony 3 Migration Guide
Introduction
This document describes the different steps to consider when porting an embedded application from Atmel
ยฎ START
to the MPLABยฎ Harmony 3 framework. It covers the following migration aspects:
โ€ข How to create a MPLAB Harmony 3 project under MPLAB X IDE and navigate through the MPLAB Harmony
Configurator (MHC).
โ€ข How to identify different elements that compose a project under Atmel START.
โ€ข How to port the system/driver/middleware configuration using MPLAB Harmony Configurator.
โ€ข Important aspects to consider when porting the project application layer.
To illustrate these aspects, this document references the example available on AtmelSAM D21 IO1 Xplained demo
START. Prior starting the migration process, ensure that the following prerequisites are met:
โ€ข Internet connection with access to https://start.atmel.com
โ€ข Latest version of MPLAB X IDE https://www.microchip.com/mplab/mplab-x-ide
โ€ข Latest version of MPLAB Harmony 3 https://github.com/Microchip-MPLAB-Harmony
โ€ข SAM D21 Xplained Pro board (optional)
โ€ข I/O1 Xplained Pro board (optional)
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 1
Table of Contents
Introduction.....................................................................................................................................................1
1. Creating MPLAB Harmony 3 Project Under MPLAB X IDE.................................................................... 3
2. Identifying the Resources Used in the Atmel START Project..................................................................8
3. Porting Driver Configuration from Atmel START...................................................................................13
4. Porting the System PINMUX Configuration from Atmel START............................................................19
5. Porting the System Clock Configuration from Atmel START.................................................................26
6. Porting and Adapting Middleware......................................................................................................... 35
7. Porting the Application Source Code.................................................................................................... 38
The Microchip Website.................................................................................................................................41
Product Change Notification Service............................................................................................................41
Customer Support........................................................................................................................................ 41
Microchip Devices Code Protection Feature................................................................................................41
Legal Notice................................................................................................................................................. 41
Trademarks.................................................................................................................................................. 42
Quality Management System....................................................................................................................... 42
Worldwide Sales and Service.......................................................................................................................43
User's Guide
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 2
1. Creating MPLAB Harmony 3 Project Under MPLAB X IDE
The first step in this process is creating a MPLAB Harmony 3 project under MPLAB X IDE. This new project will
enable access to the MPLAB Harmony 3 Configurator (MHC), and access the list of software modules, such as
peripheral libraries, services and middleware, which are available for the target SAM device.
Figure 1-1.โ€€MPLAB Harmony 3 Configurator Available Components
To create a project for the SAM D21J18A device, follow these steps:
1. Launch MPLAB X IDE.
2. In MPLAB X IDE, select (or click the New Project icon).File > New Project
3. In the New Project window, under Steps, select Choose Project, and then under Choose Project section,
select these options: for Categories select Microchip Embedded, and for Projects select 32-bit MPLAB
Harmony 3 Project.
Note:โ€€ If the option 32-Bit MPLAB Harmony 3 Project is not available, users need to install the MPLAB
Harmony 3 Configurator plug-in by selecting Tools > Plugins > Available Plugins before continuing with this
demonstration. MPLAB Harmony 3 Configurator overview is available for download at https://
microchipdeveloper.com/harmony3:mhc-overview.
User's Guide
Creating MPLAB Harmony 3 Project Under MPLAB X ...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 3
Figure 1-2.โ€€Creating an MPLAB Harmony 3-Based New Project
4. Click .Next
5. Select Framework Selection, and under Manage Framework section, enter Framework Path (Path to the folder
in which the MPLAB Harmony 3 packages are downloaded). For this demonstration, the MPLAB Harmony 3
packages are already downloaded at D:\microchip\github\h3.
Figure 1-3.โ€€New Project - Framework Selection
6. Click .Next
7. Select Project Settings, and under Name and Location section enter MPLAB Harmony 3 new project details:
โ€“ Location: Indicates the path to the root folder of the new project. All project files will be placed inside this
folder.
โ€“ Folder: Indicates the name of the MPLAB X IDE folder.
โ€“ Name: Enter name of the project. This name will be shown in the MPLAB X IDE.
โ€“ Path: It is read-only box. It will update as and when users make changes to other entries.
User's Guide
Creating MPLAB Harmony 3 Project Under MPLAB X ...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 4
Figure 1-4.โ€€New Project Wizard Step 3
8. Click .Next
9. Select Configuration Settings, and then enter details as given below:
โ€“ Name: Enter the configuration name.
โ€“ Target Device: Choose a device name.
10. Click .Finish
Figure 1-5.โ€€New Project Wizard Step 4
The new MPLAB Harmony 3 project will be launched.
Note:โ€€ After clicking the Finish button, if MHC does not launch, the user can launch it by selecting Tools > Embedded
> MPLABยฎ Harmony 3 Configurator from the menu bar of the MPLAB X IDE.
User's Guide
Creating MPLAB Harmony 3 Project Under MPLAB X ...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 5
Figure 1-6.โ€€New MPLAB Harmony 3 Project
The software modules associated with the project configuration are seen by selecting Tools > Embedded > MPLAB
Harmony 3 Configurator.
Figure 1-7.โ€€Accessing MPLAB Harmony 3 Configurator
The associated MPLAB Harmony 3 Configurator list will be displayed as shown in the figure below.
User's Guide
Creating MPLAB Harmony 3 Project Under MPLAB X ...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 6
Figure 1-8.โ€€MPLAB Harmony 3 Configurator - Available Component List
User's Guide
Creating MPLAB Harmony 3 Project Under MPLAB X ...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 7
2. Identifying the Resources Used in the Atmel START Project
Before porting the application, users need to identify the software modules that compose the application. As both
Atmel START and MPLAB Harmony 3 frameworks provide a graphical configuration interface, hence it is simple to
identify the different drivers and middleware modules that are used by the application and compare them to the
available MPLAB Harmony 3 modules.
Figure 2-1.โ€€Atmel START Graphical Configuration Interface
โ€ข
๎˜๎˜ƒ
B
๎˜‚๎˜ƒ
๎˜๎˜Š๎˜‰๎˜‡๎˜ˆ๎˜‹ ๎˜„๎˜…๎˜‚๎˜ƒ๎˜†๎˜‹๎™„๎™ฒ ๎™ฏ๎œ‚๎™…๎™ ๎˜ฎ๎˜ผ๎˜‹๎™œ๎™–๎˜ก๎˜บ๎˜“๎›ณ๎šฝ ๎™จ ๎™” ๎›๎™ฐ๎›‡ ๎›”๎›๎›ฃ๎šฃ๎™น๎šฆ๎˜“๎œ‚ ๎™—๎œ‚ ๎šป๎™‡๎™ซ๎›ด ๎›“๎œ‚๎›‘
๎˜จ๎˜ฉ๎˜ช ๎˜๎˜ก๎˜…๎˜“๎˜ˆ๎˜ช ๎˜ƒ๎˜‚๎˜๎˜„๎˜…
๎˜…๎˜‘๎˜’ ๎˜‚๎˜Š๎˜†๎˜Œ๎˜‹ ๎˜ƒ๎˜Ž๎˜‰๎˜„๎˜๎˜๎˜ƒ๎˜’ ๎˜‡ ๎˜ˆ๎˜๎˜๎˜’
โ– ๎™ฅ๎˜ซ๎˜๎œ‚
โ–ก ๎™Ÿ๎›Ž๎™ž๎šŽ๎œ‚
โ–ก๎›๎˜ช
โ–ก S๎˜๎˜‰๎˜‡๎˜ˆ
-B ๎˜˜๎˜›๎˜ช๎˜†๎˜๎˜๎˜‰๎˜ฃ๎˜Š๎˜š๎˜—๎˜™๎˜ฃ๎˜๎˜Ž๎˜ช ๎˜ ๎˜‘๎˜•๎˜Œ๎˜‹๎˜ช๎˜”๎˜–๎˜’๎˜ ๎˜‡๎˜ช
๎˜‚๎˜ช ๎˜„๎˜๎˜ช๎˜ƒ๎˜ข๎˜ฆ๎˜ž๎˜ช๎˜œ๎˜ค๎˜Ÿ๎˜ฅ๎˜ง๎˜ช
๎™˜๎™ฆ ๎™ธ๎™ต๎™• ๎™ฌ ๎˜œ๎˜พ๎œ‚๎™™๎™ฑ๎˜ ๎™Ž๎™๎˜ฑ๎˜ฟ๎™‘๎˜๎™ˆ๎™ง๎™ก๎œ‚
๎šผ๎œ‚
GCL< ๎˜๎˜‚๎˜ƒ ๎˜๎˜‚๎˜ƒ ๎˜๎˜‚๎˜ƒ
๎˜‚๎˜๎˜ƒ๎˜ ๎˜…๎˜‡๎˜Š๎˜Œ๎˜๎˜Ž๎˜๎˜‰๎˜„๎˜ˆ๎˜‹๎˜‡๎˜†๎˜ 0
๎šฑ๎˜… ๎›ผ๎›ฝ๎œ‚๎˜ƒ๎›ป๎œ‚ ๎›• ๎™๎š๎™ฟ๎™ƒ๎›œ๎œ‚๎›ญ๎š๎œ‚๎›พ๎˜™๎›ง๎˜น๎˜ด ๎™›๎œ‚wmor ๎˜ต๎›ช๎šถ๎š๎œ‚๎›ฏ๎œ‚๎˜—๎šฏ๎šง๎šจ๎›ค๎œ‚ ๎›ฎ๎™ญ๎šท๎šบ๎œ‚๎˜˜๎˜‚๎œ‚ ๎š‘๎œ‚๎˜Š๎˜ฏ ๎˜ง ๎šƒ๎˜‹๎œ‚๎™ถ๎˜ƒ๎›ƒ๎š˜๎š‹๎œ‚๎˜™๎››๎š’๎›ฟ๎˜ƒ๎˜˜๎˜‚๎œ‚ ๎šค๎˜‘๎œ‚๎˜Ž๎˜‚๎˜‘๎œ‚๎› ๎˜จ๎˜‚๎š‰๎›Ÿ๎œ‚๎›ฉ๎˜…๎˜ฆ๎œ‚๎›บ๎™บ๎˜—๎›ต๎›ฌ๎œ‚๎›ฑ๎˜Ž๎œ‚๎›ฐ ๎›ฒ๎œ‚ ๎™‰๎œ‚๎˜ถ๎˜‚๎™ป ๎šฅ๎šŠ๎œ‚๎™๎œ‚๎š‡๎›‰๎›… ๎›จ๎˜…๎š“๎œ‚๎™๎™Š๎™ฎ๎™’๎œ‚ ๎˜ฅ๎›€๎›ซ๎™ผ๎š„๎˜ป๎˜ฌ๎œ‚
๎™ณ๎š”๎œ‚ ๎˜๎˜ท๎˜ฐ๎˜Œ๎œ‚๎™ท๎˜–๎šŸ๎œ‚๎˜‡๎›™๎›Š๎œ‚๎šพ๎›ท๎›ž๎˜š๎œ‚๎š๎œ‚๎š…๎˜†๎˜๎›„๎šž๎š™๎˜’๎œ‚๎›š๎œ‚๎šน ๎˜›๎˜•๎œ‚๎˜๎˜ˆ๎˜–๎˜†๎˜๎œ‚๎šฉ ๎˜ข๎œ‚๎˜”๎™‚๎›‹๎šš ๎˜ธ๎œ‚ ๎˜ž ๎˜Ÿ๎œ‚๎˜ฒ๎˜Œ๎˜†๎˜๎œ‚ ๎˜๎šก๎˜” ๎˜š๎œ‚๎˜๎šฐ ๎›–๎œ€๎œ‚๎œ๎›ธ๎˜’ ๎˜๎šˆ๎˜•๎œ‚ ๎š‚๎œ‚๎›๎šช๎›ˆ๎›น๎šด๎˜๎œ‚ ๎˜ˆ๎š ๎œ‚๎˜‰๎›Œ๎œ‚๎™€๎˜ณ๎œ‚ ๎˜๎œ‚๎˜ฃ๎˜‰๎šซ๎š•๎œ‚๎˜‰๎š›๎›—๎› ๎š†๎™š๎œ‚๎™ฝ๎˜‡๎˜‡๎šฒ๎šญ๎š€๎œ‚๎™ข๎˜๎šฎ๎˜๎œ‚๎™๎™ค๎˜ˆ๎œ‚๎™พ๎›†๎œ‚
๎›‚ ๎›ถ๎šณ๎šข๎›ฅ๎œ‚ ๎›ก๎œ‚ ๎›ฆ ๎š–๎œ‚๎˜ฉ๎œ‚ ๎šฌ๎šธ ๎š—๎œ‚๎˜  ๎˜„๎šฟ๎›’๎šต๎š ๎›˜๎™†๎™‹๎˜ญ๎œ‚๎™ด ๎˜ฝ๎œ‚๎™ช๎˜ค๎œ‚๎˜Š๎™ฃ๎˜„๎›ข๎šœ๎œ‚ ๎™Œ๎œ‚๎˜„๎˜‚๎šŒ๎œ‚๎™“๎™ฉ๎œ‚
Figure 2-2.โ€€Harmony 3 Graphical Configuration Interface (MHC)
Note:โ€€ Some applications include additional software functions or middleware that are not part of Atmel START.
Therefore, it is important to review the full application flowchart or project architecture to identify them.
Follow these steps while using the SAM D21 I/O1 example from Atmel START as a reference.
1. In Atmel Studio 7, open the Atmel START project to be ported by selecting Project > Re-Configure Atmel Start
Project.
User's Guide
Identifying the Resources Used in the Atmel ...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 8
Figure 2-3.โ€€Reconfiguring Atmel START Project
Note:โ€€ The project can also be opened by loading its file at ..atstart/.atzip https://start.atmel.com/
Atmel START main window showing Load Project tab is displayed.
Figure 2-4.โ€€Load Project From a File Under Atmel START
2. When project is loaded, click on the Dashboard tab and identify the Atmel START drivers and its configuration.
User's Guide
Identifying the Resources Used in the Atmel ...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 9
Figure 2-5.โ€€Driver Identification Under Atmel START
3. Check the application code and application flowchart to identify whether any additional services and
middleware are required. The figure below illustrates the SAM D21 I/O1 flowchart.
Figure 2-6.โ€€Additional Service Middleware Identification Using a Flowchart
Main
Atmel Start Init
Temperature Sensor
init
UART init
ADC Enable
Delay ms
Read temperature
Read light from ADC
Print information
System Delay ms
required
Printf / STDIO redirect
4. If MPLAB Harmony Configurator is not opened, from MPLAB X IDE open the MPLAB Harmony 3 Configurator
by selecting Tools > Embedded > MPLAB Harmony 3 Configurator.
User's Guide
Identifying the Resources Used in the Atmel ...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 10
Figure 2-7.โ€€Accessing MPLAB Harmony 3 Configurator
5. Search for software module availability in Harmony 3 Configurator, and then drag and drop it into the Project
Graph window.
Figure 2-8.โ€€Identifying Software Module in MHC
The table below provides the drivers and middleware used for this demonstration.
User's Guide
Identifying the Resources Used in the Atmel ...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 11
Table 2-1.โ€€Drivers and Middleware
ATMEL START Module Harmony 3 Module
Drivers IO1_LIGHT_SENS ADC
I2C SERCOM2
EDBG_COM SERCOM3
Systick (implicit) SYSTEM > SYSTICK
Middleware AT30SE75X None
STDIO Redirect STDIO
Note:โ€€ Specific development is required for AT30SE75X. Other drivers, system services, and middleware are
available under MPLAB Harmony 3.
User's Guide
Identifying the Resources Used in the Atmel ...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 12
3. Porting Driver Configuration from Atmel START
To port a driver from Atmel Studio to MPLAB Harmony 3 is a straightforward operation as it relies on the comparison
of Atmel START and MPLAB Harmony Configurator Graphical interfaces.
Figure 3-1.โ€€Atmel START to MPLAB X Driver Support
Follow these steps for the SAM D21 I/O1 Xplained demonstration:
1. Add peripheral library (drivers) to the MPLAB Harmony 3 project by dragging them from the Available
Component list to the Project Graph section.
Figure 3-2.โ€€Add Peripheral Driver from the Available Component List
2. Configure all the MPLAB Harmony 3 peripheral libraries according to their equivalent driver in Atmel START.
Note:โ€€ Specific Atmel START driver configurations can be seen by clicking individually on each of the driver
component in the application dashboard interface.
User's Guide
Porting Driver Configuration from Atmel ST...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 13
Figure 3-3.โ€€Access Driver Configuration in Atmel START
โ€“ ADC peripheral Library (IO1_LIGHT_SENS) configuration.
User's Guide
Porting Driver Configuration from Atmel ST...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 14
Figure 3-4.โ€€Port ADC Driver Configuration
โ€“ SERCOM3 peripheral Library (EDBG_COM) configuration
User's Guide
Porting Driver Configuration from Atmel ST...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 15
Figure 3-5.โ€€Port SERCOM3 Driver Configuration
โ€“ SERCOM2 peripheral Library (I2C) configuration
User's Guide
Porting Driver Configuration from Atmel ST...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 16
Figure 3-6.โ€€Port SERCOM2 Driver Configuration
โ€“ SYSTICK Service configuration
Figure 3-7.โ€€Enable Service Under MHC
After generating the project source code from the MHC interface by clicking or selecting MHC >
Generate Code, the peripheral libraries (PLIBs) configuration can be found in the following project directories:
User's Guide
Porting Driver Configuration from Atmel ST...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 17
Figure 3-8.โ€€Generated MHC Project Architecture
PLIBs
headers
PLIBs
sources
The API function definition used by the application can be found in the peripheral library header files.
Figure 3-9.โ€€Peripheral Libraries API Location
User's Guide
Porting Driver Configuration from Atmel ST...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 18
4. Porting the System PINMUX Configuration from Atmel START
Porting an application PINMUX configuration from Atmel Studio to MPLAB Harmony 3 is a straightforward operation
as it relies on comparison as each framework graphical interface offers similar capabilities.
Figure 4-1.โ€€Atmel START and MHC Pin Configuration Interface Comparison
Follow these steps for the SAM D21 IO1 Xplained demonstration:
1. In Atmel START, click on the tab and identify which I/O pins are configured and used in thePINMUX
application.
User's Guide
Porting the System PINMUX Configuration from ...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 19
Figure 4-2.โ€€Identify I/O Pins Configuration Under Atmel START
Note:โ€€ The configuration of each pin is available by clicking on it in the PINMUX configurator table.
Figure 4-3.โ€€Identify I/O Pins Configuration Under Atmel START (Continued)
2. In MPLAB X IDE, select MHC > Tools > Pin Configuration to open the project pin configurator interface.
User's Guide
Porting the System PINMUX Configuration from ...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 20
Figure 4-4.โ€€Accessing MHC Under MPLAB X
Note:โ€€ The following tab in the MHC interface enables the customization of the application pin configuration.
Figure 4-5.โ€€Accessing Pin Configuration Windows Under the MHC
3. Port the I/O pin configuration from Atmel Studio to the MHC Pin Setting tab.
โ€“ SERCOM 2 I/O settings
User's Guide
Porting the System PINMUX Configuration from ...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 21
Figure 4-6.โ€€SERCOM 2 I/O Settings
โ€“ SERCOM 3 I/Os settings
User's Guide
Porting the System PINMUX Configuration from ...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 22
Figure 4-7.โ€€SERCOM 3 I/O settings
โ€“ ADC I/Os settings
User's Guide
Porting the System PINMUX Configuration from ...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 23
Figure 4-8.โ€€ADC I/O Settings
4. Verify that the MHC pin diagram is aligned with the initial Atmel START project pin diagram.
Figure 4-9.โ€€Pin Configuration Verification
After regenerating the project source from the MHC interface by clicking , the port initialization routine
executed during program initialization can be found in the following project files. This initialization routine is
automatically generated by the MHC according to the user configuration entered in the graphical interface.
User's Guide
Porting the System PINMUX Configuration from ...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 24
Figure 4-10.โ€€MHC Generated Pin Configuration
Note:โ€€ During application run-time, the PORT configuration can be changed by calling APIs from the MPLAB
Harmony 3 PORT PLIB.
User's Guide
Porting the System PINMUX Configuration from ...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 25
5. Porting the System Clock Configuration from Atmel START
The porting of an application clock configuration from Atmel Studio to MPLAB Harmony 3 is a straightforward
operation as it relies on the comparison of both framework graphical interfaces which offer similar capabilities.
Figure 5-1.โ€€Atmel START and MHC Clock Configuration Interface Comparison
1. In Atmel START, click the tab and identify different clock elements used in the application and theirPINMUX
settings.
User's Guide
Porting the System Clock Configuration from ...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 26
Figure 5-2.โ€€Identify Project Clock Configuration Under Atmel START
Note:โ€€ Additional information on the settings for a specific clock element can be retrieved by clicking on the
associated blue gear wheel button.
Figure 5-3.โ€€Access Clock Element Settings Under Atmel START
2. To open the project pin configurator interface, in MPLAB X IDE, select MHC > Tools > Clock Configuration.
User's Guide
Porting the System Clock Configuration from ...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 27
Figure 5-4.โ€€Access Clock Configuration Interface Under MHC
3. Port each clock component configuration from Atmel START to the MHC Clock view.
โ€“ 8 MHz Internal Oscillator (OSC8M)
User's Guide
Porting the System Clock Configuration from ...
ยฉ 2019 Microchip Technology Inc. DS70005413A-page 28


Product specificaties

Merk: Microchip
Categorie: Niet gecategoriseerd
Model: PIC32CM2532LE00064

Heb je hulp nodig?

Als je hulp nodig hebt met Microchip PIC32CM2532LE00064 stel dan hieronder een vraag en andere gebruikers zullen je antwoorden




Handleiding Niet gecategoriseerd Microchip

Handleiding Niet gecategoriseerd

Nieuwste handleidingen voor Niet gecategoriseerd