Microchip dsPIC

From ErikaWiki

(Difference between revisions)
Jump to: navigation, search
(Setting up the compiling environment for the PIC30 architecture)
Line 96: Line 96:
The first textbox, labeled Gcc path, refers to the installation directory of the Microchip C30 compiler. The second textbox, labeled Asm path, refers to the installation directory of the ASM30 assembler provided with the MPLAB IDE. The two checkbox are provided for legacy support.
The first textbox, labeled Gcc path, refers to the installation directory of the Microchip C30 compiler. The second textbox, labeled Asm path, refers to the installation directory of the ASM30 assembler provided with the MPLAB IDE. The two checkbox are provided for legacy support.
 +
'''Warning''': The install directories specified in the two textboxes in the figure above does not include the bin directory!
 +
That is,
 +
c:\Programmi\Microchip\MPLAB C30
 +
is correct, wheras
 +
c:\Programmi\Microchip\MPLAB C30\bin
 +
is not.
 +
 +
'''Warning''': The install directory of the assembler refers to the assembler provided with MPLAB IDE and not the assembler provided with the C30 compiler.
 +
 +
== Writing software for dsPIC using Erika Enterprise ==
 +
 +
'''Note''': Please refer to [[Tutorial: Installing ERIKA and RT-Druid, and compile your first application]] for a step-by-step guide with screenshots on how to create, compile and debug a dsPIC application written with Erika Enterprise.
 +
 +
This section describes the details about the various configuration options which are available to create and compile an Erika Enterprise application for a dsPIC microcontroller.
 +
 +
=== Avoid the generation of dependency files ===
 +
The typical compilation process of an Erika Enterprise application involves the computation of a dependency file which is used to understand which are the files which needs to be compiled or updated.
 +
 +
To avoid the computation of these dependencies (useful when you are sure you basically have to compile everything), you can put the following line in the OIL file:
 +
<pre>
 +
CPU mySystem {
 +
  OS myOs {
 +
    EE_OPT = " NODEPS ";
 +
    ...
 +
  };
 +
  ...
 +
};
 +
</pre>
[[Category:Supported Devices]]
[[Category:Supported Devices]]

Revision as of 14:07, 20 September 2011

Contents

Introduction

Embedded microcontroller units are spreading in thousands of applications, ranging from single to distributed systems, control applications, multimedia, communication, medical applications and many others. Modern microcontrollers, which are growing in computational power, speed and interfacing capabilities, are more and more feeling the need of tools to make the development of complex scalable applications easier.

The dsPIC (R) DSC family represents the latest product of Microchip Technology Inc., the world leading company in the field of microcontroller units. With a speed of up to 40 MHz, the dsPIC (R) DSC family seamlessly integrates a DSP core for high performance computation with a full range of interfaces to several buses like CAN, I2C, SPI, serial lines, ecc.

Erika Enterprise and RT-Druid for Microchip dsPIC (R) DSC

Embedded applications often require tight control on the temporal behavior of each single activity in the system. The research in the field of real-time systems brought the team of Evidence Srl to design a small, efficient, modular real-time kernel that can be used to easily guarantee real-time constraints in every embedded applications.

Erika Enterprise and RT-Druid represent the answer of Evidence Srl for the development of scalable real-time applications for the Microchip dsPIC (R) DSC family.

The main features of ERIKA Enterprise and RT-Druid which are specific for Microchip dsPIC (R) DSC are the following:

  • Installation setup which integrates Microchip software together with fully configured Evidence Erika Enterprise + RT-Druid;
  • Full support for the Microchip devices libraries;
  • Full support for the Microchip C30 compiler;
  • Full support of the MPLAB IDE debugging environment;
  • Full support for the Microchip ICD2 debugger;
  • Full support for dsPIC (R) DSC series 30 and 33, and PIC24
  • Support for the 802.15.4 (ZigBee) wireless communication protocol (using Maxstream XBee, Microchip ZigBee coming soon);
  • Support for I/O to Multimedia Card (MMC) / Secure Digital with FAT filesystem (coming soon);
  • Development of many specific hardware drivers for dsPIC (R) DSC, like multiple servomotor driving, bus EIB support (domotic), and many other (coming soon);
  • Support for the FLEX development board (see here for details);

Integration with Microchip Inc. products

Erika Enterpise and RT-Druid aims to the best integration with the existing tools for development available from Microchip Inc.

RT-Druid will be used to quickly configure the application, setting temporal parameters of real-time tasks, memory requirements, stack allocation and many other parameters. RT-Druid generates the application template, and leaves the developer the task to implement the logic of each single task.

While programming the application, the developer can exploit the power and flexibility offered by the primitives of the Erika Enterprise real-time kernel.

