28
Real Real Time Systems Laboratory Time Systems Laboratory RETIS RETIS Lab Lab Real Real- Time Systems Laboratory Time Systems Laboratory FLEX D l t FLEX D l t FLEX Developement FLEX Developement Environment Environment Mauro Marinoni Mauro Marinoni [nino@evidence.eu.com nino@evidence.eu.com]

FLEX D l tFLEX Developement Environment

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: FLEX D l tFLEX Developement Environment

RealReal Time Systems LaboratoryTime Systems Laboratory

RETIS RETIS LabLabRealReal--Time Systems LaboratoryTime Systems Laboratory

FLEX D l tFLEX D l tFLEX Developement FLEX Developement EnvironmentEnvironment

Mauro Marinoni Mauro Marinoni [[[email protected]@evidence.eu.com]][[ @@ ]]

Page 2: FLEX D l tFLEX Developement Environment

OverviewOverview

The MicrocontrollerThe MicrocontrollerThe MicrocontrollerThe MicrocontrollerThe Flex BoardThe Flex BoardExpansion boardsExpansion boards

Multibus boardMultibus boardMultibus boardMultibus boardDemo boardDemo board

How to:How to:Compile demoCompile demoCompile demoCompile demoFlash & RunFlash & Run

DDDemosDemos

Page 3: FLEX D l tFLEX Developement Environment

The The MicrocontrollerMicrocontroller

TheThe MicrochipMicrochip 1616bitbit microcontrollersmicrocontrollers presentpresent::TheThe MicrochipMicrochip 1616bitbit microcontrollersmicrocontrollers presentpresent::1616 bitbit (data)(data) modifiedmodified--HarvardHarvard RISCRISC architecturearchitecture;;HighHigh--performanceperformance MCUMCU capabilitycapability;;IntegratedIntegrated DSPDSP capabilitycapability (dsPIC(dsPIC families)families);;IntegratedIntegrated DSPDSP capabilitycapability (dsPIC(dsPIC families)families);;SeparateSeparate programprogram andand datadata busesbuses;;PowerfulPowerful peripheralsperipherals onon chipchip;;IdleIdle && SleepSleep modesmodes;;pp ;;SwitchSwitch betweenbetween clockclock sourcessources inin realreal--timetime;;Fl iblFl ibl I t tI t t t tt tFlexibleFlexible InterruptInterrupt structurestructure..

Page 4: FLEX D l tFLEX Developement Environment

dsPIC microcontrollerdsPIC microcontroller

Mi t ll b i f tMi t ll b i f tMicrocontrollers basic features:Microcontrollers basic features:1616--bit core up to 40 MIPS a 80 MHz;bit core up to 40 MIPS a 80 MHz;Integrated DSP Module;Integrated DSP Module;6KB6KB 256KB Flash Program Memory;256KB Flash Program Memory;6KB6KB--256KB Flash Program Memory;256KB Flash Program Memory;256B256B--32Kb RAM Data Memory;32Kb RAM Data Memory;Up to 4 DMA channels;Up to 4 DMA channels;Up to 8 16Up to 8 16--bit Comparators;bit Comparators;pp p ;p ;Up to 8 PWM Generators;Up to 8 PWM Generators;Up to 8 16Up to 8 16 bit Timers (32 bit mode)bit Timers (32 bit mode)Up to 8 16Up to 8 16--bit Timers (32 bit mode).bit Timers (32 bit mode).

Page 5: FLEX D l tFLEX Developement Environment

dsPIC microcontrollerdsPIC microcontroller

Microcontroller I/O capabilities:Microcontroller I/O capabilities:Microcontroller I/O capabilities:Microcontroller I/O capabilities:Up to 86 I/O pins16 channels;Up to 86 I/O pins16 channels;A/D module with:A/D module with:

Up to 2 A/D converters;Up to 2 A/D converters;Up to 2 A/D converters;Up to 2 A/D converters;500KSPS@12500KSPS@12--bitbit1 S S@101 S S@101MSPS@101MSPS@10--bitbit

