Sei sulla pagina 1di 27

ds30 Loader

Main manual

October 2012

ds30 Loader
Main manual

Copyright 2010-2012 MG Digital Solutions

1 / 27

ds30 Loader
Main manual

October 2012

Table of contents
Tableofcontents........................................................................................................................2
Introduction................................................................................................................................5
ds30Loader............................................................................................................................5
PrerequisitesandRequirements............................................................................................5
Trademarks.............................................................................................................................5
Whyuseabootloader...........................................................................................................5
Usage..........................................................................................................................................6
Operatingsystemconsiderations...........................................................................................6
Windows.............................................................................................................................6
Linux...................................................................................................................................6
MacOSX............................................................................................................................6
Installtherequiredtoolsuite.................................................................................................6
Modifyfirmwaresettings.......................................................................................................6
Buildthefirmware..................................................................................................................6
Writefirmware.......................................................................................................................6
Preparetheapplication..........................................................................................................7
Downloadtheapplicationtothedevice................................................................................7
Firmwarematrix.........................................................................................................................8
Clients.........................................................................................................................................9
Console...................................................................................................................................9
GUI..........................................................................................................................................9
API...........................................................................................................................................9
CAN...........................................................................................................................................10
Lawicel..................................................................................................................................11
IXXAT....................................................................................................................................11
Vector...................................................................................................................................11
Configuration............................................................................................................................12
Basicsettings........................................................................................................................12
Portname.........................................................................................................................12
Baudrate..........................................................................................................................12
Writeflash........................................................................................................................12
Writeeeprom...................................................................................................................12
Readflash.........................................................................................................................12
Readeeprom....................................................................................................................12
CAN.......................................................................................................................................12
PICID................................................................................................................................12
GUIID...............................................................................................................................12
Extendedframes..............................................................................................................12
DLC....................................................................................................................................12
Advanced..............................................................................................................................13
Dontwritegotototheuserapplication..........................................................................13
Allowoverwriteofthebootloader..................................................................................13
Writeconfigurationbits...................................................................................................13

Copyright 2010-2012 MG Digital Solutions

2 / 27

ds30 Loader
Main manual

October 2012

Custombootloader..........................................................................................................13
Autobaudrate.................................................................................................................13
Echoverification...............................................................................................................13
PutCRCbeforegoto.........................................................................................................13
Dontwriteemptypages..................................................................................................13
Dontsetgototoblat0x00..............................................................................................14
Timing...................................................................................................................................14
Hellotimeout....................................................................................................................14
Polltime............................................................................................................................14
Timeout............................................................................................................................14
Delayafterportopen.......................................................................................................14
Reset.....................................................................................................................................14
RTS....................................................................................................................................14
DTR...................................................................................................................................14
Command.........................................................................................................................14
ID......................................................................................................................................15
DLC....................................................................................................................................15
Baudrate..........................................................................................................................15
Activation.............................................................................................................................15
RTS....................................................................................................................................15
DTR...................................................................................................................................15
Security.................................................................................................................................15
Password..........................................................................................................................15
Operation.................................................................................................................................16
Parsingofhexfile.................................................................................................................16
Validation.........................................................................................................................16
Datacollection..................................................................................................................16
Checkofdatathatcouldoverwritethebootloader.......................................................16
CheckandmoveofGOTO................................................................................................16
Countingofdata...............................................................................................................16
SetGOTOtobootloader..................................................................................................16
Write.....................................................................................................................................16
Raiseofprocesspriority...................................................................................................16
Devicereset......................................................................................................................16
Autobaudrate.................................................................................................................16
Findbootloader...............................................................................................................17
Determinebootloadersize..............................................................................................17
Parsehexfile....................................................................................................................17
Write.................................................................................................................................17
Bootloaderupgradeprocedure...............................................................................................18
Troubleshooting.......................................................................................................................19
Knownissues........................................................................................................................19
Errormessages.....................................................................................................................19
HWschematics.........................................................................................................................21
UART/softwareUART.........................................................................................................21

Copyright 2010-2012 MG Digital Solutions

3 / 27

ds30 Loader
Main manual

October 2012

Components.....................................................................................................................21
Schematic.........................................................................................................................21
CAN.......................................................................................................................................22
Components.....................................................................................................................22
Schematic.........................................................................................................................22
AppendixALinks...................................................................................................................23
AppendixBmemorymap......................................................................................................24
AppendixCWritetimesamples............................................................................................25
AppendixDFiles.....................................................................................................................26
Packagecontent...................................................................................................................26
Filescreatedbyds30Loader................................................................................................27

