Difference between revisions of "Microchip dsPIC33 PIC24"

From ERIKA WIKI
Jump to: navigation, search
(Introduction)
(dsPIC33EV Family)
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Introduction ==
+
= Introduction =
  
ERIKA3 now supports Microchip dsPIC33/PIC24 MCUs.
+
This manual describes the porting details of the ERIKA Enterprise v3 kernel(s) for Microchip dsPIC33/PIC24 families of microcontrollers.
  
The following MCUs are currently supported:
+
= dsPIC33 features supported =
* dsPIC33EV256GM106
 
  
Such support has been successfully tested on the following board:
+
The following are the main features of the currently implemented support:
* [http://www.microchip.com/developmenttools/productdetails.aspx?partno=dm330018 dsPIC33EV 5V CAN-LIN STARTER KIT]
 
  
 +
* Development tools
 +
** Support for [http://ww1.microchip.com/downloads/en/DeviceDoc/MPLABX-v4.05-windows-installer.exe MPLAB-X IDE v4.05]
 +
** Support for [http://ww1.microchip.com/downloads/en/DeviceDoc/xc16-v1.33-full-install-windows-installer.exe MPLAB XC16 C Compiler v1.33]
 +
* dsPIC33/PIC24 parts supported:
 +
** [http://www.microchip.com/design-centers/16-bit/products/dspic33f-dspic33e dsPIC33EV]
 +
*** [http://www.microchip.com/wwwproducts/en/dsPIC33EV256GM106 dsPIC33EV256GM106] specific MCU
 +
* Evaluation boards
 +
** [http://www.microchip.com/developmenttools/productdetails.aspx?partno=dm330018 dsPIC33EV 5V CAN-LIN STARTER KIT] (dsPIC33EV256GM106)
  
 
== Tutorials ==
 
== Tutorials ==
  
The following tutorials are available for this board:
+
The following tutorials are available for this architecture:
 
* [[Microchip_dsPIC33/PIC24_-_dsPIC33EV-SK_application_build_on_Windows|dsPIC33/PIC24: dsPIC33EV-SK application build on Windows]]
 
* [[Microchip_dsPIC33/PIC24_-_dsPIC33EV-SK_application_build_on_Windows|dsPIC33/PIC24: dsPIC33EV-SK application build on Windows]]
 
* [[Microchip_MPLAB-X_-_Integration_on_Windows| MPLAB-X IDE - Integration on Windows]]
 
* [[Microchip_MPLAB-X_-_Integration_on_Windows| MPLAB-X IDE - Integration on Windows]]
  
= Synopsys =
+
= Configuration and Programming =
This manual describes the porting details of the ERIKA Enterprise v3 kernel(s) for Microchip dsPIC33/PIC24 families of microcontrollers.
 
 
 
* dsPIC33/PIC24 integration features
 
** Support for [http://ww1.microchip.com/downloads/en/DeviceDoc/MPLABX-v4.05-windows-installer.exe MPLAB-X IDE v4.05]
 
** Support for [http://ww1.microchip.com/downloads/en/DeviceDoc/xc16-v1.33-full-install-windows-installer.exe MPLAB XC16 C Compiler v1.33]
 
** Support for the following families Microchip dsPIC33/PIC24 MCUs:
 
*** [http://www.microchip.com/design-centers/16-bit/products/dspic33f-dspic33e dsPIC33EV]
 
**** [http://www.microchip.com/wwwproducts/en/dsPIC33EV256GM106 dsPIC33EV256GM106] specific MCU
 
** Support for following boards
 
*** [http://www.microchip.com/developmenttools/productdetails.aspx?partno=dm330018 dsPIC33EV 5V CAN-LIN STARTER KIT] (dsPIC33EV256GM106)
 
  
= Configuration and Programming =
+
ERIKA Enterprise is configured through [[Tutorial: RT-Druid and OIL basics | RT-Druid and an OIL file]] and some other properties.
  
ERIKA Enterprise is configured through [[Tutorial: RT-Druid and OIL basics | RT-Druid and an OIL file]]. Here are listed, after the information to set compiler path, the OIL fields customized for Microchip dsPIC33/PIC24 architecture.
+
The following sections describe the properties and OIL fields customized for Microchip dsPIC33/PIC24 architecture.
  
 
== MPLAB-X IDE Path ==
 
== MPLAB-X IDE Path ==
Line 60: Line 56:
 
'''CPU_DATA''' object must be set to  '''DSPIC33_PIC24'''.
 
'''CPU_DATA''' object must be set to  '''DSPIC33_PIC24'''.
  
'''MODEL''' attribute of '''MCU_DATA''' supports for now the '''dsPIC33''' value only.
+
Example of a CPU_DATA section:
 +
 
 +
    CPU_DATA = DSPIC33_PIC24 {
 +
      ...
 +
    };
 +
 
 +
=== MODEL ===
 +
 
 +
'''MODEL''' attribute of '''CPU_DATA''' supports for now the '''dsPIC33''' value only.
 +
Deafult value is '''dsPIC33'''.
 +
 
 +
Example of a MODEL attribute of a CPU_DATA section:
 +
 
 +
    CPU_DATA = DSPIC33_PIC24 {
 +
      MODEL = dsPIC33;
 +
      ...
 +
    };
 +
 
 +
==== SPLIM ====
 +
 
 +
'''SPLIM''' boolean property of '''MODEL''' attribute of '''CPU_DATA''' for the '''dsPIC33''' value only enables the hardware stack pointer overflow check.
 +
Deafult value is '''TRUE'''.
 +
 
 +
Example of SPLIM boolean property of MODEL attribute of CPU_DATA for the dsPIC33 value only:
 +
 
 +
    CPU_DATA = DSPIC33_PIC24 {
 +
      MODEL = dsPIC33 {
 +
        SPLIM = FALSE;
 +
      };
 +
      ...
 +
    };
 +
 
 +
==== DBG ====
 +
 
 +
'''DBG''' property of '''MODEL''' attribute of '''CPU_DATA''' for the '''dsPIC33''' value only selects the hardware debugger: for now only the '''SK''' (Starter-Kit) value is supported.
 +
Deafult value is '''SK'''.
  
Example of a CPU_DATA section:
+
Example of DBG property of MODEL attribute of CPU_DATA for the dsPIC33 value only:
 +
 
 +
    CPU_DATA = DSPIC33_PIC24 {
 +
      MODEL = dsPIC33 {
 +
        DBG = SK;
 +
      };
 +
      ...
 +
    };
 +
 
 +
=== COMPILER ===
 +
 
 +
'''COMPILER''' attribute of '''CPU_DATA''' supports for now the '''XC16''' value only.
 +
Deafult value is '''XC16'''.
 +
 
 +
Example of a COMPILER attribute of CPU_DATA section:
 +
 
 +
    CPU_DATA = DSPIC33_PIC24 {
 +
      MODEL = dsPIC33;
 +
      COMPILER = XC16;
 +
      ...
 +
    };
 +
 
 +
==== MINIMAL_OPTS ====
 +
 
 +
'''MINIMAL_OPTS''' boolean property of '''COMPILER''' attribute of '''CPU_DATA''' configures the build system with minimal compiling and linking options.
 +
The default value is set to '''FALSE'''.
 +
 +
Example of a MINIMAL_OPTS property of COMPILER attribute of CPU_DATA section:
  
 
     CPU_DATA = DSPIC33_PIC24 {
 
     CPU_DATA = DSPIC33_PIC24 {
 
       MODEL = dsPIC33;
 
       MODEL = dsPIC33;
 +
      COMPILER = XC16 {
 +
          MINIMAL_OPTS = TRUE;
 +
      };
 
       ...
 
       ...
 
     };
 
     };
Line 72: Line 133:
  
 
'''MCU_DATA''' object supports for now the '''dsPIC33EV''' value only.
 
'''MCU_DATA''' object supports for now the '''dsPIC33EV''' value only.
 +
 +
Example of a MCU_DATA section:
 +
 +
  MCU_DATA = dsPIC33EV {
 +
    ...
 +
  };
 +
 +
=== MODEL ===
  
 
'''MODEL''' attribute of '''MCU_DATA''' supports for now the '''dsPIC33EV256GM106''' value only.
 
'''MODEL''' attribute of '''MCU_DATA''' supports for now the '''dsPIC33EV256GM106''' value only.
  
Example of a MCU_DATA section:
+
Example of MODEL attribute of MCU_DATA section:
  
 
   MCU_DATA = dsPIC33EV {
 
   MCU_DATA = dsPIC33EV {
Line 91: Line 160:
 
== Interrupt Handling ==
 
== Interrupt Handling ==
  
Interrupt Handling is microcontroller dependent so for each supported Microchip dsPIC33/PIC24 microcontroller family, the ISRs configuration of ERIKA Enterprise v3 is shown below.
+
The Interrupt Handling support is microcontroller dependent. For each supported Microchip dsPIC33/PIC24 microcontroller family, the ISRs configuration of ERIKA3 is shown below.
  
 
=== dsPIC33EV Family ===
 
=== dsPIC33EV Family ===
  
The '''dsPIC33EV''' family of '''dsPIC33/PIC24''' microcontrollers has an interrupt vector table which is stored in the flash memory. The lowest addresses of the interrupt vector table are allocated to the RESET and to the interrupt vectors. Interrupt handlers placed at lower addresses have higher hardware priorities than interrupt handlers placed at higher addresses so the '''PRIORITY''' attribute of the '''ISR''' object in the OIL is USELESS. The complete list of '''SOURCE''' entries is shown below.
+
The '''dsPIC33EV''' family of '''dsPIC33/PIC24''' microcontrollers has an interrupt vector table which is stored in the flash memory. The complete list of '''SOURCE''' entries is shown below.
 +
 
 +
* Traps
 +
** <code>OSCFAIL</code>: Oscillator Fail Trap
 +
** <code>ADDRERR</code>: Address Error Trap
 +
** <code>SGHT</code>: Generic Hard Trap
 +
** <code>STKERR</code>: Stack Error Trap
 +
** <code>MATHERR</code>: Math Error Trap
 +
** <code>DMACERR</code>: DMAC Error Trap
 +
** <code>SGST</code>: Generic Soft Trap
  
* <code>OSCFAIL</code>: External Pin, Power-on Reset, Brown-out Reset and Watchdog System Reset
+
* Interrupts
* <code>ADDRERR</code>: External Interrupt Request 0
+
** <code>INT0</code>: External Interrupt 0
* <code>SGHT</code>: External Interrupt Request 1
+
** <code>IC1</code>: Input Capture 1
* <code>STKERR</code>: Pin Change Interrupt Request 0
+
** <code>OC1</code>: Output Compare 1
* <code>MATHERR</code>: Pin Change Interrupt Request 1
+
** <code>T1</code>: Timer1
* <code>DMACERR</code>: Pin Change Interrupt Request 2
+
** <code>DMA0</code>: DMA Channel 0
* <code>SGST</code>: Watchdog Time-out Interrupt
+
** <code>IC2</code>: Input Capture 2
* <code>INT0</code>: Timer/Counter2 Compare Match A
+
** <code>OC2</code>: Output Compare 2
* <code>IC1</code>: Timer/Counter2 Compare Match B
+
** <code>T2</code>: Timer2
* <code>OC1</code>: Timer/Counter2 Overflow
+
** <code>T3</code>: Timer3
* <code>T1</code>: Timer/Counter1 Capture Event
+
** <code>SPI1E</code>:SPI1 Error
* <code>DMA0</code>: Timer/Counter1 Compare Match A
+
** <code>SPI1</code>: SPI1 Transfer Done
* <code>IC2</code>: Timer/Coutner1 Compare Match B
+
** <code>U1RX</code>: UART1 Receiver
* <code>OC2</code>: Timer/Counter1 Overflow
+
** <code>U1TX</code>: UART1 Transmitter
* <code>T2</code>: Timer/Counter0 Compare Match A
+
** <code>AD1</code>: ADC1 Convert Done
* <code>T3</code>: Timer/Counter0 Compare Match B
+
** <code>DMA1</code>: DMA Channel 1
* <code>SPI1E</code>: Timer/Counter0 Overflow
+
** <code>NVM</code>: NVM Write Complete
* <code>SPI1</code>: SPI Serial Transfer Complete
+
** <code>SI2C1</code>: I2C1 Slave Event
* <code>U1RX</code>: USART Rx Complete
+
** <code>MI2C1</code>: I2C1 Master Event
* <code>U1TX</code>: USART, Data Register Empty
+
** <code>CMP1</code>: Comparator Combined Event
* <code>AD1</code>: USART, Tx Complete
+
** <code>CN</code>: Input Change Interrupt
* <code>DMA1</code>: Conversion Complete
+
** <code>INT1</code>: External Interrupt 1
* <code>NVM</code>: EEPROM Ready
+
** <code>DMA2</code>: DMA Channel 2
* <code>SI2C1</code>: Analog Comparator
+
** <code>OC3</code>: Output Compare 3
* <code>MI2C1</code>: 2-wire Serial Interface
+
** <code>OC4</code>: Output Compare 4
* <code>CMP1</code>: Store Program Memory Ready
+
** <code>T4</code>: Timer 4
* <code>CN</code>: External Pin, Power-on Reset, Brown-out Reset and Watchdog System Reset
+
** <code>T5</code>: Timer 5
* <code>INT1</code>: External Interrupt Request 0
+
** <code>INT2</code>: External Interrupt 2
* <code>DMA2</code>: External Interrupt Request 1
+
** <code>U2RX</code>: UART2 Receiver
* <code>OC3</code>: Pin Change Interrupt Request 0
+
** <code>U2TX</code>: UART2 Transmitter
* <code>OC4</code>: Pin Change Interrupt Request 1
+
** <code>SPI2E</code>: SPI2 Error
* <code>T4</code>: Pin Change Interrupt Request 2
+
** <code>SPI2</code>: SPI3 Transfer Done
* <code>T5</code>: Watchdog Time-out Interrupt
+
** <code>C1RX</code>: CAN1 RX Data Ready
* <code>INT2</code>: Timer/Counter2 Compare Match A
+
** <code>C1</code>: CAN1 Event
* <code>U2RX</code>: Timer/Counter2 Compare Match B
+
** <code>DMA3</code>: DMA Channel 3
* <code>U2TX</code>: Timer/Counter2 Overflow
+
** <code>IC3</code>: Input Capture 3
* <code>SPI2E</code>: Timer/Counter1 Capture Event
+
** <code>IC4</code>: Input Capture 4
* <code>SPI2</code>: Timer/Counter1 Compare Match A
+
** <code>PSEM</code>: PWM Special Event Match Interrupt
* <code>C1RX</code>: Timer/Coutner1 Compare Match B
+
** <code>U1E</code>: UART1 Error Interrupt
* <code>C1</code>: Timer/Counter1 Overflow
+
** <code>U2E</code>: UART2 Error Interrupt
* <code>DMA3</code>: Timer/Counter0 Compare Match A
+
** <code>C1TX</code>: USART, Tx Complete
* <code>IC3</code>: Timer/Counter0 Compare Match B
+
** <code>CTMU</code>: UART1 Error Interrupt
* <code>IC4</code>: Timer/Counter0 Overflow
+
** <code>PWM1</code>: PWM Generator 1
* <code>PSEM</code>: SPI Serial Transfer Complete
+
** <code>PWM2</code>: PWM Generator 2
* <code>U1E</code>: USART Rx Complete
+
** <code>PWM3</code>: PWM Generator 3
* <code>U2E</code>: USART, Data Register Empty
+
** <code>ICD</code>: ICD Application
* <code>C1TX</code>: USART, Tx Complete
+
** <code>I2C1</code>: Bus Collision
* <code>CTMU</code>: Conversion Complete
+
** <code>SENT1ERR</code>: SENT1 Error
* <code>PWM1</code>: EEPROM Ready
+
** <code>SENT1</code>: SENT1 TX/RX
* <code>PWM2</code>: Analog Comparator
+
** <code>SENT2ERR</code>: SENT2 Error
* <code>PWM3</code>: 2-wire Serial Interface
+
** <code>SENT2</code>: SENT2 TX/RX
* <code>ICD</code>: Store Program Memory Ready
+
** <code>ECCSBE</code>: ECC Single-Bit Error
* <code>I2C1</code>: USART Rx Complete
 
* <code>SENT1ERR</code>: USART, Data Register Empty
 
* <code>SENT1</code>: USART, Tx Complete
 
* <code>SENT2ERR</code>: Conversion Complete
 
* <code>SENT2</code>: EEPROM Ready
 
* <code>ECCSBE</code>: Analog Comparator
 
  
 
= OSEK/VDX Extensions =
 
= OSEK/VDX Extensions =
Line 164: Line 236:
 
System Timer is microcontroller dependent so for each supported Microchip dsPIC33/PIC24 microcontroller family, the System Timer configuration of ERIKA Enterprise v3 is shown below.
 
System Timer is microcontroller dependent so for each supported Microchip dsPIC33/PIC24 microcontroller family, the System Timer configuration of ERIKA Enterprise v3 is shown below.
  
=== dsPIC33EV Family ===
+
==== dsPIC33EV Family ====
 
 
For the '''dsPIC33EV''' family of '''dsPIC33/PIC24''' microcontrollers the System Timer is linked to Hardware Timers so the '''DEVICE''' attribute MUST be se to '''T1''' or'''T2'''or ... or '''T5''' as shown below.
 
  
 +
For the '''dsPIC33EV''' family of '''dsPIC33/PIC24''' microcontrollers the System Timer is linked to Hardware Timers so the '''DEVICE''' attribute MUST be se to '''T1''' or'''T2''' or ... or '''T5''' as shown below.
  
 
   COUNTER SystemTimer {
 
   COUNTER SystemTimer {
Line 180: Line 251:
 
   };
 
   };
  
 +
=== CPU_CLOCK ===
 +
 +
System Timer need the '''CPU_CLOCK''' attribute of '''CPU_DATA'''. This value, expressed as MHz, must be set to the configured frequency of the CPU.
 +
 +
Example of a CPU_CLOCK attribute of CPU_DATA section:
 +
 +
    CPU_DATA = DSPIC33_PIC24 {
 +
      MODEL = dsPIC33;
 +
      CPU_CLOCK = 16.0;
 +
      ...
 +
    };
  
 
[[Category:Architectures]]
 
[[Category:Architectures]]

Latest revision as of 11:14, 4 June 2018

Introduction

This manual describes the porting details of the ERIKA Enterprise v3 kernel(s) for Microchip dsPIC33/PIC24 families of microcontrollers.

dsPIC33 features supported

The following are the main features of the currently implemented support:

Tutorials

The following tutorials are available for this architecture:

Configuration and Programming

ERIKA Enterprise is configured through RT-Druid and an OIL file and some other properties.

The following sections describe the properties and OIL fields customized for Microchip dsPIC33/PIC24 architecture.

MPLAB-X IDE Path

It is possible to choose the path in three different ways:

  • Specific environment variables: MPLAB_X_IDE_FILES
    • E.g.: MPLAB_X_IDE_FILES=C:\Program Files (x86)\Microchip\MPLABX\v4.05
  • RT-Druid Eclipse IDE Property.
  • RT-Druid Configuration File Entry: preference_dspic33_pic24__path_for_mplab_x_ide
    • E.g.: preference_dspic33_pic24__path_for_mplab_x_ide=C:\Program Files (x86)\Microchip\MPLABX\v4.05

Here is an example of RT-Druid configuration file.

MPLAB XC16 C Compiler Path

It is possible to choose the path in three different ways:

  • Specific environment variables: XC16_TOOLS
    • E.g.: XC16_TOOLS=C:\Program Files (x86)\Microchip\xc16\v1.33
  • RT-Druid Eclipse IDE Property.
  • RT-Druid Configuration File Entry: preference_dspic33_pic24__path_for_xc16_compiler
    • E.g.: preference_dspic33_pic24__path_for_xc16_compiler=C:\Program Files (x86)\Microchip\xc16\v1.33

Here is an example of RT-Druid configuration file.

CPU

CPU_DATA object must be set to DSPIC33_PIC24.

Example of a CPU_DATA section:

   CPU_DATA = DSPIC33_PIC24 {
     ...
   };

MODEL

MODEL attribute of CPU_DATA supports for now the dsPIC33 value only. Deafult value is dsPIC33.

Example of a MODEL attribute of a CPU_DATA section:

   CPU_DATA = DSPIC33_PIC24 {
     MODEL = dsPIC33;
     ...
   };

SPLIM

SPLIM boolean property of MODEL attribute of CPU_DATA for the dsPIC33 value only enables the hardware stack pointer overflow check. Deafult value is TRUE.

Example of SPLIM boolean property of MODEL attribute of CPU_DATA for the dsPIC33 value only:

   CPU_DATA = DSPIC33_PIC24 {
     MODEL = dsPIC33 {
        SPLIM = FALSE;
     };
     ...
   };

DBG

DBG property of MODEL attribute of CPU_DATA for the dsPIC33 value only selects the hardware debugger: for now only the SK (Starter-Kit) value is supported. Deafult value is SK.

Example of DBG property of MODEL attribute of CPU_DATA for the dsPIC33 value only:

   CPU_DATA = DSPIC33_PIC24 {
     MODEL = dsPIC33 {
        DBG = SK;
     };
     ...
   };

COMPILER

COMPILER attribute of CPU_DATA supports for now the XC16 value only. Deafult value is XC16.

Example of a COMPILER attribute of CPU_DATA section:

   CPU_DATA = DSPIC33_PIC24 {
     MODEL = dsPIC33;
     COMPILER = XC16;
     ...
   };

MINIMAL_OPTS

MINIMAL_OPTS boolean property of COMPILER attribute of CPU_DATA configures the build system with minimal compiling and linking options. The default value is set to FALSE.

Example of a MINIMAL_OPTS property of COMPILER attribute of CPU_DATA section:

   CPU_DATA = DSPIC33_PIC24 {
     MODEL = dsPIC33;
     COMPILER = XC16 {
          MINIMAL_OPTS = TRUE;
     };
     ...
   };

MCU

MCU_DATA object supports for now the dsPIC33EV value only.

Example of a MCU_DATA section:

 MCU_DATA = dsPIC33EV {
   ...
 };

MODEL

MODEL attribute of MCU_DATA supports for now the dsPIC33EV256GM106 value only.

Example of MODEL attribute of MCU_DATA section:

 MCU_DATA = dsPIC33EV {
   MODEL = dsPIC33EV256GM106;
 };

BOARD

BOARD_DATA object supports for now the dsPIC33EV_SK value only.

Example of a BOARD_DATA section:

 BOARD_DATA = dsPIC33EV_SK;

Interrupt Handling

The Interrupt Handling support is microcontroller dependent. For each supported Microchip dsPIC33/PIC24 microcontroller family, the ISRs configuration of ERIKA3 is shown below.

dsPIC33EV Family

The dsPIC33EV family of dsPIC33/PIC24 microcontrollers has an interrupt vector table which is stored in the flash memory. The complete list of SOURCE entries is shown below.

  • Traps
    • OSCFAIL: Oscillator Fail Trap
    • ADDRERR: Address Error Trap
    • SGHT: Generic Hard Trap
    • STKERR: Stack Error Trap
    • MATHERR: Math Error Trap
    • DMACERR: DMAC Error Trap
    • SGST: Generic Soft Trap
  • Interrupts
    • INT0: External Interrupt 0
    • IC1: Input Capture 1
    • OC1: Output Compare 1
    • T1: Timer1
    • DMA0: DMA Channel 0
    • IC2: Input Capture 2
    • OC2: Output Compare 2
    • T2: Timer2
    • T3: Timer3
    • SPI1E:SPI1 Error
    • SPI1: SPI1 Transfer Done
    • U1RX: UART1 Receiver
    • U1TX: UART1 Transmitter
    • AD1: ADC1 Convert Done
    • DMA1: DMA Channel 1
    • NVM: NVM Write Complete
    • SI2C1: I2C1 Slave Event
    • MI2C1: I2C1 Master Event
    • CMP1: Comparator Combined Event
    • CN: Input Change Interrupt
    • INT1: External Interrupt 1
    • DMA2: DMA Channel 2
    • OC3: Output Compare 3
    • OC4: Output Compare 4
    • T4: Timer 4
    • T5: Timer 5
    • INT2: External Interrupt 2
    • U2RX: UART2 Receiver
    • U2TX: UART2 Transmitter
    • SPI2E: SPI2 Error
    • SPI2: SPI3 Transfer Done
    • C1RX: CAN1 RX Data Ready
    • C1: CAN1 Event
    • DMA3: DMA Channel 3
    • IC3: Input Capture 3
    • IC4: Input Capture 4
    • PSEM: PWM Special Event Match Interrupt
    • U1E: UART1 Error Interrupt
    • U2E: UART2 Error Interrupt
    • C1TX: USART, Tx Complete
    • CTMU: UART1 Error Interrupt
    • PWM1: PWM Generator 1
    • PWM2: PWM Generator 2
    • PWM3: PWM Generator 3
    • ICD: ICD Application
    • I2C1: Bus Collision
    • SENT1ERR: SENT1 Error
    • SENT1: SENT1 TX/RX
    • SENT2ERR: SENT2 Error
    • SENT2: SENT2 TX/RX
    • ECCSBE: ECC Single-Bit Error

OSEK/VDX Extensions

This Section contains information about the OSEK/VDX Extensions (or optional features) that have been implemented for the dsPIC33/PIC24 support.

System Timer

System Timer is microcontroller dependent so for each supported Microchip dsPIC33/PIC24 microcontroller family, the System Timer configuration of ERIKA Enterprise v3 is shown below.

dsPIC33EV Family

For the dsPIC33EV family of dsPIC33/PIC24 microcontrollers the System Timer is linked to Hardware Timers so the DEVICE attribute MUST be se to T1 orT2 or ... or T5 as shown below.

 COUNTER SystemTimer {
   MINCYCLE = 1;
   MAXALLOWEDVALUE = 65535;
   TICKSPERBASE = 1;
   TYPE = HARDWARE {
     DEVICE = "T1";
     SYSTEM_TIMER = TRUE;
   };
   SECONDSPERTICK = 0.001;
 };

CPU_CLOCK

System Timer need the CPU_CLOCK attribute of CPU_DATA. This value, expressed as MHz, must be set to the configured frequency of the CPU.

Example of a CPU_CLOCK attribute of CPU_DATA section:

   CPU_DATA = DSPIC33_PIC24 {
     MODEL = dsPIC33;
     CPU_CLOCK = 16.0;
     ...
   };