Motor Control PWMsMotor Control PWMsQuadrature Encoder InterfaceQuadrature Encoder InterfaceA l C tA l C tAnalog ComparatorsAnalog Comparators

Page 6: FLEX D l tFLEX Developement Environment

dsPIC microcontrollerdsPIC microcontroller

Microcontroller Connectivity:Microcontroller Connectivity:Microcontroller Connectivity:Microcontroller Connectivity:UART ports (IRDa support)UART ports (IRDa support)p ( pp )p ( pp )

CAN bus version 2.0A/BCAN bus version 2.0A/B

D t C t I t f (ID t C t I t f (I22S/AC97)S/AC97)Data Convert Interface (IData Convert Interface (I22S/AC97)S/AC97)

Parallel Master PortParallel Master PortII22C / SMBusC / SMBus

SPI bSPI bSPI busSPI bus

Page 7: FLEX D l tFLEX Developement Environment

Why another Why another Evaluation Board?Evaluation Board?Evaluation Board?Evaluation Board?

Typically, demo boards are:Typically, demo boards are:yp y,yp y,big!big!limited pin counts MCUlimited pin counts MCUmost of the pins used for LEDs, buttons, …most of the pins used for LEDs, buttons, …difficult to expand!difficult to expand!

ti ith d l t PCti ith d l t PC

FLEX:FLEX:

poor connection with development PCpoor connection with development PC

FLEX:FLEX:small size (7x10 cm)small size (7x10 cm)100 pin dsPIC100 pin dsPIC100 pin dsPIC100 pin dsPICall pins free on connectorsall pins free on connectors2.54 pitch, no SMD expertise required!2.54 pitch, no SMD expertise required!PIC18 for USB connectionPIC18 for USB connection

Page 8: FLEX D l tFLEX Developement Environment

FLEX: other featuresFLEX: other features

switchingswitching powerpower supplysupplyswitchingswitching powerpower supplysupplyresettableresettable fusesfusesresettableresettable fusesfusesdsPICdsPIC programmingprogramming fromfrom USBUSBp g gp g gdaughterdaughter boardsboards (Thru(Thru Hole,Hole, CAN,CAN,SPI,SPI, Ethernet,Ethernet, RSRS232232,, RSRS485485,,RSRS422422 [other[other comingcoming soon]soon] ))RSRS422422,, ……[other[other comingcoming soon]soon] ))supportsupport fotfot ERIKAERIKA OO..SS..pppp

Page 9: FLEX D l tFLEX Developement Environment

FLEX: versionsFLEX: versions

FullFull

LightLightgg

Page 10: FLEX D l tFLEX Developement Environment

FLEX: FLEX: addadd--on boardson boards

Available:Available:Thru HoleThru HoleMultibusMultibusMultibusMultibus(CAN, SPI, I2C, (CAN, SPI, I2C, Serial EthernetSerial EthernetSerial, Ethernet, Serial, Ethernet, Konnex)Konnex)D B dD B dDemoBoardDemoBoard

Page 11: FLEX D l tFLEX Developement Environment