Copyright 2010-2012 MG Digital Solutions

4 / 27

ds30 Loader
Main manual

October 2012

Introduction
ds30 Loader
ds30LoaderisabootloadersupportingPIC12,PIC16,PIC18,PIC24,dsPIC,andPIC32families
ofMCUsfromMicrochip.Itsupportsalldevicesineachfamilyoutofthebox(thosein
production).Thefirmwareiswritteninassembler.ThePCclientsrunonWindows,Linux,
andMacOSX.

Prerequisites and Requirements


Requirementsforthedifferentpartsofds30Loaderisfoundintheirrespectivemanual.

Trademarks
Allrightstocopyrights,registeredtrademarks,andtrademarksresidewiththeirrespective
owners.

Why use a boot loader


Abootloaderusuallyallowssoftwareupgradewithcheaporgenerallyavailableequipment
suchasanRS232port,asopposedtospecializedandexpensiveequipmentsuchasaPIC
programmer.Writetimemightalsobelowerwithabootloader.

Drawbacksofusingabootloaderincludeaddedbootuptimeandincreasedflashmemory
usage.

Copyright 2010-2012 MG Digital Solutions

5 / 27

ds30 Loader
Main manual

October 2012

Usage
Operating system considerations
Windows
N/A

Linux
Theuserrunningds30Loadershouldbeamemberofthedialoutgroup.Toaddauserinthe
dialoutgrouprunthefollowingcommandasasuperuser:
useradd G dialout username

Mac OS X
Theuserrunningds30Loadershouldhavesufficientrightstoreadfromandwritetothe
desiredport.

Install the required tool suite


Therequiredcompiler/assemblertoolsuiteneedstobeinstalledbeforethebootloader
firmwareisopenedinMPLABIDE.Ifthetoolsuiteisnotinstalledwhentheprojectis
opened;importantsettingsmaybelost.Seethefirmwaremanualforinformationaboutthe
requiredtoolsuite(s).

Modify firmware settings


Refertothefirmwaremanualfordetailedinformation.

StartMicrochipMPLABIDE.
OpenthefirmwarebyclickingOpenontheprojectmenu,andthenbrowsetothe
ds30loader.mcpfilewhichislocatedinthefirmwaredirectory.
Opensettings.inc(assemblerfirmware)orboard_xxx.h(Cfirmware)bydoubleclicking
itintheprojecttreetotheleft.Reviewallsettingsandmodifywhenneeded.
Openuser_code.inc(assemblerfirmware)orboard_xxx.c(Cfirmware)bydouble
clickingitintheprojecttreetotheleft.Reviewtheavailablemacros/functionsand
addinit/exitcodeifneeded.
Useexactlythesameconfigurationbitsfromtheapplicationinthebootloader
unlessyouhaveagoodreasonnotto.

Build the firmware


BuildthefirmwarebyclickingBuildallontheprojectmenu.Noticeanywarningsinthe
outputwindow.Correctanyerrorsthatappearintheoutputwindow.Refertothefirmware
manualfordetailedinformationaboutds30Loaderspecificwarningsanderrors.

Write firmware
Writethefirmwaretoyourdeviceusingyourfavoriteprogrammer.Fordetailedinformation,
refertothefirmwaremanual.
Copyright 2010-2012 MG Digital Solutions

6 / 27

ds30 Loader
Main manual

October 2012

Prepare the application


Youneedtomakesurethereisagotoplacedatlocation0x00inyourapplication.Inmost
casesyourlinkeralreadydoesthisforyou.TocheckifitdoesyoucanpickProgamMemory
fromtheViewmenuinMPLAB.Itwilllooksomethinglikethescreenshotbelow.TheGUI
willletyouknowifitdoesnotfindagoto.

Download the application to the device

StarttheGUI.
Selectthedesiredcommunicationsettingsandpickyourhexfile.Fordetails,referto
theGUImanual.
Pressthewritebutton.
Resetdevicemanuallyifneeded.
Waitforthewriteoperationtocomplete.

Copyright 2010-2012 MG Digital Solutions

7 / 27

ds30 Loader
Main manual

October 2012

Firmware matrix
Thefollowingfirmwaresareavailable.Fordetailedinformationrefertothefirmware
manual.

UART
Sw UART*
X
X
PIC12
X
X
PIC16
X
X
PIC18F
X
X
PIC18FJ
X
X
PIC24FK
X
X
PIC24FJ
X
X
PIC24H
X
PIC24E
X
X
dsPIC30F
X
X
dsPIC33F
X
dsPIC33E
X
PIC32
*Onlyavailableinthecommercialversion

