Home

uPD78F0828B 8-bit Single-Chip Microcontroller Flash Self

image

Contents

1. Preliminary User s Manual uPD78F0828B 8 bit Single Chip Microcontroller Flash Self Programming Library V 1 0 Document No U14995EE1VOUMOO Date Published November 2000 NEC Corporation 2000 Printed in Germany NOTES FOR CMOS DEVICES PRECAUTION AGAINST ESD FOR SEMICONDUCTORS Note Strong electric field when exposed to a MOS device can cause destruction of the gate oxide and ultimately degrade the device operation Steps must be taken to stop generation of static electricity as much as possible and quickly dissipate it once when it has occurred Environmental control must be adequate When it is dry humidifier should be used Itis recommended to avoid using insulators that easily build static electricity Semiconductor devices must be stored and transported in an anti static container static shielding bag or conductive material All test and measurement tools including work bench and floor should be grounded The operator should be grounded using wrist strap Semiconductor devices must not be touched with bare hands Similar precautions need to be taken for PW boards with semiconductor devices on it HANDLING OF UNUSED INPUT PINS FOR CMOS Note No connection for CMOS device inputs can be cause of malfunction If no connection is provided to the input pins itis possible that an internal input level may be generated due to noise etc hence causing malfunction CMOS devices behave differently than Bipolar or NMOS
2. North America Hong Kong Philippines Oceania Asian Nations except Philippines NEC Electronics Inc NEC Electronics Hong Kong Ltd NEC Electronics Singapore Pte Ltd Corporate Communications Dept Fax 852 2886 9022 9044 Fax 65 250 3583 Fax 1 800 729 9288 1 408 588 6130 ai cece tronics Hong Kong Ltd e iconductor Technical Hotli l ectronics Hong Kong Ltd emiconductor Technical Hotline A O Bra Fax 044 548 7900 Technical Documentation Dept Fax 02 528 4411 Fax 49 211 6503 274 South America Taiwan NEC do Brasil S A NEC Electronics Taiwan Ltd Fax 55 11 6465 6829 Fax 02 2719 5951 would like to report the following error make the following suggestion Document title Document number Rage number If possible please fax the referenced page or drawing Document Rating Excellent Clarity O Technical Accuracy O Organization O
3. 0x76F 0x0000 J As described the ROM is divided into an upper and a lower block only the upper block is directly accessible for the Self Programming routines Nevertheless the whole Flash Area is programmable by using the Self Programming Swap Function Preliminary User s Manual U14879EE1VOUMOO 13 Chapter 1 Introduction 1 2 4 Entering Self Programming Mode After applying the 10 V to VPP and entering Self Programming mode the upper ROM block will be switched with the hidden ROM Area Figure 1 5 Memory configuration after entering SelfProgramming Mode Normal Mode Internal RAM inkl SFR 1 0Kbytes CAN RAM 0 5 Kb Code executable RAM 1 5Kbytes Self programming Mode Internal RAM inkl SFR 1 0Kbytes CAN RAM 0 5 Kb Code executable RAM 1 5Kbytes Subroutine call Erase Flash Memory Write 29 75K bytes Verify Hidden ROM Flash Memory 29 75K bytes erasable area Flash Memory 29 75K bytes Flash Memory 29 75K bytes Subroutine call From this Hidden ROM area all Self Programming functions calls are executed After the boot strap and the code is written the upper ROM block contains the new program so the ROM blocks are re switched to enable the new code Now the new block1 can be programmed The below figure shows this in detail Figure 1 6 Detailed description of Flash Programming Internal RAM inkl Internal RAM inkl SFR 1 0Kbytes CAN RAM 0
4. 5 Kb Code executable RAM 1 5Kbytes Flash Memory 29 75K bytes erasable area Flash Memory 29 75K bytes SFR 1 0Kbytes CAN RAM 0 5 Kb Code executable RAM 1 5Kbytes 2 Flash Memory 29 75K bytes erasable area Flash Memory 29 75K bytes gt Internal RAM inkl SFR 1 0Kbytes CAN RAM 0 5 Kb Code executable RAM 1 5Kbytes Flash Memory 29 75K bytes Flash Memory 29 75K bytes erasable area Internal RAM inkl SFR 1 0Kbytes CAN RAM 0 5 Kb Code executable RAM 1 5Kbytes _ Flash Memory 29 75K bytes 29 75K bytes Preliminary User s Manual U14879EE1VOUMOO Chapter 1 Introduction 1 2 5 The Entry RAM The Entry RAM Area is a pre defined area with a length of 32 bytes These bytes contain all data nec essary for the firmware routines and are initialized by the library call function SP_Init Normally pre defined values are stored here by the Init Function so the user shouldn t change them If there is a need to change this values please follow the information provided in this chapter Following picture shows the structure of the EntryRAM Area struct ERAM unsigned char _Reserved1 unsigned char _Reserved2 unsigned int _FlashMemStartAdr unsigned int _Reserveda unsigned char _BytelnFlash_BlockNo unsigned char _Write TimeData1 unsigned char _EraseTimeDatat1 unsigned char _EraseTimeData2 unsigned char _EraseTimeData3 unsigned char _ConvTime
5. Preliminary User s Manual U14879EE1VOUMOO 27 Chapter 2 Software 2 3 5 SP_AreaVerify Figure 2 7 API header for the SP_AreaVerify Function extern unsigned char SP AreaVerify unsigned int SPBuffStartAdr unsigned int RTSF Adr Purpose This function uses Firmware roultine AreaVerifpy to measure if the data an Flash is able to stand a 10 pear retention This is done in steps of 256 Bytes Attention This is done with use of the 256 Bytes of the defined RAM buffer Please take care that writing of data and Verifying or writing difieren data with verifying doesn t go apart too much RISF can be enabled The Verify function needs also more than one calling parameter The ROM address where the temp data will be written to is still defined The parameters are listed in the following table Input parameters output parameters SP_BuffStartAdr Sets address of RAM buffer RB3_B error code stored in register B of Bank 3 where temporarily data is stored _RTSF_Adr 0x0000 when no RTSF support is needed The verification of the whole Flash Area is done by this function The input parameter SP_BuffStartAdr is copied into EntryRAM Area to the WriteDataStorageStartAdr The firmware routine does a byte to byte compare of the whole Flash block in 256 Byte steps There fore the RAM buffer is used to copy the data out of the Flash into the RAM and do the comparison If the check wasn t successful an error is generated and the test
6. The used linker file defines following Areas e Ucode Area where the User code used for the RISF support function will reside Not only in this example this Area should be from OxF000 to max Ox gt FF e MySegER Area which includes the Entry RAM Area the example defines this from OxFE21 to OxFE43 e MySegRB This Area resides in RAM and stores the data read by a protocol like CAN The example sets this value from OxF6E0 to OxF7DF e USERCODE By first programming this area contains the data that will be copied as RTSF user support function into the Ucode Area e SWAPCODE This area contains code which can be copied to the Flash and be called after both Flash blocks have been swapped To complete the example the non library version of the MAIN c file is given here certain values are defined for the CAN ASSP3 which should be carried by the user to guarantee Self Programming func tionality Preliminary User s Manual U14879EE1VOUMOO 31 Figure A 2 Example for Self Programming MAIN c file f PROTECT Self Progreming Library for CANASSPS NEC Electronics Germany Gmbi MODULE MAIN c Kanzlerstrage 2 VERSION 1 0 D 40472 Duesseldori 30 06 2000 R Laschewski NEC EG APD AMAC CSD Purpose This is the MATN file for testing the functions given in SP library pe Ali functions that provide Firmware funcitioneality are called with propper parameters and an example is tested to copy user code from Sef ROM area
7. defined tame vatues out of this header file SP Igit will Cisse the Estry RAN Area except BL Une a AD Ueto gt and copies the user defined tame data in Entrp RAM RTSF during the function call can be enabled This function allows the user to place own user furcilons during ROM write process e g watchdog interrupts can be polled only Like described in the above picture the In and Out Parameters are as follows Input parameters _RTSF_Adr 0x0000 when no RTSF support is needed output parameters RB3_B error code stored in register B of Bank 3 The function calls several firmware routines to initialise and check the EntryRAM If a RealTimeSup portFunction is requested by the input parameter the RTSF function is automatically called within the used firmware routines Default values out of the Firmware ROM that are based on an 8MHz clock are written into the Entry RAM Area These are 50 usec 2 sec and 10 msec for the three parameters write erase and conver sion time After setting these values and testing if the settings are in a defined range a return value is created and the function is ended If the values written by the SP_Init function doesn t fit into users need they must be rewrittenmanually With the given start address and the offset from chapter The Entry RAM o n page7 all recent values can be changed The Start Address of Entry RAM must be defined in the xcl file because all library functio
8. is ended Please take care that the writing of the data and the AreaVerify shouldn t go apart to long A successful test will guarantee a data security of 10 years 28 Preliminary User s Manual U14879EE1VOUMOO Chapter 2 Software 2 3 6 SP_Swap Figure 2 8 Header file of SP_Swap function extern unsigned char SP Swap unsigned int SwapRetAdr unsigned int _RTSF Adr Purpose Calls the firmware swap routine that moves upper flash block wath the lower Flasb bloc After thas remapping the customer code at SwapRetAdr is started RISF can be disabled The Swap function should be called after all needed data is written from RAM to Flash so a full fea tured program is located in the upper memory block This following the upper and the lower block must be switched so the former lower block can be erased and written to access the whole Flash ROM Area Input parameters output parameters SwapRetAdr Sets address where program coun RB3_B error code stored in register B of Bank 3 ter after swap has to point to _RTSF_Adr 0x0000 when no RTSF support is needed If the Swap is executed the program counter is set to the SwapReturnAddress at leaving the firmware routine The starting address of the related program should be located here In case of error while executing the Swap function e g losing the VPP following figure declares which ROM block will actual be the upper ROM block Figure 2 9 Different effects of Sw
9. specifications for example specifications for third party tools and components host computers power plugs AC supply voltages and so forth e Network requirements In addition trademarks registered trademarks export restrictions and other legal issues may also vary from country to country NEC Electronics Inc U S Santa Clara California Tel 408 588 6000 800 366 9782 Fax 408 588 6130 800 729 9288 NEC Electronics Germany GmbH Duesseldorf Germany Tel 0211 65 03 02 Fax 0211 65 03 490 NEC Electronics UK Ltd Milton Keynes UK Tel 01908 691 133 Fax 01908 670 290 NEC Electronics Italiana s r l Milano Italy Tel 02 66 75 41 Fax 02 66 75 42 99 NEC Electronics Germany GmbH Benelux Office Eindhoven The Netherlands Tel 040 2445845 Fax 040 2444580 NEC Electronics France S A Velizy Villacoublay France Tel 01 30 67 58 00 Fax 01 30 67 58 99 NEC Electronics France S A Spain Office Madrid Spain Tel 91 504 2787 Fax 91 504 2860 NEC Electronics Germany GmbH Scandinavia Office Taeby Sweden Tel 08 63 80 820 Fax 08 63 80 388 NEC Electronics Hong Kong Ltd Hong Kong Tel 2886 9318 Fax 2886 9022 9044 NEC Electronics Hong Kong Ltd Seoul Branch Seoul Korea Tel 02 528 0303 Fax 02 528 4411 NEC Electronics Singapore Pte Ltd United Square Singapore 1130 Tel 65 253 831 1 Fax 65 250 3583 NEC Electronics Taiwan Ltd Taipei Taiwan Tel 02 2
10. 1 5Kbytes Flash Memory Flash Memory 30 00K bytes 29 75K bytes erasable area erasable area Flash Memory Flash Memory 29 75K bytes 30 00K bytes 18 Preliminary User s Manual U14879EE1VOUMOO Chapter 1 Introduction A signature is located on the upper side of each Flash block This signature is written active or non active depending on the status the block should have The block with the written signature is automatically the lower block In unfavourable circumstances e g voltage drop the signature of the upper Flash block might be written and the one of the lower block might not be destroyed After RESET randomly one of the two blocks may be recognized as valid In this case the user must prepare his software to recognize whether the original or the new programmed block is containing the actual code 1 2 8 RTSF Support The RTSF so called RealTimeSupportFunction support gives the user the possibility to let real time functions like watchdog timer network management communications or other run while the Self Pro gramming functions are in use To start the RTSF support by calling the Self Programming library functions a RTSF value unequal to 0x0000 equivalent to the start address of the RT SF user function in RAM must be set This will call the RTSF function which will set this start address of the RIT SF user support function into the Entry RAM Area For RTSF usage a dedicated Area form OxFOOO to max OxF5FF in RAM is reserve
11. 2 Self Programming on UPD78FO828B c oooccconcccnccconcccocanoconononenonanonnnnnnornnnanrnnnannrrnnannnnmnanes 12 1 2 1 DESCRIPTOR a a a a a A E Aa 12 1 2 2 A airar E EE E 12 1 2 3 Memory map in Normal Mode ccccsscsssccssessseeeeseeeeesecneaseoeasecneaseenenseneneeeneneeaeaseananeees 13 1 2 4 Entering Self Programming Mode ccccccceeeeeeeseeeeenseeseeseeseeeseeeeoesseseenseeeeensseesoeseeees 14 1 2 5 TME ENY RAM A ia 15 1 2 6 Functions in the Self Programming library cc ssccesseesssseeeeesseeseesseeeeensesseesseesenaeenes 18 1 2 7 Secure S l Pr ogramMmMkhhg isindi o a E a aa aai 18 1 2 8 R TSF SUDDO ita 19 Chapter 2 SONWANE aini a E a E 21 2 1 Me mory demandsS sicie a A A aa 21 2 1 1 Setup the RAMMAanDINd vna 21 2 1 2 LINKEF CONMGUFALION ii iia 21 2 1 3 Resulting MEMOLy layOUL is 22 2 2 Prepare Self Programming ura Masiehinatdercandenteredstieiutbedte 22 2 2 1 Preconditions soii 22 2 3 Application Programming Interface Functions ooocconcconccononononcnnnancnnnnncnnancnnanrnnannnnanns 23 2 3 1 Standardized Input and Output parameters ooccocccocconcconcconccnnncconnronnncnanenanrrnanennanenans 23 2 3 2 SP aia 25 2 3 3 SR E IPN a r a a a kewccsncestemeutaxe 26 2 3 4 SP WIG oni a ib 27 2 3 5 A estas sees a A 28 2 3 6 SP OWAD din 29 Appendix A Example programming sequence s sssssssssnunnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnmnnn nnmnnn 31 Appendix B Programming with FLASH MASTER ccscsceeeseesee
12. 719 2377 Fax 02 2719 5951 NEC do Brasil S A Electron Devices Division Rodovia Presidente Dutra Km 214 07210 902 Guarulhos SP Brasil Tel 55 11 6465 6810 Fax 55 11 6465 6829 J99 1 Preliminary User s Manual U14995EE1VOUMOO Readers Purpose Organization Legend Preliminary User s Manual U14995EE1VOUMOO Preface This manual is intended for users who want to understand the functions of the uPD78F0828B This manual presents the hardware manual of uPD78F0828 This system specification describes the following sections e Pin function e CPU function e Internal peripheral function e Flash memory Symbols and notation are used as follows Weight in data notation Left is high order column right is low order column Active low notation xxx pin or signal name is over scored or xxx slash before signal name Memory map address High order at high stage and low order at low stage Note Explanation of Note in the text Caution Item deserving extra attention Remark Supplementary explanation to the text Numeric notation Binary XXXX or xxxB Decimal XXXX Hexadecimal XXXXH or Ox XXXX Prefixes representing powers of 2 address space memory capacity k kilo 219 1024 M mega 2 1024 1 048 576 G giga 2 10249 1 073 741 824 MEMO 6 Preliminary User s Manual U14995EE1VOUMOO Table of Contents Chapter i INIFOGUCUON i ocacion 11 1 1 General ODESSA 11 1
13. B F6E0 F7DF RAM Buffer Segment here 256Byte reduces the DCAN t 1 12 Receive Buffers The user code area is fixed to location FOOO tomax F5FF the Entry RAM Area is defined from FE21 to FE43 resulting in a length of 32 bytes the Read Buffer is defined from F6E0O toF7DF resulting in a length of 256 Byte Preliminary User s Manual U14879EE1VOUMOO 21 Chapter 2 Software 2 1 3 Resulting memory layout By allocating the needed segments above the following Self Programming memory layout is gener ated Figure 2 2 Memory outline using SP settings OxFFFF p Special Function Register 256 x 8Bit OxFFOO General Register 32 x 8Bit a N Area Intemal high speed RAM OxFB00 1024 x 8Bit OxFAFF NOT Useable OxFA80 OxFA7F i LC Display RAM OxEAG4 28 x 4Bit di NOT Useable Read 2 Data OxF600 ENE User Area Expans RAM oxFo00 1 5 kByte OxEDFF Internal Hash ROM Block 1 76FF ee Internal Rash ROM Block O Ox0000 2 2 Prepare Self Programming This chapter will describe the conditions to get a full running system with Self Programming 2 2 1 Pre conditions To get the Software running the following should be defined before starting programming Is there need of a User function that provides the ability of Real Time Support If this function is needed define the approximate length of the program that will reside in
14. Datat1 unsigned char _ConvTimeData2 unsigned char _ConvTimeData3 unsigned int _WrDatStorStartAdr unsigned int _RAMRoutsStartAdr unsigned int _FlashSwapRetAdr unsigned char _IntervTimeData1 unsigned char _Reserved4 11 y The start address of the entry RAM Area is defined in the APl header file and respective the linker file The important elements in the Entry RAM are described as follows e FlashMemory Start Address Here the address takes place where the Flash Writing routine starts to write e No of bytes written in flash memory This value has to been set to Ox0O1allways description of the ROM block number where firmware routines take effect only the Write function is here in use of the number of bytes which will be written Maximum of 256 bytes in a row e WriteTimeData1 This value is following the formula WriteTime WriteTimeDatal x2 OperatingFrequency The time the ROM cells are written is declared in this cell Example for frequency of 8 MHz Operating frequency WriteTimeData1 dec 200 e EraseTimeData 1 3 These three values are calculated by the assumption that ina first try the erasing of ROM should take 2 seconds of time if the first erase wasn t successful the erase time will be changed to a value about 0 25 seconds and the block will be erased with this time quanta again until the whole ROM is erased Preliminary User s Manual U14879EE1VOUMOO 15 Chapter 1 Introduction For two seco
15. Erase Blank check Write Verify Disable Vpp Voltage Select Normal Operating Mode al User program Prepare Parameters Application Program User program Boot area N User Program End of self Y E programming Hidden ROM 20 Preliminary User s Manual U14879EE1VOUMOO Chapter 2 Software 2 1 Memory demands 2 1 1 Setup the RAM mapping As described before in this document the RAM usage has to be canalized for using all features of the Flash SelfProgramming routines Some constant memory layouts are necessary as follows An area with a length of 32 Bytes containing the EntryRAM The Write Data Storage Buffer with a defined length of 256 Bytes The Stack Area length approximately 40 Byte The User Code Area with a max length of 1 5 KByte defined from OxFOOO to max OxF5FF 2 1 2 Linker configuration In the I AR workbench the linker file xy xcl defines the needed areas A sample linker file configuration is shown below Figure 2 1 Sample header file with mem configuration LINK XCL XLINK command file to be used with the 78000 Embedded Workbench using procesor option v1 memory model option ms or mS Archived Revision 1 1 11 c Copyright IAR Systems 199 changes for Secure SelfProgramming C NEC Electronics Germany GmbH 2000 Z DATA ucode F000 F5FF Area to write user code in RAM Z DATA MySegER FE21 FE43 RAM segment for Entry RAM 32byte Z DATA MySegR
16. ap routine Swap function execution Error occurs whil Swap withou O EP or between any erro ae before fouine setting new sig vA anging nature and des the signature troing old one old block old upper Flash block i a et Ge 1 willbe is new code Flash block new block boot block Preliminary User s Manual U14879EE1VOUMOO 29 MEMO 30 Preliminary User s Manual U14879EE1VOUMOO Appendix A Example programming sequence To guide the user by programming the Flash Device with the on chip Secure Self Programming a sam ple programming sequence is shown First of all the linker file should be configured to specify the used RAM and Flash Areas Figure A 1 Example for Linker file in AR workbench LINK XCL XLINK command file to be used with the 78000 Embedded Workbenc using procesor option v1 memory model option ms or mS Archived Revision 1 1 _ c Copyright IAR Systems 1997 changes for Secure SelfProgramming C NEC Electronics Germany GmbH 2000 Z DATA ucode F000 F5 FF Area to write user code in RAM Z DATA MySegER FE2 1 FE43 RAM segment for Entry RAM 32byte Z DATA MySegRB F6E0 F7DF RAM Buffer Segment here 256Byte EN Define all other Self Programming related stuff EN Z CODE USERCODE 4000 45FF Area where user code in ROM resides Z CODE SW APCODE 4600 4B FF Area where Code for Swap resides
17. be programmed in self programming mode To write data also into the lower block the two blocks can be switched with the swap self programming function so that the old lower block will be permanently the upper block This new constellation is also valid after RESET A further call of the swap routine will fail until the present upper block is erased Figure 1 2 Layout with Self Programming 10 Vpp Voltage Generator Preliminary User s Manual U14879EE1VOUMOO 11 Chapter 1 Introduction This document explains how self programming is working and how it can be used under assistance of an API Application Programming Interface This API is realized as a library written in a higher level programming language ANSI C It should facilitate the use of the self programming functions out of the user program In the second chapter the environment is described how this API can be used in programs to get full self programming functionality This document is based on the device 78F0828B but can easily be used for other devices with the same self programming technology and real time support 1 2 Self Programming on pPD78F0828B The following chapter will describe the main topics of Self Programming on the uPD78F0828B and how the programming is done on the chip 1 2 1 Description Starting with a un programmed chip the user is responsible to program a boot loader supporting the Self Programming functions in the lower block of the Flash Area T
18. by th customer The export or re export of this product from a country other than Japan may also be prohibited without a license from that country Please call an NEC sales representative The information in this document is current as of 02 11 2000 The information is subject to change without notice For actual design in refer to the latest publications of NEC s data sheets or data books etc for the most up to date specifications of NEC semiconductor products Not all products and or types are available in every country Please check with an NEC sales representative for availability and additional information No part of this document may be copied or reproduced in any form or by any means without prior written consent of NEC NEC assumes no responsibility for any errors that may appear in this document NEC does not assume any liability for infringement of patents copyrights or other intellectual property rights of third parties by or arising from the use of NEC semiconductor products listed in this document or any other liability arising from the use of such products No license express implied or otherwise is granted under any patents copyrights or other intellectual property rights of NEC or others Descriptions of circuits software and other related information in this document are provided for illustrative purposes in semiconductor product operation and application examples The incorporation of these circuits software and information in
19. cation interface is selected by pulsing the VPP voltage The princi ple is shown in figure 1 3 Normal mode Ground level is attached to Pin 14 the chip will start user program execution at the address defined by the RESET vector at address 0000h Self programming mode Self programming mode is called out of the normal mode after 10 V sup ply to VPP To achieve a secure programming during all events like e g power fail the lower flash block can not be programmed To program the whole flash both flash blocks can be exchanged once For additional exchanges the upper block has to be erased first Real time functions like watch dog or network communication are also supported during self program ming with the RTSF Real Time Support Function RTSF is user code located in RAM and is automati cally called within 1ms out of the Self programming mode 1 2 3 Memory map in Normal Mode In the normal Mode the memory configuration looks like follows Figure 1 4 Normal mode memory layout A OxFFFF l Special Function Register 256 x 8Bit OxFFOO General Register 32 x 8Bit Internal high speed RAM 1024 x 8Bi OxFB00 OxFAFF NOT Useable OxFA80 OxFA7F LC Display RAM SADA 28 x 4Bit OxFA63 NOT Useable OxF7DF Application and DCAN RAM OxF600 OR POR E User Area Expans RA OxFO00 1 5 kByte Not useable EBP Internal Flash ROM Block 1 Internal Flash ROM Block 0
20. d The user must define this Area in his xcl link file and has to copy the RTSF user function into RAM by himself While calling the Self Programming routines in non equidistant steps lower than 1msec the support function is called without halting the Self Programming routines Figure 1 10 Outline of RealTimeSupportFunction SFR 1 0Kbytes CAN RAM 0 5 Kb Code executable PAX RAM 1 5Kbytes et I gt E a Nevertheless it is not dangerous to call user support functions probably running longer than the execu tion interval of the Self Programming function The SP function is stopped after the execution interval is ended without any respect to the RTSF user function duration Using this feature no long durating user RTSF support function can disturb the running SP proce dures The user function resides in the Area from OxFOOO to max OxF5FF equivalent to 1 5 KByte of RAM This Area must be allocated by the user for RTSF support Preliminary User s Manual U14879EE1VOUMOO 19 Chapter 1 Introduction As a general overview the whole procedure of Self Programming is shown in the following diagram please use this as template for all Self Programming purposes Figure 1 11 Complete Self Programming procedure Start of Self Programming Copy Codeto RAM onlyiV RTS used Branch to lower flash block RAM Disable Interrupts Select Self Programming Mode Enable Vpp Voltage Call Firmware Subroutine Hidden ROM
21. devices Input levels of CMOS devices must be fixed high or low by using a pull up or pull down circuitry Each unused pin should be connected to Vpp or GND with a resistor if it is considered to have a possibility of being an output pin All handling related to the unused pins must be judged device by device and related specifications governing the devices 3 STATUS BEFORE INITIALIZATION OF MOS DEVICES Note Power on does not necessarily define initial status of MOS device Production process of MOS does not define the initial operation status of the device Immediately after the power source is turned ON the devices with reset function have not yet been initialized Hence power on does not guarantee out pin levels I O settings or contents of registers Device is not initialized until the reset signal is received Reset operation must be executed immediately after power on for devices having reset function Preliminary User s Manual U14995EE1VOUMOO MS DOS and MS Windows are either registered trademarks or trademarks of Microsoft Corporation in the United States and or other countries PC AT and PC DOS are trademarks of IBM Corp The related documents in this publication may include preliminary versions However preliminary versions are not marked as such The export of this product from Japan is regulated by the Japanese government To export this product may be prohibited without governmental license the need for which must be judged
22. e ParamError define VerifyError define MriteError define OverEraseError define BlankCheckError Hdetine MoError Following a short description of the error messages follows e Parameter Error This error is defined if some of the values defined in the Entry RAM Area are not compatible to the function execution e g Block No 1 or write 20 Bytes to OxEDFO e Verify Error This error is defined when internal verification of written data is not executed correctly e Write Error If the data from RAM to Flash ROM cannot be written correctly this error will be shown e OverErase Error This error is returned if any cell is overerased This could happen in following cases erasing takes too long erased cells are erased again cells programmed with FF equals to never programmed are erased The last two cases can be avoided by using the prewrite function before each erase function call Depending of the over erase status of the cell an over erase error could be corrected by using the WriteBack function e BlankCheck Error If the internal Blank Check finds non blank memory cells this error code is gen erated e No error No error is encountered 24 Preliminary User s Manual U14879EE1VOUMOO Chapter 2 Software 2 3 2 SP_Init Figure 2 4 Header of Function SP_Init extern char SF Init unsigned int RTSF Adr Purpose This function initializes all ANTRY RaMw wath global data by calling Jibrary functions with the pre
23. e function is finished with no error If there are non blanked cells the Pre Writing of the area is initiated This Pre Writing should preserve the ROM Area from OverErase Errors by writing Ox00 to all cells After this Pre Write is done the full upper ROM Area will be erased To get a fast time for erasing and a Type of Erasing internal SP lib Variable Name Initial Erasing FirstEraseTimeData 1 3 Repeated Erasing RepeEraseTimeData 1 3 apr 0 25 sec minimum stress for the flash block the erasing is done in an iteratwe way Between each step an erase success is checked by a blank check Type of Erasing internal SP lib Variable Name Initial Erasing FirstErase TimeData 1 3 Repeated Erasing RepeErase TimeData 1 3 apr 0 25 sec Max Erasing A E T While the first Erase cycle is not successful the writing parameters are changed to the shorter repeti tive values to start the next erase iteration 26 Preliminary User s Manual U14879EE1VOUMOO Chapter 2 Software In case of OverErasing the SP_Erase subroutine will write Back the FlashROM This means that the write back function tries to repair the over erased cell by kind of special writing The SP_Erase function will be ended either by successful Blank Check or reaching the maximum erase or conversion time By reaching the maximum times an error code is returned 2 3 4 SP_Write Figure 2 6 API Header for SP_Write unsigned char SP Write unsigned int 3PiriteStartAdr
24. e upper Flash ROM block where writing data from the RAM buffer is started any value from 0x7800 onwards to OxEEOO minus SPNoByte is valid e SPNoByte For the Write Function this value defines the number of bytes to be written into the Flash Memory starting from SPWriteStartAdr onwards Valid values are from 1 to 256 e SPBuffStartAddress Defines the Start address of the RAM buffer This RAM buffer contains the data for the write routine and is used by the Area_Verify routine too e SwapRetAdr This address defines the starting address of the new program which will be called after the upper and the lower block were swapped please remember that this must not be the address the microcontroller jumps to after executing the RESET procedure While the Swap is executed the signature of the upper block is written and the signature of the lower block is destroyed so that after a RESET Function is released the old upper block retains his new lower position and the new program is executed by taking the new start vector at address 0000 Preliminary User s Manual U14879EE1VOUMOO 23 Chapter 2 Software Output Parameter Error Flag All functions will return the same parameter but with different values The different values are worked within the SP library but errors which are not re workable will be directed to the calling program The error codes are listed in the following Figure 2 3 Return Error Messages Jg Error Messages Hdetin
25. gram ming functions 32 Preliminary User s Manual U14879EE1VOUMOO In short terms the following sequence must be applied Define used system RAM and Flash Areas Use SP_Init to initialize the Entry RAM Area with valid values Use SP_Erase to erase the upper Flash Memory block Be sure that the data to be programmed in the formerly blanked Flash block is located in the RAM Buffer Call SP_Write to write the data from RAM to Flash Get the Verification of the written data withSP_Verify Do a Swap using SP_Swap to activate the new written program Program the now new upper block with data from RAM Buffer with steps described above As description the following flowchart gives an overview how to program the Flash ROM Preliminary User s Manual U14879EE1VOUMOO 33 Figure A 3 Sample Flowchart for complete SP description Define used RAM Areas in linker file Enter selfProgramming Prepare receipton fof data to write in RAM Butter Call SP_Init Call SP Erase Call SP Write Call SP Verity Call SP_ Swap Leave SelfProgramming Repeat steps B to D After the declaration is done the user program should define a protocol which can carry the data into the MySegRB Area in blocks of 256 Byte When the area is filled the Self Programming mode has to be entered by calling the belonging SP Rou tines First the steps A to E in the above given Flowchart are executed to get a fully programmed upper Flash memory block With s
26. he On Chip Secure Self Programming functions Preliminary User s Manual U14879EE1VOUMOO 37 MEMO 38 Preliminary User s Manual U14879EE1VOUMOO Appendix C Revision History Documentation Version Description Initial Documentation Self Programming Library Version Description Initial Library release Preliminary User s Manual U14879EE1VOUMOO 39 MEMO 40 Preliminary User s Manual U14879EE1VOUMOO Appendix D Related Software To use the described SelfProgramming features the following Software parts are necessary Description Header file with APl Information a library file with described library functions to use with 78F0828b SP_lib r26 Emulation library emulator r26 Device file for 78F0828b Df0828b h Sample Link file for use with the l AR workbench SP_Lnk xc library with outsourced standard library calls SP_lO6fit Preliminary User s Manual U14879EE1VOUMOO 41 MEMO 42 Preliminary User s Manual U14879EE1VOUMOO Although NEC has taken all possible steps essag e to ensure thatthe documentation supplied to our customers is complete bug free and up to date we readily accept that From errors may occur Despite all the care and precautions we ve taken you may Name encounter problems in the documentation Please complete this form whenever Company HA youd like to report errors or suggest Improvements to us Tel FAX Address Thank you for your kind support
27. he Self Programming support func tions must be included in the final application program too if data or parameter updates are further necessary By a user defined communication channel data must be written to a specified RAM Area this data is later on programmed to the upper memory block After programming of upper ROM block is done the ROM blocks are swapped so the actual code resides in the old ROM block1 Now the new ROM blockO can be programmed whereby all Flash Memory is Write accessible 1 2 2 Control of VPP Normal Flash Programming The user can program the Flash Area but no security and no sup port of RAM based functions are given while running the Firmware routines Secure Flash Self Programming The user can program the Flash Area but in case of failures at least one ROM block is recognized to contain valid data RTSF Selfprogramming The user can run any function without interrupt but using watchdog out of a pre defined RAM Area while using the Self Programming routines This is called RealTime SupportFunction Figure 1 3 Outline of Programming Voltage Vpp pulses HN Voo S RESET Flash write mode Vss 12 Preliminary User s Manual U14879EE1VOUMOO Chapter 1 Introduction While RESET release different modes can be selected Flash Mode Connected 10 V to VPP at rising RESET signal will switch to the flash programming mode The used serial communi
28. id for any customer who is using the NEC KO family Secure SelfProgramming firmware with Realtime support like it is implemented in the uPD78F0828B CANASSP3 Both Hard and Software Environment have to be configured to use Self Programming Two different modes are possible to access the Flash Memory e Using the OnBoard Programming Mode An initial program has to be programmed into the device via a programming tool like the FLASH Master It can be connected to an interface on an applica tion target board This program is either the full code to be programmed or should include a so called BOOT LOADER located in the lower FLASH memory area The main task of this BOOT LOADER is to start basic software functions after leaving the RESET mode and to support the Flash Self Programming functionality for reprogramming from a connected network Figure 1 1 Hardware environment of Flash Master flash MASTER e Using the Self Programming Mode In self programming mode data can be programmed to the flash Data can be parameters or program code that got into the device by support of the user pro gram Therefore the user program can use all device specific peripherals like CAN UART and tim ers Once the data is in the device e g buffered in the RAM area it can be programmed via an internal programming interface to the upper half flash area The flash ROM is divided into two blocks an upper block 1 and a lower block block 0 Only the upper block can
29. n ibe routine starts the erase of the whole upper Flash biock including the signature for the specified time It s possible that more streams are needed For the whole flash biock to erase For this case ali function calls afterwards ara repeated with RepEraseTimelata By reaching MaxErascrame SF Erase is finished with return valus Blanit heckirror In case of Overirase funcion SP ArgaWriteBack is called to iry repair of over erased cella For the first time the value FirstiConwTime is used If erasing with this tame quanta wasn t successful a value for repeated erasing is used instead THe erasing Will be ended either by succefulily blasnkcheack or reaching the maximum erase or conversion time and returning the related error code The Erase function is the most complex function of the library set The only input parameter needed is the RTSF usage value Input parameters _RTSF_Adr 0x0000 when no RTSF support is needed Output parameters RB3_B error code stored in register B of Bank 3 The output parameter will give information about the status of Flash block Erasing Between the calling and the ending of the erase function several options are calculated in the Erase function itself A short overview should give the user an introduction what the Erase function will do internal First of all a blank Check is done to determine whether the ROM block to be flashed is already empty or not If the Area is blank the eras
30. nds erasing the three values are defined as OxF5 OxB 0x5 at 8 MHz following the formula EraseTimeData2 EraseTimeData3 EraseTime EraseTimeDatal x 2 OperatingFrequency The values for TimeData2 and TimeData3 should be left as they are Example for Erase Times of 2 and 0 25 seconds 8 MHz OP Frea EraseTimeD1 dec EraseTimeD2 dec EraseTimeD3 dec S MHz 2 007 seo RO O oae e ConvTimeData 1 3 The ConversionTimeData defines a value in milliseconds how long a Flash cell has to be re written after an over Erase has occured This time the over erased cells are written back A normal time quanta for this matter is about 10ms This is created by ConvTimeData2 0x08 ConvTimeData3 0x03 or 0x01 and for 8MHz with ConvTimeData1 Ox9D following the equation ConvTimedata2 ConvTimeData3 ConversionTime ConvTimeData1 x 2 Operating requency The conversion Time results in 10 msec Example for Conversion Times of 50 and 10 msec with OP frequency of 8 MHz OP Freq ConvTimeD1 dec ConvTimeD2 dec sca dec 50 msec 10 05 msec e WriteData StoragBuffer StartAddress These two bytes define the starting address of a RAM buffer The RAM buffer is used to stocks data for writing into the upper Flash block and for verifying e RAM routine StartAddress These two bytes contain the address where the user program is located It is called while the RTSF function in ROM programming is enabled e FlashSwap ReturnAddress The
31. ns use this address to get data out of the Entry RAM and start the Flash Programming The following table shows an example for an Init routine er gt _BytelnFlash_BlockNo BlockNo init BINo No of Byte in Flash er gt _WriteTimeData1 Write TimeData1 init Time to write Data er gt _EraseTimeData1 FirstEraseTimeData1 init Erase Time Data in three er gt _ Erase TimeData2 FirstEraseTimeData2 vars er gt _ Erase TimeData3 FirstErase TimeData3 er gt _ConvTimeData1 FirstConvTimeData1 init conversion Time data in er gt _ConvTimeData2 FirstConvTimeData2 three vars er gt _ConvTimeData3 FirstConvTimeDatas This can be done if the standardized values written into the Entry RAM by the library Initilization don t fit into the users special needs Preliminary User s Manual U14879EE1VOUMOO 25 Chapter 2 Software 2 3 3 SP Erase Figure 2 5 Header file of Erase function extern unsigned char SP Erase unsigned int RTSF Adr Purpose First thas function blank checks block no zero if it is Blank FFH If successfull function is aborted with parameter Of Returns Blank Check Error if any cell is not blank If blankcheck fails SP prewrite is started which writes ell Hesh byi es ef the upper block with 005 to avoid erasing of erased cells fovererase There 18 no check for write access Afterwards FirstErase Timefata is copied to the entry RAM and SP Areairase is started With this functio
32. nseeeeseeeesseeeeseeeensesenseesonsesonees 19 Complete Self Programming procedure c ccccessceeeseceeseeeeeesseeeeeseeeeeeseeeeenneesensaees 20 Sample header file with mem configuratiON ccooccconnccnnnconcanonennnanennannonenannrennannnnnnanns 21 Memory outline using SP SettingS ooncconccoconconacconannnnonanonennnnnonnnnonennannrennanrrnnaanennnnns 22 Return Error Messages vsuionnticio id 24 Header Of FUNCUONSP Ilo ct a ina 25 Meader tile Of EFASE TUNACI N iii a aa 26 APE Header Tor SPAWN ai ide 27 APIl header for the SP_AreaVerify FUNC ON ccooccocccconoconnnncncnnanonennancnnnnanorenannnrnnanannns 28 Header file of SP_Swap funciton siciliana 29 Different effects of Swap routine coria deal 29 Example for Linker file in I AR workbench cccccesceeseceseeeeseeeeeeenseeessonseneaseeneeneaes 31 Example for Self Programming MAIN c file ooocconccoonncconncccconacononnnncccnnanonnnaanonnnnas 32 Sample Flowchart for complete SP descripti0N coocconccccccocccconcconnccnanenancnonncnnnnnonas 34 Output sequence of Flash Master SoftWare cccsccesecensecensecnsecensecensseneeceneeoees 35 Download of intel hex formatted file into the Flash Master oonconncconcconccioncnonanon 36 DOVICO PLODOTHI S iii A A A A A AA 37 Preliminary User s Manual U14879EE1VOUMOO 9 10 Preliminary User s Manual U14879EE1VOUMOO Chapter 1 Introduction 1 1 General topics This users manual shall serve as a programming a
33. ot activated Flash end DODOEDFF Flash blocks Help with h D78F0828B gt epv Blank Check ERROR Prewrite Area 0 OK Area 1 OK End Prewrite 2 Flash areas 01 01 00 Erase time 3000 ms 01 01 00 Erase time 3000 ms 100 OK Internal verify OK Device connected IMern undef Autopro undef Preliminary User s Manual U14879EE1VOUMOO 35 This hexfile is downloaded into the Flash Master Figure B 2 Download of intel hex formatted file into the Flash Master Select a File to download arno A Enot needed Firsttest 59_RAMareaRTSF hex Intel Hex files hex Than the combined sequence BlankCheck PreWrite Erase WriteBack is executed After this is finished a system RESET has to be done to activate the formerly written program 36 Preliminary User s Manual U14879EE1VOUMOO The settings for the device are shown in the last picture Figure B 3 Device Properties Device Setup Properties standard Advanced Device Set Defaults Type Fires sabes File Details Communication interface to device Type UART y 5000 i On Target Number fo Fosc Hz 8000000 M On Target speed 76800 Baud v IE Address f Frescaler fi y Blankcheck Erase Mode Programming Yertying Mode f Chip C Area f Chip C Area Start i 0 Start fi 0 E End i EDFF y End EDFF y cene Using this sequence the device can be programmed with the Flash Master as easy as with t
34. rtation equipment automobiles trains ships etc traffic control systems anti disaster systems anti crime systems safety equipment and medical equipment not specifi cally designed for life support Specific Aircrafts aerospace equipment submersible repeaters nuclear reactor control systems life support systems or medical equipment for life support etc The quality grade of NEC semiconductor products is Standard unless otherwise expressly specified in NEC s data sheets or data books etc If customers wish to use NEC semiconductor products in applications not intended by NEC they must contact an NEC sales representative in advance to determine NEC s willingness to support a given application Notes 1 NEC as used in this statement means NEC Corporation and also includes its majority owned subsidiaries 2 NEC semiconductor products means any semiconductor product developed or manufactured by or for NEC as defined above M5 2000 03 Preliminary User s Manual U14995EE1VOUMOO Regional Information Some information contained in this document may vary from country to country Before using any NEC product in your application please contact the NEC office in your country to obtain a list of authorized representatives and distributors They will verify e Device availability e Ordering information e Product release schedule e Availability of related technical literature e Development environment
35. s these values will give intentions for typical times changes to upper or lower bonds will be possible Figure 1 7 Sample time slices for SP Routines SP_BinkCh appr 6 usec SP_PreWr sr appr 1 5 sec 2 sec SP_Erase E up to 20 sec 0 25 sec SP_WrBck IN apor 1 5 sec ppr 200usec Byte SP_Write E up to 1 5 msec SP_Verify E appr 75 msec overall Time The functions used in the Flash Self Programming library to interface the Self Programming firmware are shown below Preliminary User s Manual U14879EE1VOUMOO 17 Chapter 1 Introduction 1 2 6 Functions in the Self Programming library This five functions provide all features to do a Secure Self Programming of the complete Flash Area Figure 1 8 Functions of Self Programming User Software i SP_Init 7 SP_Erase Self program ming Firmware Their functionality will be described later on in this user manual 1 2 7 Secure Self Programming To guarantee secure Flash Self Programming independent from e g loss of programming voltage or loss of device voltage during programming or during switch of the upper and the lower mem block a special function is designed to get at least one memory block active after RESET Figure 1 9 RESET execution and boot signature recognition SFR 1 0Kbytes lash Exchang RESET CAN RAM 0 5 Kb CAN RAM 0 5 Kb Mode Mode Code executable Code executable RAM 1 5Kbytes RAM
36. se cells contain the address where after the FlashSwap the new start Vector of the new program area is located e Returninterval TimeData1 This value adjusts the interval the RTSF support function is called depending on the external connected frequency The ReturnintervalTime is calculated by the for mula ReturnintervalTime ReturnintervalTimeDatal1 x 2 OperatingFrequency Example for 512 usec that secures a RTSF call of less than 1 024 msec Return Interval Time OP Frequency ReturnintTime Data1 dec Return Interval Time 0 512 msec 16 Preliminary User s Manual U14879EE1VOUMOO Chapter 1 Introduction To write this data by user program a pointer has to be defined e g pointer_ERAM which will be anchored to an array located at the pre defined EntryRAM address e g array_ERAM If the erase time values from the first try to the repeated try should be changed following syntax will do this for example pointer_ERAM amp array_ERAM ae pointer_ERAM gt _EraseTimeData1 RepeEraseTimeDatal sets the erase time to shorter cycle to prevent pointer_ERAM gt _EraseTimeData2 RepeEraseTimeData2 flash cells from stressing pointer_ERAM gt _EraseTimeData3 RepeErase TimeData3 The pointer is linked to the array structure then the needed ER values are set Following drawing will show sample values for the single function times These values are still prelimi nary and are intended to be changed Beside
37. seeseeeseeeeeesseeeenseeseenseeeeessessoeanenes 35 Appendix C REVISION PISTON avatar ios 39 Append D Related SONWANE ici iaa 41 Preliminary User s Manual U14879EE1VOUMOO 7 Preliminary User s Manual U14879EE1VOUMOO Figure 1 1 Figure 1 2 Figure 1 3 Figure 1 4 Figure 1 5 Figure 1 6 Figure 1 7 Figure 1 8 Figure 1 9 Figure 1 10 Figure 1 11 Figure 2 1 Figure 2 2 Figure 2 3 Figure 2 4 Figure 2 5 Figure 2 6 Figure 2 7 Figure 2 8 Figure 2 9 Figure A 1 Figure A 2 Figure A 3 Figure B 1 Figure B 2 Figure B 3 List of Figures Hardware environment of Flash Master cccscesseseseeseeeseeeneseeseseneeonseseaseneaeneaes 11 Layout with Selt Programimin 00 id 11 Outline Of Programming Voltage ccconccocnccnnncconcnononnncnnnanononannnnnnnnnrnnnannnnnnanerennannnananans 12 Normal mode memory layout cooccoccconcconccnnoconocnnnonnnnnnnnnnnononnnnnnnronana roman romana ronanarnanananas 13 Memory configuration after entering SelfProgramming Mode ccccsesseeseeeseees 14 Detailed description of Flash ProgrammingQ oomcoccccncconoconanccnnanonnnnncnnancnnnnrnnannrnaannnnss 14 Sample time slices for SP ROUtINGS ooooccoccccococcnonccnonnnononanonenannnnennnnnrnnnnnnrenannnrenanennn 17 FUNCTIONS Of Sel Programming ici is 18 RESET execution and boot signature recognNitiON ccsssessssesseseeseeseeeeseeseeeeeees 18 Outline of RealTIMESUPPOrtFUNCtiOn ccccceeeceeseece
38. the design of customer s equipment shall be done under the full responsibility of customer NEC assumes no responsibility for any losses incurred by customers or third parties arising from the use of these circuits software and information While NEC endeavours to enhance the quality reliability and safety of NEC semiconductor products customers agree and acknowledge that the possibility of defects thereof cannot be eliminated entirely To minimize risks of damage to property or injury including death to persons arising from defects in NEC semiconductor products customers must incorporate sufficient safety measures in their design such as redundancy fire containment and anti failure features NEC semiconductor products are classified into the following three quality grades Standard Special and Specific The Specific quality grade applies only to semiconductor products developed based on a customer designated quality assurance program for a specific application The recommended applications of a semiconductor product depend on its quality grade as indicated below Customers must check the quality grade of each semiconductor product before using it in a particular application Standard Computers office equipment communications equipment test and measurement equip ment audio and visual equipment home electronic appliances machine tools personal electronic equipment and industrial robots Special Transpo
39. the memory Area from OxFO00 to OxF5F Which protocol should responsible to get the data to program from outside into the chip Define the protocol using e g UART CSI CAN Where should the incoming data be stored Make sure that there is at least one RAM area defined with a maximum length of 256 bytes where the incoming data can be stored until it will be written by library calls into the Flash so that new data can be acquired Where should the Entry RAM Area reside Make sure that an Area in RAM with a length of 32 bytes is reserved so the data necessary for the Self Programming mechanism can be stored 22 Preliminary User s Manual U14879EE1VOUMOO Chapter 2 Software 2 3 Application Programming Interface Functions 2 3 1 Standardized Input and Output parameters All functions will use very similar In and Out Parameters which will be described as follows Input Parameters e RISF Parameter The input parameter used in every function is the _RTSF variable If this variable is set to 0x0000 while calling the depending SP library function no user RTSF function will be called while making the SelfProgramming function Otherwise if there is need of the RTSF Function the starting address of this user function has to be defined in the function call usually this will define address in the range from OxFOOO to max OxF5FF e SPWriteStartAddress This variable is used by the Write function and defines the target address in th
40. to RISF depending RAM area Enviroment Devices CANASS PI ae Assembler aA75000 Version c Compiler AAA Version Linker XLINA Version Debugger TDISEGHEC Version finclude SE Libh Finclude SP API h Hinclude jo7 8082x h ff Include SER definitions include SP exam h void main roid i Pee 0x00 sets system frequency IMS OxcF f sets system RAM and ROM IXS 0x08 Af gets system expansion RAM SE Init 0xF400 ff parameter RTSF Start SP Erase 0xF400 ff OxO0000 for testing purposes parameter RISF Start SP Write OxEDFF 128 WritePataStoragestartaAdr OxF400 4 parameter where to write jength RISF SP AreaVerify WreiteDatastaragestartaAdr Oxr400 ff parameter RISF SP Swap Ox 00 0xF400 ff adress to begin after swap RITSF SP Init OxF400 SP Erase 0xF400 SP Write OxEDFF 128 WriteDataStorageStartAdr 0xF400 SP AreaVerify WriteDatasStoragestartaAdr UxF400 f parameter The SP_lib h file is part of the library the SP_API h file is delivered with the library herein are defined values which can be changed to fit into users needs The used registers should be set in a way like shown above to provide the user with the needed RAM Flash and system frequency Following this the Self Programming functions are called in the described way Please note that there are only 128 bytes copied for this example that wouldn t be enough to support further Self Pro
41. unsigned char SPNoByte unsigned int SPBRuffStartaAdr unsigned int _RTSF Adr Calis the firmware rouline ByleWrite thats writing up te 246 bytes to the flash out of the RAM bufrfer Writing Will be reae tried up to ten times before ending witi write Error RTSF can be enabled As described in the above header file this function uses more than just the RT SF input parameters Input parameters output parameters SP_WriteStartAddress Sets address where in RB3_B error code stored in register B of Bank 3 Write error Writing to at least one bit was not successful in ROM Parameter Error WriteStartAdr SPNoByte exceeds write SPBuffStartAdr Declares the start address able Flash Area _RTSF_Adr 0x0000 when no RTSF support is The SP_Write function fetches data from pre defined RAM area and writes it into the upper Flash Block at starting address defined while the function is called If the RTSF support is requested the start address of the RTSF support function is written to the according Entry RAM Bytes With the input parameters the EntryRAM values Flash Memory Start Address No of bytes written in flash memory and WriteData_StoragBuffer_StartAddress are declared The write Time used for the write in of data is calculated as described in the following formula WriteTime WriteTimeDatal x 2 OperatingFrequency With an operating Frequency of 8 MHz and a Data1 of 200 the basic Write Time will amount to 50 usec
42. wapping both blocks the new upper block can be programmed Please remember that a boot loader containing the library for Self Programming has to be included in the new programmed application for future Self Programming 34 Preliminary User s Manual U14879EE1VOUMOO Appendix B Programming with FLASH MASTER The following sequence shows the monitor of the flash master connected to a PCvia any Terminal pro gram To run the above shown Flash Master sequence a hex formatted file must be generated Figure B 1 Output sequence of Flash Master Software flashMASTER File Firsttest_59_RAMareaRTSF hex Program area 0 xa File Programmer Device Help A Ae XAS 1 Y li FE gt I checksum CRC Checksum 00000000 0003FFFF 35FEESC se e flashMASTER E3 00 Programmer Configuration Memory SRAM Device signature D758F0828B Prewrite ON Blankcheck after erase OFF Internal verify ON Programming Voltage 9999 mV supply Voltage Device external Oscillator crystal frequency Hz Prescale factor 1 Waitfactor 100 Writeback ON Measured 9972 mV Measured 4963 mV 8000000 Clock source Target Device connection UART 0 with 76800 bps Vpp pulses low level Vdd Area mode active Specified times Erase time ms Write time us Writeback time ms Number of WB retries Inc Max 1000 20000 60 Programming Options EPY command hepv Reset after disconnect Active Program area 1 n

Download Pdf Manuals

image

Related Search

Related Contents

Manual Descargar - Hitachi  Philips Softone Globe Globe energy saving bulb 872790093201000  Minolta Maxxum HTsi Plus 35mm SLR Camera  Manual do Utilizador TP-M5000N  Projecteur Solaire Manuel d`instructions  Pfister 016-CB0C Installation Guide  coussin d`air a basse pression  OWNER INSTALLATION AND USER MANUAL Series 3000 Models  MAN-0064R3.07SP ET 16-66 Spanish Ultimo  Fujitsu CELSIUS H720  

Copyright © All rights reserved.
Failed to retrieve file