MPLAB Harmony Integrated Software Framework

2y ago
41 Views
2 Downloads
2.75 MB
8 Pages
Last View : 4d ago
Last Download : 3m ago
Upload by : Aydin Oneil
Transcription

MPLAB HarmonyMPLAB HarmonyIntegrated Software FrameworkA Novel Approach to Embedded Software Developmentwww.microchip.com/harmony

MPLAB HarmonyIntroductionMPLAB Harmony Configurator (MHC)MPLAB Harmony is a flexible, abstracted, fullyintegrated firmware development environment for PIC32microcontrollers. It enables robust development ofinteroperable, RTOS-friendly libraries with quick andextensive Microchip support for third party softwareintegration. MPLAB Harmony includes a set of peripherallibraries, drivers and system services that are readilyaccessible for application development. The codedevelopment format allows for maximum re-use andreduces time-to-market. It features the MPLAB HarmonyConfigurator (MHC) plug-in that provides a graphical wayto select and configure all MPLAB Harmony components,including middleware, system services and peripheralswith ease.The MPLAB Harmony Configurator plug-in seamlesslyintegrates with MPLAB X Integrated DevelopmentEnvironment (IDE) to provide an easy setup andconfiguration experience with your chosen PIC32microcontroller. It offers a simple graphical representationof the selected PIC32 MCU and allows you to quicklyarrange the software modules that your application mightneed without a tedious hands-on setup of registers orconfiguration bits.Benefits Faster time-to-marketImproved code interoperabilitySimplified supportMPLAB Harmony Configurator (MHC) for enhanceduser experience Improved 32-bit scalability Enhanced third-party software integrationHighlights of MHC Graphical Clock ConfiguratorGraphical Pin ManagerMPLAB Harmony Graphics ComposerOffers simple graphical representation of PIC32 MCUsEases configuration of middleware such as TCP/IP,USB, Graphics and Bluetooth without the need to writesource code Enables seamless integration of third-party RTOS orlibraries into your application with the click of a mouse Dynamic help window provides relevant informationinstantly about the selected librariesPin ManagerGraphical Clock Configurator2MPLAB Harmony Integrated Software FrameworkMPLAB HarmonyGraphics Composer