CAN*
n/a
n/a
X
n/a
n/a
n/a
X
X
X
X
X
X

I2C*

SD card*

see
ds30 HEX
Loader

see
ds30 SD
card loader

Copyright 2010-2012 MG Digital Solutions

8 / 27

ds30 Loader
Main manual

October 2012

Clients
Console
ItisacommandlineinterfacethatrunsonWindows,Linux,andMACOSX.Refertothe
consolemanualformoreinformation.

GUI
ItisagraphicaluserinterfacethatrunsonWindows,Linux,andMACOSX.RefertotheGUI
manualformoreinformation.

API
TheAPIisusedtointegratebootloaderfunctionalityina.NETapplication.Itisordered
separately;contactMGDigitalSolutionsformoreinformation.

Copyright 2010-2012 MG Digital Solutions

9 / 27

ds30 Loader
Main manual

October 2012

CAN
Theds30LoadersupportsbootloadingontheCANbus.Seetable1foravailablefirmwares
andtable2forsupportedCANadapters.CANoperationisnotavailableinthefreeedition.

DeviceFamily
Firmwareavailable SupportedDLC
PIC12
n/a

PIC16
n/a

PIC18
yes
18*
PIC24F
n/a

PIC24FJ
n/a

PIC24H
yes
18*
PIC24E
yes
18
dsPIC30F
yes
18
dsPIC33FJ
yes
18*
dsPIC33E
yes
18
PIC32
yes
18
Table1.AvailableCANfirmwares,*dependsonfirmwaretypeandversion

Adapter

IXXAT

Kvaser
Vector
Peak

Lawicel

ISCAN

Supported
bitrates
10k,20k,50k,100k,
125k,250k,500k,800k,
and1M
50k,62k,83k,100k,
125k,250k,500k,and
1M
100k,125k,250k,500k,
and1M
5k,10k,20k,50k,100k,
125k,250k,500k,and
1M
10k,20k,50k,100k,
125k,250k,500k,800k,
1M
10k,20k,50k,100k,
125k,250k,500k,800k,
1M

Windows
x86
x64

Linux
x86
x64

MacOSX
x86
x64

ESD

Contact
IntrepidCS
NICAN

X=supportedandrecommended*=supported=notsupported
Table2.SupportedCANadapters

Copyright 2010-2012 MG Digital Solutions

10 / 27

ds30 Loader
Main manual

October 2012

Lawicel
TheremaybeissuesrelatedtoLawicelCANadapters,seetheTroubleshootingKnownissues
sectioninthisdocument.

TheLawicelCAN232adapterisshippedwiththebaudratesetto57600.Thebaudratecan
beincreasedforaperformanceimprovement;itisdoneintheconfigurationwindow
availableinds30LoaderGUI.Theserialinterfacebaudratecannotbechangedwiththeds30
Loaderconsoleapplication.

Iftheds30Loaderconsoleapplicationisused,theserialinterfacebaudratemustbeset
manuallyintheLawicelportconfigurationfiletoreflectthebaudratetheLawiceladapteris
configuredfor.

IXXAT
TheremaybeissuesrelatedtoIXXATCANadapters,seetheTroubleshootingKnownissues
sectioninthisdocument.

ThebitratescanbefullycustomizedbyeditingtheixxatBitRates.xmlfile.Itislocatedinthe
samedirectoryastheds30Loaderexecutables.

Vector
ThebitratescanbefullycustomizedbyeditingthevectorBitRates.xmlfile.Itislocatedinthe
samedirectoryastheds30Loaderexecutables.

Copyright 2010-2012 MG Digital Solutions

11 / 27

ds30 Loader
Main manual

October 2012

Configuration
Thissectionisvalidfords30LoaderGUI,ds30Loaderconsoleandtheds30LoaderAPI.

Basic settings
Port name
Thenameoftheportthatwillbeusedtocommunicatewiththefirmware.

Baud rate
Thebaud/bitratethattheportwillbesetupforpriortocommunicatingwiththefirmware.

Write flash
Whenchecked,theflashmemoryiswrittenduringawriteoperation.Thisisdisabledifthe
chosenhexfiledoesnotcontainanyprogrammemorylocations.

Write eeprom
Whenchecked,theeeprommemoryiswrittenduringawriteoperation.Thisisdisabledif
thechosenhexfiledoesnotcontainanyeeprommemorylocations.

Read flash
Whenchecked,theflashmemoryisreadduringareadoperation.