The application can be imported into MPLAB IDE to be written into the dsPIC (R) DSC EPROM flash memory. Moreover, the application can be debugged from within the MPLAB IDE.

Requirements

Erika Enterprise supports Microchip dsPIC (R) DSC families 30 and 33, and PIC24.

Additional software is provided to compile the USB support for the FLEX Full using the Microchip C18 compiler.

The following table lists the requirements upon external programs provided by companies other than Evidence.

There is no guarantee our software will work if you install a different version from what is listed in the table below.

Note the list is basically the sw versions we tried ourselves. if it does not work on your version, just send us a message on the forum...

  • ERIKA Enterprise 1.4.3
    • Microchip MPLAB 8.01 to 8.14
    • Microchip C30 Compiler 2.0.5, 3.0.2, 3.10b, 3.11(by adding the patch below)
    • Microchip C18 3.20
  • ERIKA Enterprise 1.5.0
    • Microchip MPLAB 8.01 to 8.36
    • Microchip C30 Compiler 3.0.2 to 3.20
    • Microchip C18 3.20
  • ERIKA Enterprise 1.5.1
    • Microchip MPLAB 8.01 to 8.66
    • Microchip C30 Compiler 3.0.2 to 3.23
    • Microchip C18 3.20
  • ERIKA Enterprise 1.6.0
    • Microchip MPLAB 8.66
    • Microchip C30 Compiler 3.0.2 to 3.25
    • Microchip C18 3.20


Useful links

PLEASE TRY TO USE THE MICROCHIP TOOL VERSIONS LISTED ABOVE. OTHER VERSIONS MAY NOT WORK. (unfortunately Microchip changes the location of the compiler almost at each new version!)

Erika Enterprise for PIC devices

ERIKA Enterprise and RT-Druid Design Flow

ERIKA Enterprise and RT-Druid Design Flow

Setting up the compiling environment for the PIC30 architecture

Erika Enterprise has been designed to be compiled using the GNU gcc toolchain. The dsPIC porting of Erika Enterprise in particular can be compiled using the GNU tools for dsPIC provided by Microchip. The porting provides both the binutils package and the gcc package, plus a set of proprietary libraries from Microchip which can be used to control the various peripherals provided by the dsPIC microcontrollers.

The following list describes the various packages which contains the various parts of the compilation toolchain:

  • The GNU assembler and binutils. This package is distributed inside the MPLAB IDE from Microchip. ERIKA does not use this package
  • The GNU GCC from Microchip, named Microchip C30 Compiler. The compiler is packaged in a separate product, called The Microchip C30 Compiler, which is available as a product under the Microchip website. A free version is also available for students and universities. The source code of the compiler is also available under the GPL license on the Microchip web site.
  • C Libraries. A set of libraries which can be used to control the peripherals implemented on the particular Microchip chip in use. These libraries are packaged together with the Microchip C30 Compiler.

To compile an Erika Enterprise application, the development environment needs to be configured to correctly recognize the Microchip C30 compiler and the MPLAB ASM30 assembler programs. For doing so, please go to the “Preference” menu, as shown in Figure

Go to the “Preference” menu inside Eclipse.

and find the “RT-Druid/Oil/PIC30 Configurator” form as depicted in Figure

dsPIC paths for compiler and assembler.

The first textbox, labeled Gcc path, refers to the installation directory of the Microchip C30 compiler. The second textbox, labeled Asm path, refers to the installation directory of the ASM30 assembler provided with the MPLAB IDE. The two checkbox are provided for legacy support.

Warning: The install directories specified in the two textboxes in the figure above does not include the bin directory! That is,

c:\Programmi\Microchip\MPLAB C30 

is correct, wheras

c:\Programmi\Microchip\MPLAB C30\bin 

is not.

Warning: The install directory of the assembler refers to the assembler provided with MPLAB IDE and not the assembler provided with the C30 compiler.

Writing software for dsPIC using Erika Enterprise

Note: Please refer to Tutorial: Installing ERIKA and RT-Druid, and compile your first application for a step-by-step guide with screenshots on how to create, compile and debug a dsPIC application written with Erika Enterprise.

This section describes the details about the various configuration options which are available to create and compile an Erika Enterprise application for a dsPIC microcontroller.

Avoid the generation of dependency files

The typical compilation process of an Erika Enterprise application involves the computation of a dependency file which is used to understand which are the files which needs to be compiled or updated.

To avoid the computation of these dependencies (useful when you are sure you basically have to compile everything), you can put the following line in the OIL file:

CPU mySystem {
  OS myOs {
    EE_OPT = " NODEPS ";
    ...
  };
  ...
};
Personal tools