MPLAB HarmonyPIC32 Software Development Tools Available with MPLAB HarmonyApplications Bluetooth audioand SPP CAN applications Graphicsapplications TCP/IP applicationsand utilities USB applications CryptoOperating SystemAbstract Layer (OSAL) OSAL interface with“basic” and “none”implementation ThreadX embOS FreeRTOS OpenRTOS Micrium μC/OS-II Micrium μC/OS-IIIMiddleware/Software Libraries DevelopmentSoftwareDevice Drivers ADC Audio Codecs Ethernet media accesscontroller Ethernet PHY interface Controllerless graphics Epson LCD controller Non-volatile memory SPI, UART, CAN2.0B, highspeed USB Timer, parallel master portGraphicsTCP/IPUSBCryptographiclibrariesFile systemsSystem ries (PLIBs) MPLAB X IDE MPLAB XC32 MPLAB HarmonyConfigurator(MHC) Plug-In MPLAB HarmonyGraphicsComposer(MHGC) Board SupportPackages (BSP)Third-PartySoftware Networking Security Cloud servicesAdditional software components plannedMPLAB Harmony Configurator (MHC)MPLAB Harmony Block DiagramApplication(s)Plug-InRTOS(Third BPLIBSoftwareFrameworkHardwareApplication Layer Implements desired overall behavior Abstracted hardware access Allows for easy port across PIC32 partsCommon System Services Provides common functionality to avoid duplicationand conflicts Eliminates complex interactions and interdependenciesbetween modules OSAL provides OS compatibility and interface Manages shared resources Supports low-level configuration and boardsupport packagePeripheral Libraries (PLIB) Layer Provide functional interface for PIC32 scalability Implements part-specific featuresMiddleware Layer Implements complex libraries and protocols(USB, TCP/IP, file systems, graphics) Provides a highly-abstracted application program interface Libraries are thread-safe and RTOS-ready Built-on drivers, PLIBS, system services Supports third-party library integrationDevice Driver Layer Provides highly abstracted interface to peripherals Controls access to the peripherals Manages multiple hardware instances and softwareclients with select drivers Manages peripheral state and multipleperipheral instances Accesses hardware via PLIB Supports blocking or non-blocking codeMPLAB Harmony Integrated Software Framework3

MPLAB Harmony SolutionsConnectivityTCP/IP Network Stack and Wi-Fi SupportCAN Driver and CAN Peripheral LibraryThe MPLAB Harmony TCP/IP Stack provides a foundationfor embedded network applications by handling most ofthe interaction required between the physical networkport and your application. It includes modules for severalcommonly used application layers, including HTTP forserving web pages, SMTP for sending e-mails, SNMPfor providing status and control, Telnet, TFTP, Serial-toEthernet and much more.    Multiple interfaces (Ethernet and/or Wi-Fi)    Dual stack with IPv4 and/or IPv6 support    Fully dynamic    RTOS friendly, with easy RTOS integrationThe CAN Static Driver provides a high-level interfaceto manage the CAN module on the Microchipmicrocontrollers. It features API to initialize the CANmodule and baud rate in addition to simple transmit andreceive functionality.The Wi-Fi software library, in conjunction with theMRF24WG0MA module, allows an application to:    Join an existing 802.11 Wi-Fi network    Create a 802.11 Wi-Fi networkUSB LibrariesThe USB Device Stack provides you with a frameworkto design and develop a wide variety of USB devices. Achoice of full-speed only or full-speed and high-speedUSB operations are available, depending on the selectedPIC32 microcontroller.The USB Device Stack features:    Support for different USB device classes (CDC, audio,HID, MSD and generic)    Support for multiple instances of the same class in acomposite device    Support for multiple configurations at different speeds    Support for full-speed and high-speed operationThe USB Host Layer in the MPLAB Harmony USB HostStack performs the tasks of enumerating an attacheddevice and interfacing the HCD.The USB Host Stack features:    Support for multi-configuration and compositeUSB devices    Support for VID PID and class, subclass andprotocol devices    Concise API simplifies application development    Support for low-speed, full-speed, and high-speedUSB devicesUser ApplicationCDC#1HIDCDC#2MSDHostUSB Device LibraryArchitecture4HIDHostHost LayerDevice LayerUSB Controller Driver (USBCD)CDCHostHCDRoot HubUSB Host LibraryArchitectureMPLAB Harmony Integrated Software FrameworkPIC32 Bluetooth Stack Library and Serial PortProfile (SPP)The PIC32 Bluetooth Stack Library is provided in binaryform and consists of a large number of routines thatenable the interface of a PIC32 system to a Bluetoothradio via a Hardware Communication Interface (HCI)controller and a UART port. The communication is enabledby a Simple Secured Pairing (SSP) and data is transmittedthrough the Bluetooth Serial Port Profile (SPP). BluetoothSPP—a wireless replacement to the serial port—is thebasic data transfer profile that defines the necessaryrequirements for setting up emulated serial portconnections between two peer Bluetooth devices.Application LayerService DiscoveryApplication Profile(SDAP)Serial PortProfile(SPP)Service DiscoveryProtocol(SDP)Radio c Link Control and Adaption Protocol(L2CAP)Host Controller Interface (HCI)Link Management Protocol (LMP)ControllerInterfaceBaseband Link Controller (BLC)Bluetooth RadioUser ApplicationMSDThe CAN Peripheral library provides a low-level abstractionof the CAN module on Microchip microcontrollers with aconvenient C language interface. It can be used to simplifylow-level access to the module without the necessity ofinteracting directly with the module’s registers, thus hidingdifferences from one microcontroller variant to another.PIC32 Bluetooth Basic StackRadioModule

MPLAB Harmony SolutionsHuman Machine Interface (HMI)Graphics Library and MPLAB Harmony GraphicsComposer (MHGC) ToolThe Graphics Library is a free, modular library optimizedfor Microchip’s 32-bit microcontrollers. The library includesfeatures such as alpha blending, gradient fills and antialiased fonts. Applications can take advantage of thesefeatures to enhance the user experience while deliveringperformance required by the application.The Graphics Library features: Up to 16-bit or 65K colors 2D objects such as line, circle, text, rectangle,polygon or bar 3D objects such as buttons, panels, window, groupbox or sliders Image, animation Resistive touch screen, keypad Multiple fontsThe MPLAB Harmony Graphics Composer is a graphicsuser interface design tool that is integrated as part ofthe MPLAB Harmony Configurator (MHC). This tool allowsyou to easily configure and visually design for the MPLABHarmony Graphics Primitive Library and the MPLABHarmony Graphics Object Layer.The MPLAB Harmony Graphics Composer features: What You See Is What You Get (WYSIWYG) design Integrated with MHC Configuration tool Multi-platform Windows , Linux and Mac OS Enhanced design tools Drawing grids, auto widget alignment and otherdrawing shortcuts/productivity features Cut, copy and paste propertiesMPLAB Harmony Graphics ComposerTouch Controller Driver and Touch SystemServices LibraryThe MPLAB Harmony Touch Controller Driver provides ahigh-level interface to the MTCH6301 touch controllerdevice. This driver provides application routines to read thetouch input data from the touch screen.The Touch System Service provides a simple interface tomanage the touchscreen drivers. It implements the coreinterface routines for the Touch System Service by utilizingthe Microchip Graphics Library. This library provides a lowlevel abstraction of the Device Control System ServiceLibrary that is available on the Microchip family of PIC32microcontrollers with a convenient C language interface.Digital Audio and BluetoothPIC32 Bluetooth Audio Package (SW320024-1HPM)USB Audio Device LibrariesThis complete software package enables audio playbackwith remote control in a Bluetooth application. It includesBluetooth Audio SBC decoder and features Bluetoothaudio protocols and profiles such as Serial Port Profile(SPP), Advanced Audio Distribution Profile (A2DP), AudioVideo Remote Control Profile (AVRCP), Audio VideoDistribution Transport Protocol (AVDTP) and Audio VideoControl Transport Protocol (AVCTP).The MPLAB Harmony USB Audio Device Libraries featureroutines to implement a USB Audio Class 1.0 and USB AudioClass 2.0. The libraries offer various services to the USBaudio device to communicate with the host by abstractingUSB specification details and simplifying the implementation.Microchip offers MP3 (SW320022-1HPM), AAC(SW320023-1HPM) and WMA (SW320025-1HPM) decoderlibraries that are designed and optimized for all PIC32devices and seamlessly integrates with MPLAB HarmonySoftware Framework.Note: The PIC32 Bluetooth Audio Package, MP3, AAC and WMA libraries are notincluded in the free download of MPLAB Harmony Framework and must be purchased.For information on purchasing please visit www.microchip.com/harmony.Application LayerAdvanced Audio Distribution Profile (A2DP)/A/V Remote Control Profile (AVRCP)Audio/Video Distribution Transport Protocol (AVDTP)/Audio/Video Control Transport Protocol (AVCTP)Service DiscoveryApplication Profile (SDAP)Serial PortProfile (SPP)Service Discovery Protocol(SDP)RFCOMMProfilesProtocolsLogic Link Control and Adaption Protocol (L2CAP)Host Controller Interface (HCI)Link Management Protocol (LMP)ControllerInterfaceBaseband Link Controller (BLC)Bluetooth RadioPIC32 Bluetooth Audio StackMPLAB Harmony Integrated Software Framework5

MPLAB Harmony SolutionsBasic Libraries, System Services and OSALPeripheral LibrariesSystem ServicesPeripheral libraries provide a set of C language functionsfor setting up and controlling PIC32 MCU peripherals. Thefunction implementations are provided as “in-line” headersand pre-built binaries. Their implementations may changefrom one PIC32 MCU family to another, but the functionnames and data types remain the same to make it easy toport code from one PIC32 MCU to another.MPLAB Harmony System Services are responsible formanaging shared resources so that other modules, suchas drivers, middleware and applications, do not conflict onshared resources. Some of the system services providedby MPLAB Harmony include clock, console, debug, devicecontrol, DMA, interrupt, messaging, ports, random numbergenerator, reset, timer and watch-dog timer.Math LibrariesBootloader LibraryThe DSP Fixed-Point Math Library contains buildingblock functions for developing digital signal processingalgorithms. The library supports the Q15 and Q31fractional data formats. Functions included in the DSPFixed-Point Math Library include complex math, vectormath, matrix math, digital filters and transforms.The LibQ Fixed-Point Math Library simplifies writing fixedpoint algorithms, supporting Q15, Q31 and other 16-bitand 32-bit data formats. Functions in the LibQ libraryinclude capabilities for trigonometric, power and logarithmsand data conversion.Cryptographic LibraryMicrochip offers a reliable security solution for embeddedapplications built on the 32-bit MCU platform. TheCryptographic Library features encryption, decryption,authentication, hashing, compression and random numbergeneration routines with a convenient C language interface.File SystemThe File System service is a framework designed to supportmultiple file systems (native file system) and multiplemedia in the same application. Supported file systems areFAT12, FAT16, FAT32 and MPFS. Each of these native filesystems have a common set of APIs that can be used toaccess the files of that particular native file system.The Bootloader Library can be used to upgrade firmwareon a target device without the need for an externalprogrammer or debugger. A demonstration application,which can be downloaded into the target PIC32 deviceusing the bootloader is included. It provides a personalcomputer host application to communicate with thebootloader firmware running inside the PIC32 device.The personal computer application is used to performerase/programming operations.Operating System Abstraction Layer (OSAL)The OSAL provides the interface to commonly availableReal-Time Operating Systems (RTOS) such that drivers andmiddleware (and optionally, applications) may be writtenusing a single interface to a minimal set of OS-specificfeatures needed to provide thread safety.The Operation System Abstraction Layer supports:    FreeRTOS    OpenRTOS    Micrium μC/OS-II    Micrium μC/OS-III    ThreadX    embOSMPLAB Harmony Third-Party PartnersMicrochip offers solutions from industry-leading OS, Internet of Things (IoT), Security and Networking specialists that arecompatible with the MPLAB Harmony Framework.Express LogicInternicheThreadX is a small, fast RTOS that provides preemptive,hard real-time scheduling, intuitive API and pre-buildexample programs.Complete TCP/IP implementation for PIC32 MCUs withsimultaneous IPv4 and IPv6 operation. They also featureHTTP, SNMP, FTP and Telnet Server Libraries.PubNubWITTENSTEIN High-Integrity SystemsPubNub provides secure, real-time IoT solutions using theirGlobal Data Stream Network.OpenRTOS is the only available commercial license forFreeRTOS, the highly successful, small, efficient embeddedRTOS. It removes the FreeRTOS modified GPL conditions,provides commercial indemnification, confidentiality andprofessional support.FreeRTOSFreeRTOS is a small-footprint, portable, preemptive andopen-source RTOS.SEGGERembOS is a priority-controller RTOS. It boasts a zerointerrupt latency, extremely-fast context switching time andindustry-proven reliability.wolfSSLCyaSSL, Embedded SSL Library, is a light weight SSL/TLSlibrary written in ANSI C and targeted for embedded, RTOSand resource-constrained environments. This is primarilybecause of its small size, speed and feature set.For latest updates on MPLAB Harmony solutions and third-party partners, please refer to the MPLAB Harmony Help File/Release Notes under the “Documentation” section at www.microchip.com/harmony.6MPLAB Harmony Integrated Software Framework

MPLAB Harmony Board Support Packages (BSP)A Board Support Package provides code and configuration items necessary to support board-specific hardware. A BSP maycontain a board-specific configuration header, a board-specific system intialization file, a file containing board-specific ISRimplementations. Everything that is contained within a BSP can be either used or replaced by application-specific itemsif desired.ApplicationConnectivity:USB, Ethernet, CAN andBluetooth SPPGraphics and TouchDigital Audio and BluetoothDevelopment ToolPart NumberPIC32MX1/2/5 Starter KitDM320100PIC32 Bluetooth Starter KitDM320018PIC32 Ethernet Starter KitDM320004PIC32 Ethernet Starter Kit IIDM320004-2PIC32 USB Starter Kit IIDM320003-2PIC32 USB Starter Kit IIIDM320003-3PIC32MZ Embedded Connectivity (EC) Starter KitDM320006PIC32MZ with FPU, Embedded Connectivity (EC) Starter KitDM320007Explorer 16 Development BoardDM240001PIC32MX460 Plug-In Module (PIM)MA320002PIC32MX450/470 PIMMA320002-2PIC32MX795F PIMMA320003PIC32MZ with FPU PIMMA320019PIC32MZ PIMMA320012Multimedia Expansion Board (MEB)DM320005Multimedia Expansion Board II (MEB II)DM320005-2Graphics Controller PICtail Plus Epson S1D13517AC164127-7Graphics LCD Controller PICtail Plus SSD1926AC164127-5Low-Cost Controllerless (LCC) Graphics BoardAC164144PIC32 GUI Development BoardDM320015Graphics Display Truly 3.2" 320 240 BoardAC164127-4Graphics Display Truly 5.7” 640 480 BoardAC164127-8Graphics Display Powertip 4.3" 480 272 BoardAC164127-6Graphics Display Truly 7" 800 272 BoardAC164127-9PIC32 Bluetooth Audio Development KitDV320032PIC32MX270F512L Bluetooth PIMMA320017PIC32MZ Bluetooth PIMMA320016PIC32MZ with FPU Bluetooth PIMMA320018Boad Support Packages (BSPs) for one or more combinations of the development tools listed above are offered with theMPLAB Harmony Software Framework. For a specific combination of BSPs and updates, please refer to the Board SupportPackages document under the “Documentation” section at www.microchip.com/harmony.MPLAB Harmony ResourcesDownloadOne-Stop ShopDownload MPLAB Harmony atwww.microchip.com/harmony.License, resale and support (including select third-partysolutions) all via www.microchip.com/harmony.SupportEasy MigrationUser support is provided by forums atwww.microchip.com/harmony.MPLAB Harmony’s architecture allows for easy migrationbetween the broad portfolio of PIC32 MCUs.PricingShorter Development TimeThe basic framework is free. Select libraries may need tobe purchased.Pre-tested, proven componets require surprisingly littleeffort to integrate into your system.MPLAB Harmony Integrated Software Framework7

SupportTrainingMicrochip is committed to supporting its customersin developing products faster and more efficiently. Wemaintain a worldwide network of field applicationsengineers and technical support ready to provide productand system assistance. In addition, the following serviceareas are available at www.microchip.com: Support link provides a way to get questionsanswered fast: http://support.microchip.com Sample link offers evaluation samples of anyMicrochip device: http://sample.microchip.com Forum link provides access to knowledge base andpeer help: http://forum.microchip.com Buy link provides locations of Microchip Sales ChannelPartners: www.microchip.com/salesIf additional training interests you, then Microchip canhelp. We continue to expand our technical training options,offering a growing list of courses and in-depth curriculumlocally, as well as significant online resources – wheneveryou want to use them. Technical Training Centers and Other Resources:www.microchip.com/training MASTERs Conferences: www.microchip.com/masters Worldwide Seminars: www.microchip.com/seminars eLearning: www.microchip.com/webseminarsSales Office ListingAMERICASAtlantaTel: 678-957-9614AustinTel: 512-257-3370BostonTel: 774-760-0087ChandlerTel: 480-792-7200ChicagoTel: 630-285-0071ClevelandTel: 216-447-0464DallasTel: 972-818-7423DetroitTel: 248-538-2250HoustonTel: 281-894-5983IndianapolisTel: 317-773-8323Los AngelesTel: 949-462-9523New YorkTel: 631-435-6000San JoseTel: 408-735-9110TorontoTel: 905-673-0699EUROPEAustria - WelsTel: 43-7242-2244-39Denmark - CopenhagenTel: 45-4450-2828France - ParisTel: 33-1-69-53-63-20Germany - DusseldorfTel: 49-2129-3766400Germany - MunichTel: 49-89-627-144-0Germany - PforzheimTel: 49-7231-424750Italy - MilanTel: 39-0331-742611Italy - VeniceTel: 39-049-7625286Netherlands - DrunenTel: 31-416-690399Poland - WarsawTel: 48-22-3325737Spain - MadridTel: 34-91-708-08-90Sweden - StockholmTel: 46-8-5090-4654UK - WokinghamTel: 44-118-921-5800ASIA/PACIFICAustralia - SydneyTel: 61-2-9868-6733China - BeijingTel: 86-10-8569-7000China - ChengduTel: 86-28-8665-5511China - ChongqingTel: 86-23-8980-9588China - DongguanTel: 86-769-8702-9880China - HangzhouTel: 86-571-87928115China - Hong Kong SARTel: 852-2943-5100China - NanjingTel: 86-25-8473-2460China - QingdaoTel: 86-532-8502-7355China - ShanghaiTel: 86-21-5407-5533China - ShenyangTel: 86-24-2334-2829China - ShenzhenTel: 86-755-8864-2200China - WuhanTel: 86-27-5980-5300China - XiamenTel: 86-592-2388138China - XianTel: 86-29-8833-7252China - ZhuhaiTel: 86-756-3210040ASIA/PACIFICIndia - BangaloreTel: 91-80-3090-4444India - New DelhiTel: 91-11-4160-8631India - PuneTel: 91-20-3019-1500Japan - OsakaTel: 81-6-6152-7160Japan - TokyoTel: 81-3-6880-3770Korea - DaeguTel: 82-53-744-4301Korea - SeoulTel: 82-2-554-7200Malaysia - Kuala LumpurTel: 60-3-6201-9857Malaysia - PenangTel: 60-4-227-8870Philippines - ManilaTel: 63-2-634-9065SingaporeTel: 65-6334-8870Taiwan - Hsin ChuTel: 886-3-5778-366Taiwan - KaohsiungTel: 886-7-213-7828Taiwan - TaipeiTel: 886-2-2508-8600Thailand - BangkokTel: 66-2-694-13511/27/15www.microchip.comThe Microchip name and logo, the Microchip logo and MPLAB are registered trademarks and PICtail is a trademark of MicrochipTechnology Incorporated in the U.S.A. and other countries. All other trademarks mentioned herein are property of their respectivecompanies. 2015, Microchip Technology Incorporated. All Rights Reserved. Printed in the U.S.A. 7/15DS60001353AMicrochip Technology Inc.2355 W. Chandler Blvd.Chandler, AZ 85224-6199

The MPLAB Harmony Graphics Composer is a graphics user interface design tool that is integrated as part of the MPLAB Harmony Configurator (MHC). This tool allows you to easily configure and visually design for the MPLAB Harmony Graphics Primitive Library and the MPLAB Harmony Graphics Object Layer. The

Related Documents:

MPLAB Harmony provides a convenient MPLAB X IDE plug-in configuration utility, the MPLAB Harmony Configurator (MHC), which you can use to easily create MPLAB Harmony-based projects. This tutorial will show you how to use the MHC to quickly create your first MPLAB Harmony application using the following steps: Step 1: Create a New Project

This user's guide provides information on the MPLAB Harmony Graphics Composer (also referred to as the graphics composer), which is included in your installation of MPLAB Harmony. Description The MPLAB Harmony Graphics Composer is a graphics user interface design tool that is integrated as part of the MPLAB Harmony Configurator (MHC).

MPLAB Harmony provides a MPLAB Harmony Configurator (MHC) MPLAB X IDE plug-in that can be installed in MPLAB X IDE to help you create your own MPLAB Harmony applications. To create a new MPLAB

MPLAB SIM MPLAB ICE 2000 MPLAB ICD 2 MPLAB ICE 4000 MPLAB IDE Debugger The other debug engines are hardware devices, while MPLAB SIM is a software program, running on your PC. MPLAB SIM provides many of the same features as in-circuit emulators and in-circuit debuggers.

MPLAB X CCS C Compiler Tutorial How to install the CCS C Compiler inside MPLAB X Before the CCS C Compiler can be used inside MPLAB X, the CCS C MPLAB X Plug-in must be installed. This process can be done inside MPLAB X. 1. Launch MPLAB X. 2. From the MPLAB X menu, select Tools - Plugins 3.

MPLAB C18 C Compiler The layout of this document: –Installing MPLAB C18: A step-by-step guide through the installation process of MPLAB C18 Compiler. –Configuring MPLAB IDE: MPLAB IDE setup for use with MPLAB C18. Basics of MPLAB IDE configuration to run your Program

Chapter 1: MPLAB IDE Preview – An overview of what MPLAB IDE is and how it works. Chapter 2: MPLAB IDE Installation – How to install MPLAB IDE on your computer. Chapter 3: Getting Started with MPLAB IDE – A Tutorial – How to begin using MPLAB IDE. Chapter 4: MPLAB IDE Projects Tuto

American Revolution: Events Leading to War To view this PDF as a projectable presentation, save the file, click “View” in the top menu bar of the file, and select “Full Screen Mode To request an editable PPT version of this presentation, send a request to CarolinaK12@unc.edu. 1660: The Navigation Acts British Action: – Designed to keep trade in England and support mercantilism .