Read eeprom
Whenchecked,theeeprommemoryisreadduringareadoperation.

CAN
PIC ID
ThissettingisonlyavailableforCANports,itspecifiesthePICCANID,anditshouldbesetto
thesamevalueasinthebootloaderfirmware.Thiscanbeenteredasdecimal(example10)
orhex(example0xa).

GUI ID
ThissettingisonlyavailableforCANports.ItspecifiesGUICANIDanditshouldbesettothe
samevalueasinthebootloaderfirmware.Thiscanbeenteredasdecimal(example10)or
hex(example0xa).

Extended frames
Whensetextendedframesaresentandonlyextendedframesarereceived.

DLC
ThissettingdetermineshowmanybytesofdatawillbesendineachCANframe.Notthat
notallCANfirmwaressupporthighDLCthan1.

Copyright 2010-2012 MG Digital Solutions

12 / 27

ds30 Loader
Main manual

October 2012

Advanced
Thispagecontainsadvancedsettingsthatarenormallynotused.

Dont write goto to the user application


Whenenabled,thefirstinstructionsinthehexfilewillnotbemovedtojustbeforetheboot
loader.Thiscanbeusefulwhenwritingpartofanapplicationoronlydatatoflash.

Allow overwrite of the boot loader


Whenahexfileisparsedthereiscontroltomakesurethatthecontentswillnotoverwrite
thebootloader,byenablingthissettingthatcontrolisdisabled.Thisdoesnotbypassthe
firmwaresownoverwriteprotectionifany.

Write configuration bits


Whenchecked,theconfigurationbitsiswrittenduringawriteoperation.Thisisdisabledif
thechosenhexfiledoesnotcontainanyconfigurationsbitsorifthehexfilecontainsmore
configurationbitlocationsthantheselecteddevicehas.Writingconfigurationbitsareonly
possibleonceperpoweroncycle.

Custom boot loader


Allowsproperoperationwithcustombootloaderfirmwareswheresizeandplacementhas
changed.Greatcaremustbetakentosetcorrectcustomplacementandsize,theymust
matchtheBLPLPandBLSIZEPdefinesinthefirmware.Ifawriteismadewiththewrong
customparameters,thebootloadermaygetbrokenifthefirmwaredoesntfeature
overwriteprotection.

Auto baud rate


Whenenabled,anautobaudratesynchronizationcharacterissentpriortothewrite,read
andcheckforbootloaderoperations.Thefirmwaremustbesetupforautobaudrate
detection.Notallfirmwarescomewiththisfeature.

Echo verification
Ifthedevicehardwareorfirmwareissetuptoechoallreceiveddatathisoptionmustbe
enabled.Whenenabledtheds30Loaderenginewillcompareallsentdatawiththeecho.
Andgiveanerrorifthereisamismatch.

Put CRC before goto


Calculatesa16bit(14bitforPIC12andPIC16)checksumvalueoftheprogrammemoryand
storesitjustbeforetheuserapplicationgotothatinturnisplacedjustbeforetheboot
loader.

Dont write empty pages


Whenthisisenabledpagesthatonlycontain0xffwillnotbewritten.Thismaydecrease
writetimeandmayalsoresolvetheThehexfilecontainscodethatwilloverwritetheboot
Copyright 2010-2012 MG Digital Solutions

13 / 27

ds30 Loader
Main manual

October 2012

loadermessage.

Dont set goto to bl at 0x00


Usuallyagototothebootloaderisplacedat0x00.Whenthisoptionischecked,thefirstfew
wordsat0x00willnotbemodified.Ifahexfilethatcontainsdatainthefirstpageiswritten
withthisoptionenabledandthebootloaderfirmwaredoesnotfeaturegotoprotection,the
bootloaderwillnotworkanymorebecauseitwillnotbecalledonstartup.

Timing
Hello timeout
Specifiesthetimetosendthehellocommandbeforegivingupwhennoresponseis
received.

Poll time
Specifiestheintervalatwhichthehellocommandissenttothebootloader.

Timeout
Specifiesthecommunicationtimeout.

Delay after port open


Thisdelayisissuedrightaftertheportisopened.Itcanusuallybekeptat0.

Reset
RTS
Whenenabled,theRTSpinisheldhighpriortocommunicationwiththefirmware.Thevalue
ofresettimespecifiesthetimetheRTSpinisheldhigh.Thisisonlyavailableforserialports
andhardwaresupportmustbepresent.