FLEX: Multibus boardFLEX: Multibus board11 -- Serial port 2Serial port 2(RS232 / RS422 / RS485 /(RS232 / RS422 / RS485 /(RS232 / RS422 / RS485 / (RS232 / RS422 / RS485 /

TPTP--UART)UART)

22 -- Serial port 1Serial port 122 Serial port 1Serial port 1(RS232 / RS422 / RS485)(RS232 / RS422 / RS485)

33 -- CAN port 1CAN port 133 CAN port 1CAN port 1

44 -- CAN port 2CAN port 2

5 5 -- I2C portI2C port

66 -- SPI portSPI port66 -- SPI port SPI port

77 -- 10Mbit Ethernet10Mbit Ethernet

88 -- RJ45 EthernetRJ45 Ethernet

Page 12: FLEX D l tFLEX Developement Environment

FLEX: Demo Board FLEX: Demo Board

LCD 2x16LCD 2x16

8 LED8 LED

4 buttons4 buttons

33--Axis AccelerometerAxis Accelerometer

2 channels DAC2 channels DAC

Temperature sensorTemperature sensor

Light sensorLight sensor

Infrared I/OInfrared I/O

RS232/485/422 socketRS232/485/422 socket

Page 13: FLEX D l tFLEX Developement Environment

Why an embedded O.S. ?Why an embedded O.S. ?

ItIt reducesreduces thethe complexitycomplexity ofof thetheapplicationapplication;;applicationapplication;;

ItIt increasesincreases thethe reusabilityreusability ofof thethe codecode;;ItIt increasesincreases thethe reusabilityreusability ofof thethe codecode;;

ItIt simplifysimplify thethe SWSW debuggingdebugging;;p yp y gg ggg g

ItIt reducesreduces thethe timetime toto marketmarket::

......

Page 14: FLEX D l tFLEX Developement Environment

Why a Why a RealReal--TimeTimeembedded O S ?embedded O S ?embedded O.S. ?embedded O.S. ?

AnAn embeddedembedded applicationsapplications typicallytypicallypresentspresents aa lotlot ofof interactionsinteractions withwith thethepresentspresents aa lotlot ofof interactionsinteractions withwith thetheenvironmentenvironment;;

ThatThat requiresrequires aa managementmanagement ofof thetheresponseresponse timetime toto anan externalexternal eventevent..

Page 15: FLEX D l tFLEX Developement Environment

ERIKA EnterpriseERIKA Enterprise

ERIKA EnterpriseERIKA EnterpriseERIKA EnterpriseERIKA EnterpriseOSEKOSEK--like RTOS for minimal embedded systemslike RTOS for minimal embedded systems11 4 Kb ROM f t i t4 Kb ROM f t i t11--4 Kb ROM footprint4 Kb ROM footprintenhanced scheduling algorithmsenhanced scheduling algorithms

f ( C 2)f ( C 2)support for debug tools (Lauterbach, ICD2)support for debug tools (Lauterbach, ICD2)

RTRT--DruidDruidRTOS configuration using OSEK OILRTOS configuration using OSEK OILg gg gschedulability analysisschedulability analysisintegrated in eclipse.orgintegrated in eclipse.orgintegrated in eclipse.orgintegrated in eclipse.org

Page 16: FLEX D l tFLEX Developement Environment

Erika Erika -- supported MCUsupported MCUppppCurrently available as a product for:Currently available as a product for:Currently available as a product for:Currently available as a product for:

Microchip dsPICMicrochip dsPICAtmel AVRAtmel AVRAtmel AVRAtmel AVRAltera NIOS II Altera NIOS II (with multi(with multi--core support!)core support!)

Also available for:Also available for:Also available for:Also available for:ARM7TDMI ARM7TDMI (Samsung KS32C50100, Triscend A7, ST Janus, ST STA2051)(Samsung KS32C50100, Triscend A7, ST Janus, ST STA2051)( g , , , )( g , , , )Hitachi H8 (RCX/Lego Mindstorms)Hitachi H8 (RCX/Lego Mindstorms)Tricore 1Tricore 1PPC 5xx (PPC 566EVB)PPC 5xx (PPC 566EVB)C167/ST10 (Ertec EVA 167, tiny/large mem. model)C167/ST10 (Ertec EVA 167, tiny/large mem. model)

Page 17: FLEX D l tFLEX Developement Environment

Development ChainDevelopment Chain

To obtain a running demo:To obtain a running demo:To obtain a running demo:To obtain a running demo:HardwareHardware::

FLEX Board;FLEX Board;Microchip ICD2; Microchip ICD2;

SoftwareSoftware::SoftwareSoftware::Microchip MPLab IDE;Microchip MPLab IDE;Microchip C30 compiler;Microchip C30 compiler;EvidenceEvidence Erika EnterpriseErika EnterpriseEvidence Evidence Erika EnterpriseErika Enterprise..

Page 18: FLEX D l tFLEX Developement Environment

Erika PackageErika Packagegg

It t iIt t iIt contains:It contains:CygwinCygwin Environment;Environment;CygwinCygwin Environment;Environment;

EclipseEclipse 3.3;3.3;ppRTRT--DruidDruid plugin;plugin;

Erika EnterpriseErika Enterprise Kernel;Kernel;

E ik t fE ik t f S iS i d td tErika support for Erika support for ScicosScicos code generator.code generator.

Page 19: FLEX D l tFLEX Developement Environment

Eclipse EnvironmentEclipse Environment

EditorEditor

ProjectsProjects

OutputOutput

Page 20: FLEX D l tFLEX Developement Environment

My DemoMy DemoCreate from templateCreate from templateCreate from templateCreate from template

File → NewFile → New→→ RTRT--Druid Oil and C/C++ ProjectDruid Oil and C/C++ ProjectFile New File New RTRT Druid Oil and C/C ProjectDruid Oil and C/C Project

Page 21: FLEX D l tFLEX Developement Environment

My DemoMy DemoCompile the codeCompile the codeCompile the codeCompile the code

ItIt usesuses makefilemakefile andand CC3030 compilercompiler toto produceproduce thetheexecutableexecutable forfor thethe targettarget architecturearchitecture..

Page 22: FLEX D l tFLEX Developement Environment

My DemoMy DemoImport and Flash in MPLabImport and Flash in MPLabImport and Flash in MPLabImport and Flash in MPLab

Configure → Select DeviceConfigure → Select DeviceConfigure → Select Device…Configure → Select Device…Choose dsPIC33FJ256MC710Choose dsPIC33FJ256MC710

Programmer → Select Programmer → Programmer → Select Programmer → →→ MPLAB ICD2MPLAB ICD2File → ImportFile → Import

Find the pic30 cof insideFind the pic30 cof inside P j tDi /D bP j tDi /D bFind the pic30.cof inside Find the pic30.cof inside ProjectDir/DebugProjectDir/Debug

Programmer → ConnectProgrammer → ConnectProgrammer → ProgramProgrammer → ProgramP R l f R tP R l f R tProgrammer → Release from ResetProgrammer → Release from Reset

Page 23: FLEX D l tFLEX Developement Environment

My DemoMy DemoView the code in MPLabView the code in MPLabView the code in MPLabView the code in MPLab

Page 24: FLEX D l tFLEX Developement Environment

My DemoMy DemoDebug the code in MPLabDebug the code in MPLabDebug the code in MPLabDebug the code in MPLab

StackStackRun MenuRun Menu

StackStackPointerPointer

BreakPointBreakPointMMMenuMenu

BreakPointBreakPoint

RAMRAMStatusStatusBreakPointBreakPoint

Page 25: FLEX D l tFLEX Developement Environment

HW demosHW demos

XBee compass ltraso nd recei erXBee compass ltraso nd recei erXBee, compass, ultrasound receiverXBee, compass, ultrasound receiver

TCP/IP dTCP/IP dTCP/IP demoTCP/IP demo

C fC fDC Motor identificationDC Motor identification

Page 26: FLEX D l tFLEX Developement Environment

HW demosHW demos

Image transfer sing 802 15 4Image transfer sing 802 15 4Image transfer using 802.15.4Image transfer using 802.15.4FLEX BoardFLEX BoardERIKA EnterpriseERIKA EnterpriseChipcon 2420 TransceiverChipcon 2420 TransceiverChipcon 2420 TransceiverChipcon 2420 TransceiverCMOS CameraCMOS CameraMi hi MAC LMi hi MAC LMicrochip MAC LayerMicrochip MAC Layer

Page 27: FLEX D l tFLEX Developement Environment

QuestionsQuestions

Page 28: FLEX D l tFLEX Developement Environment

RealReal Time Systems LaboratoryTime Systems Laboratory

RETIS RETIS LabLab

Mauro MarinoniMauro Marinoni

RealReal--Time Systems LaboratoryTime Systems Laboratory

Mauro MarinoniMauro Marinoni[[[email protected]]]

Retis:Retis:Retis:Retis:http://retis.sssup.ithttp://retis.sssup.it

Evidence:Evidence:Evidence:Evidence:http://www.evidence.eu.comhttp://www.evidence.eu.com

Scilab:Scilab:http://www.scilab.orghttp://www.scilab.org