DTR
Whenenabled,theDTRpinisheldhighpriortocommunicationwiththefirmware.The
valueofresettimespecifiesthetimetheDTRpinisheldhigh.Hardwaresupportmustbe
present.Thisisonlyavailableforserialports.

Command
Whenenabled,acommandissenttothedevicetorequestresetorloadingoftheboot
loader.WhenaCANportisused,themacros$PICIDand$GUIIDcanbeused,theywillbe
expandedtoatwoorfourbytebigendianvaluedependingonifextendedisusedornot.

Thevalueofresettimespecifiesthetimetowaitafterthecommandissentbeforetryingto
communicatewiththebootloader.

Theformatofthedataishexval1;string;string.
Examplehexonly:0;11;f;ab;3e

Copyright 2010-2012 MG Digital Solutions

14 / 27

ds30 Loader
Main manual

October 2012

Examplestringsonly:Hello;Reset
Examplemixed:a5;Reset

ID
TheCANidtobeusedwhensendingtheresetcommand.

DLC
TheCANDLCtousewhensendingtheresetcommand.

Baud rate
Thebaudratetousewhensendingtheresetcommand.

Activation
RTS
Whenchecked,theRTSpinisusedtoactivatethedevicebyholdingithighduringawrite
operation.Hardwaresupportmustbepresent.

DTR
Whenchecked,theDTRpinisusedtoactivatethedevicebyholdingithighduringawrite
operation.Hardwaresupportmustbepresent.

Security
Password
Thepasswordwillbesentbeforeanybootloaderoperationisperformed.

Copyright 2010-2012 MG Digital Solutions

15 / 27

ds30 Loader
Main manual

October 2012

Operation
Parsing of hex-file
Thefollowingoperationstakeplaceduringtheparsingofahexfile:

Validation
Thehexfileisvalidated.Linechecksums,fileformatandfilecompletenessischecked.Ifany
errorisdetected,theparsingisaborted.

Data collection
AlldatafoundinthehexfilethatfitsintheselecteddevicesmemoryareaarestoredinRAM
buffers.

Check of data that could overwrite the boot loader


Ifdatafoundinthehexfilebelongtothesamememoryspaceasthebootloader,awarning
isdisplayedandtheWriteprogramcheckboxgetsdisabled.

Check and move of GOTO


Thisstepisnotperformedifthehexfileisencrypted.IfnoGOTOisfoundataddress0x00
thebootloaderdoesnotknowhowtoloadtheuserapplicationandtheWriteprogram
checkboxgetsdisabled.IfaGOTOat0x00isfound,itismovedtothetwowordsjustbefore
thebootloader.

Counting of data
Thedatainthebuffersarecountedforpresentation.

Set GOTO to boot loader


AGOTOtothebootloaderisinsertedinthefirstwordsbeginningat0x00.

Write
Thefollowingoperationstakeplaceduringawriteoperation:

Raise of process priority


Ifthepolltimeissetlowerthan100ms,theGUIprocesspriorityisraisedtoabovenormal.

Device reset
Ifactivatedintheresettab,thedeviceisreset.

Auto baud rate


Ifautobaudrateischecked,theautobaudratesynchronizationcharacter(0x55)issent
usingpolltimeuntiltimeoutisreachedorthebootloaderresponds.

Copyright 2010-2012 MG Digital Solutions

16 / 27

ds30 Loader
Main manual

October 2012

Find boot loader


Thehellocommandissentusingpolltimeuntiltimeoutisreachedorthebootloader
responds.Thebootloaderrespondswithdeviceidandfirmwareversion.Thereceived
deviceidischeckedagainsttheselecteddeviceintheGUI.

Determine boot loader size


Thebootloadersizeisdeterminedbasedonthefirmwareversion.

Parse hex-file
Thehexfileisparsedifneededdependingonifthedeterminedbootloadersizeisdifferent
fromtheoneusedduringlastparse.

Write
Program,eepromandconfigurationbitsaresentforwritebythefirmware.Ifchecksum
errorisdetectedbythefirmware,theGUIretries3times.Ifall3triesfail,thewrite
operationisaborted.

Copyright 2010-2012 MG Digital Solutions

17 / 27

ds30 Loader
Main manual

October 2012

Boot loader upgrade procedure

Thisisnotrecommendedandsupportisnotguaranteed.

Thisguideassumesyouhavetheds30Loaderinstalledinthedefaultlocation.Thedefault
locationmaydifferbetweendifferentfirmwareversions.Followthesestepscarefully.The
mostcriticalstepis16:ifitfailsthebootloaderislikelytostopworking.

1. MakeacopyofbootloaderMPLABprojectdirectory.
2. OpentheMPLABprojectofthetemporarybootloadercreatedinthepreviousstep
3. Opensettings.inc
4. Disablegotoprotectionifavailable
5. Enablebootloaderprotectionifavailable
6. Changethebootloaderplacement,BLPLP(inolderversionsthisdefinemaybe
locatedinds30loader.s/asm):
Device
Bootloaderplacementoftemporary
family
bootloader,BLPLP/BLPLR
PIC16F
Upgradeisnotsupported
PIC18F
BLPLP2+1
PIC18FJ
BLPLP+2
PIC24F
BLPLR2+1
PIC24FJ
BLPLP+2
PIC24H
BLPLP+2
dsPIC30F
BLPLR2+1
dsPIC33FJ
BLPLP+2

7. Buildtheproject,MenuProject>MakeorF10
8. Opends30LoaderGUIandchoosethehexfilegeneratedinthepreviousstep
9. Writethetemporarybootloaderasyouwouldwithanyhexfile
10. Ifnotalreadyactivated,activateadvancedmodonthemenuView>Advancedmode.
11. CheckDontwritegotoat0x00undertheadvancedtab
12. CheckCustombootloaderundertheadvancedtab
13. PutvalueofBLPLP/BLPLRfromthetemporarybootloadertheplacementtextbox
14. PutvalueofBLSIZEP/BLSIZEfromtemporarybootloaderinthesizetextbox
15. Choosethehexfileofthenewbootloader
16. Makesurethetemporarybootloaderisactive,eitherusingtimeorusealedto
indicatethatthetemporarybootloaderisactive.
17. Write
18. Thebootloaderupgradeisfinished

Copyright 2010-2012 MG Digital Solutions

18 / 27

ds30 Loader
Main manual

October 2012

Troubleshooting
Known issues

WiththeLawicelCANadaptersreadoperationisnotpossibleformostcombinations
ofbitrateandserialinterfacebaudrate.Typicallyanybitrateabove50kwillnot
workforreadflashoperation.Writeoperationstillworks.
TheIXXATISBtoCANcompactadaptertakesseveralhundredmillisecondstosetup.
Thismeansthatthefirmwaretimeoutcannotbesetshorterthanthisifareset
commandisusedandtheapplicationusesadifferentbitratethanthebootloader.

Error messages

Trouble

Possiblecause
Brokenchip
Wornoutflash
Chipisused
outsidespecifications

Verificationfailed"
Codeprotectionisused

Solution
Replacethechip.
Replacethechip.
Readdatasheetandmake
sureallspecificationsare
met
Ifcodeprotectionisusedthe
deviceshouldbecompletely
erasedbeforetheboot
loaderiswritten.
Restartthedevicebefore
pressingdownload.

Uartrxbuffernotemptyas
expected(isdevicesending
data?)

Thiscouldhappenifthe
deviceisnotrestarted
properlyandissendingdata

Hardwaredetecteda
framingerror

Thismighthappenwhenthe
baudrateerrorisjustonthe
limit.

Tryadifferentbaudrate,
higherorlower.Needstobe
changedinboththeboot
loaderfirmwareandthe
hostapplication.
Tryanothercomport.

Thehexfilecontainscode
thatwilloverwritetheboot
loader

Thisoccurswhentheloaded
hexfilecontainsmemory
locationsthatcould
overwritethebootloader.It
canalsooccurifthewrong
deviceisselected.

Becausetheapplicationdoes
notknowtheactualboot

Selectcorrectdevice.

Copyright 2010-2012 MG Digital Solutions

Setcustombootloader
propertiesunderthe
advancedtabtothevalues
fromthefirmware,usually
calledBLPLPandBLSIZEPin
settings.inc.
Freeupprogrammemoryif
needed.

19 / 27

ds30 Loader
Main manual

Hexfilecontainsmore
configlocationsthanthe
devicehas

Lastrowcontainingconfigs
wasfoundinhexfile,last
pagehasbeendisabled.
Consultmanualformore
information.

October 2012

loadersizepriorto
communicationwiththe
bootloaderitassumesa
size.Thisvaluemightbe
wrong;onecantellthe
applicationthecorrectvalue
undertheadvancedtab.

Ifyouusetheexport
functionfromMPLABthis
mighthappen.

OnPIC18FJ,PIC24FJ,andon
somePIC24E/dsPIC33E
devicestheconfiguration
wordsarestoredasthelast
wordsintheordinaryflash
addressspace.The
configurationwordsarevital
tothePICoperation.To
avoidcorruptingthe
configurationwordsor
changingthemwhichcould
leadtothebootloadernot
functioningproperlythelast
pageinflashwillnotget
written.

Reservebootloadermemory
spaceintheapplication
linkerscript.

Usethehexfileproducedby
theassemblerorlinker.

Towritethelastpagein
flash,checkthewriteconfigs
checkboxunderthe
advancedtab.

Itisunlikelythatthelast
pagewillcontainanycode,
thereforeitisusuallysafeto
notwritethelastpageand
thisisalsorecommended.

Copyright 2010-2012 MG Digital Solutions

20 / 27

ds30 Loader
Main manual

October 2012

HW schematics
UART / software UART
ThisisjustasampleimplementationofUARTcommunication.Theschematiccomeswithout
warranty.

Components
Name
IC1
IC2
X1
R1
C1
C2
C3
C4
C5
C6
C7
R2
R3
D1
Q1

Value
PIC
MAX202
DB9
10k
100n
10F
100nF
100nF
100nF
100nF
100nF
10k
10k
1N4148
BC547

Required
Required
Optional
Required
Recommended
Recommended
Recommended
Required
Required
Required
Required
Optional
Optional
Optional
Optional

Comment
PIC microcontroller
RS232 level converter
Connector
Master clear pull-up
Decoupling capacitor
Filter capacitor
Decoupling capacitor
Charge pump capacitor
Charge pump capacitor
Charge pump capacitor
Charge pump capacitor
Reset by RTS, base current limiter
Reset by RTS, base pull-down
Reset by RTS, RTS signal rectifier
Reset by RTS, RTS signal inverter

Schematic

Copyright 2010-2012 MG Digital Solutions

21 / 27

ds30 Loader
Main manual

October 2012

CAN
ThisisjustasampleimplementationofCANcommunication.Theschematiccomeswithout
warranty.

Components
Name
IC1
U1
X1
R1
R2
R3
C2
C3

Value
PIC
MCP2551
DB9
10k
120
22k
10F
100nF

Required
Required
Optional
Required
Optional
Required
Recommended
Recommended

Comment
PIC microcontroller
CAN transceiver
Connector
Master clear pull-up
Bus termination
Slew rate control, see the datasheet
Filter capacitor
Decoupling capacitor

Schematic

Copyright 2010-2012 MG Digital Solutions

22 / 27

ds30 Loader
Main manual

October 2012

Appendix A Links
ds30Loaderwebsite
http://www.ds30loader.com

ds30Loaderfreeeditionwebsite
http://mrmackey.noip.org/elektronik/ds30loader/

MicrosoftVisualC#expressedition
http://www.microsoft.com/express/vcsharp/

Mono/MonoDevelop
http://www.monoproject.com

Eagle
http://www.cadsoft.de

Copyright 2010-2012 MG Digital Solutions

23 / 27

ds30 Loader
Main manual

October 2012

Appendix B memory map

a. Thegotoapplicationwordat0x00isnormallycreatedautomaticallybythecompiler.
TheGUImovesthegototojustbeforethebootloadercode.
b. Theuserapplicationisnotaffectedbythebootloader
c. Anewgotoat0x00pointingtothebootloadercodeiscreatedbytheGUI.
d. Thebootloadercodeisnormallyplacedattheendofthememory.

Without bootloader

With bootloader

a GOTO USER
APPLICATION

GOTO
c
BOOTLOADER

START OF
EXECUTION

USER
APPLICATION

With bootloader
GOTO
c
BOOTLOADER
b

USER
APPLICATION

USER
APPLICATION

a GOTO USER
APPLICATION
d

a GOTO USER
APPLICATION
d
BOOTLOADER

BOOTLOADER
CONFIGS

PIC16, PIC18F, PIC24F,


PIC24H, dsPIC

Copyright 2010-2012 MG Digital Solutions

PIC18FJ, PIC24FJ

24 / 27

ds30 Loader
Main manual

October 2012

Appendix C Write time samples


Thesearesampletimesandshouldnotbeseenasawarranty,performancemaybedifferent
inyourapplication.Dataisactualdatathatendsupintheflashmemory.

UART
data[kB] baudrate
time[s] kB/s
Device
PIC12F
3,1
115200
5,5
0,6 PIC12F1822
PIC16F
14,0
115200
16,5
0,8 PIC16F1936
PIC18F
31,5
115200
8,3
3,8 PIC18F2550
PIC18FJ
14,0
115200
2,8
5,0 PIC18F24J11
PIC24F
15,5
115200
2,3
6,7 PIC24F16KA102
PIC24FJ
125,0
115200
15,5
8,1 PIC24FJ128GA010
PIC24HJ
126,5
115200
15,8
8,0 PIC24HJ128GP504

PIC24E

dsPIC30F
47,3
115200
7,7
6,1 dsPIC30F4011
dsPIC33FJ
254,5
115200
31,9
8,0 dsPIC33FJ256GP710
dsPIC33E
509,0
115200
76,4
7,2 dsPIC33EP512MU810
PIC32MX
508,0
115200
69,4
7,3 PIC32MX795F512L

CAN
data[kB] bitrate
time[s] kB/s
Device
PIC18F66K80
PIC18F

PIC24HJ
126,5
250000
40,0
3,0 PIC24HJ128GP504

PIC24E

dsPIC30F
47,0
250000
5,9
8,0 dsPIC30F4011
dsPIC33FJ
253,0
250000
84,0
3,0 dsPIC33FJ256GP710
dsPIC33EP512MU810
dsPIC33E

PIC32MX
508,0
250000
51,0
10,0 PIC32MX795F512L

Copyright 2010-2012 MG Digital Solutions

25 / 27

ds30 Loader
Main manual

October 2012

Appendix D - Files
Package content

File
\copying.txt
\bin
\bin\canlibCLSNET.dll
\bin\PCANBasic.dll
\bin\PCANBasic_x64.dll

Description
Thelicensefords30Loader
Containsbinaries
UsebytheKvaserCANportplugin
UsedbythePCANCANportplugin
UsedbythePCANCANportplugin,thisneedstobe
manuallyrenamedtoPCANBasic.dllonx64systems.
\bin\PCANBasic_x86.dll
UsedbythePCANCANportplugin,thisneedstobe
manuallyrenamedtoPCANBasic.dllonx86systems.
\bin\vcinet2.dll
UsedbytheIXXATCANportplugin
\bin\vxlapi.dll
UsedbytheVectorCANportplugin
\bin\vxlapi64.dll
UsedbytheVectorCANportplugin
\bin\vxlapi_NET20.dll
UsedbytheVectorCANportplugin
Requires:vxlapi.dll
\bin\ds30LoaderGUI.exe
Graphicaluserinterfacefords30Loader
\bin\ds30LoaderConsole.exe
Consoleapplicationfords30Loader.
\bin\ixxatBitRates.xml
ContainsCANtimingsusedbyIXXATCANportplugin
fordifferentbitrates
\bin\vectorBitRates.xml
ContainsCANtimingsusedbyIXXATCANportplugin
fordifferentbaudrates
\documentation
Containsalldocumentationfortheds30Loader
\firmwarexxx
ContainsaMPLABIDEprojectforasingleMicrochip
devicefamily
\firmwarexxx\ds30loader.mcp
MPLABIDEprojectfile
\firmwarexxx\src\devices.inc
Containsdeviceconstants
\firmwarexxx\src\settings.inc
Containsbootloadersettingsthatshouldbe
checked/changedbeforedownload
\firmwarexxx\src\user_init.inc
Userinitializationandexitcode
\firmwarexxx\src\ds30loader.s/asm Containsthebootloadercode
\links
Containslinkstowebpagesthatarerelevanttothe
ds30Loader
\source
ContainsaVisualStudio2008solution
\tools
Containsafewtoolsthatmaybeusefulwhen
determiningwhatsettingsoneshoulduse
settings.inc
\tools\dsPIC33PLLsettings.xls
AnExcelsheettohelpsettingupthePLLondsPIC33
devices.ProvidedbyLeoBodnar
\tools\UARTerrorcalculator
Helpfultocalculateuartsettings
\tools\CANtimingcalculator
HelpfultocalculateCANsettings

Copyright 2010-2012 MG Digital Solutions

26 / 27

ds30 Loader
Main manual

\tools\bldelaycalculator.xls

October 2012

Calculatestimingconstants

Files created by ds30 Loader


Createdfilesareusuallyplacedinuserhomedirectory\.ds30Loader

File
Description
settingsPortLawicel.xml
SettingssavedbyLawicelCANportplugin
settingsPortSerial.xml
Settingssavedbyserialportplugin
settingsPortVector.xml
SettingssavedbyVectorCANportplugin
settings.xml
GUIsettings
recentfile*.xml
GUIsettingsforrecentfiles

Copyright 2010-2012 MG Digital Solutions

27 / 27

Potrebbero piacerti anche