Part Number Hot Search : 
BC847C NTE115 RN461 ANTX2N6 LD1106S SK1510 TA8402F EK00213
Product Description
Full Text Search
 

To Download VIRTUAL Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  regarding the change of names mentioned in the document, such as mitsubishi electric and mitsubishi xx, to renesas technology corp. the semiconductor operations of hitachi and mitsubishi electric were transferred to renesas technology corporation on april 1st 2003. these operations include microcomputer, logic, analog and discrete devices, and memory chips other than drams (flash memory, srams etc.) accordingly, although mitsubishi electric, mitsubishi electric corporation, mitsubishi semiconductors, and other mitsubishi brand names are mentioned in the document, these names have in fact all been changed to renesas technology corp. thank you for your understanding. except for our corporate trademark, logo and corporate statement, no changes whatsoever have been made to the contents of the document, and these changes do not constitute any alteration to the contents of the document itself. note : mitsubishi electric will continue the business operations of high frequency & optical devices and power devices. renesas technology corp. customer support dept. april 1, 2003 to all our customers
a pplication n ote m16c/62 VIRTUAL flash eeprom dr iver for the m16c/62 1. declaration mitsubishi electric & electronics usa does not guarantee the performance or use of this source-code. the intended use of provided source-code is the so le responsible of the user. the files have been successfully compiled using mitsubishi's nc30 compiler. before using this software review the source and make any necessary changes to support your hardware and application. 2. introduction mitsubishi's m16c/62 is a 16-bit mcu based on the m16c cpu core with 256k bytes of user flash. the device can erase and program the on-chip flash memo ry under control of a user?s program with no external programming devices required. this feature is called ?cpu rewrite mode?. this application note describes the usage of the accom panying program that allows the user to write to the flash as if it were eeprom. 3. compatibility the included VIRTUAL eeprom driver is compatible with m16c/6x microcontrollers with page write (256 bytes) flash memory. it is not compatible with word write mcus such as the m30220. the driver is compatible with the above noted mcus on any star ter kit/evaluation system running under kd30 and the rom monitor. it cannot be evaluated or demonstrat ed on any emulator using ram to emulate flash (i.e. mitsubishi?s pc4701, nohau, or ashling emulator systems). 4. theory of operation the c0000h and d0000h flash blocks (blocks 5 and 6) are used for the VIRTUAL eepr om, with provisions to switch to other blocks (see section 5 below). the d0000h is used as backup in case of a power failure or a write error on the c0000h block. the size of the eeprom is written to the top of both blocks. the first call to writeee() writes the word at the beginning of both blocks (at offset ?tag?) with an ?end of file? written to the end of the eeprom ?record?. if write ee() is called again with the same ?tag?, then another eeprom ?file? is created after the previous one and so on until the block (and the backup block) is filled. at that point, the c0000h block is erased, the last eepr om file in the d0000h block is copied to the start of the c0000h block, then the d0000h block is erased and the eeprom file is copied over to the start of it as well. then the process repeats. the most up-to-date data is determi ned as the last ?end of file? in the block. for more detailed information on flash operations, r ead the application note references given at the end of this document. an-dece-mcu-31-a february 2002 1
m16c/62 VIRTUAL flash eeprom driver for the m16c/62 5. implementing the virtee drivers in a user programs include ?flash.h? in any project file that require s driver functions. add ?ram62.c? , ?virtee.c?, and ?ee_fl_util.c? to your project. thes e files require the ?fdriver.h? and ?s fr62.h? header files. by default, the driver uses the two 64k blocks 5 and 6 for the virt ual eeprom. this can be c hanged to the two 8k blocks (1 and 2) at fa000h and fa000h by un-commenting the definition ?#define blocks8k ? near the top of file ?flash.h?. the maximum size of eeprom changes to ff0h. note that using blocks 1 and 2 is not compatible with the rom monitor and kd30. the following is a list of the driver function calls and how to use them. int setee_size(size) ? this function must be called before calli ng any other of the following functions. ? size = 2 to 7ff0h (or 2 to ff0h if using 8k blocks). sets the maxi mum size of the eeprom in words (16 bits). once set, it can only be changed with the resetee() function (size stored in flash). ? returns 1 if no errors, 0 on invalid size, -1 on error, or the previously set size value (2 to 7ff0h). errors (-1) are caused by flash write errors or the eeprom ?file? in flash cannot be found. to determine the flash write error call readsrd(). ? when called for the first time (no size st ored in flash), flash blocks c0000h and d0000h are completely erased. ? the user must call this function before calling checkee(). int void checkee(void) ? this function verifies that t he flash blocks used for eeprom cont ain the same data (see theory of operation). this functi on should always be called after rese t but after calling setee_size(). ? returns 1 if no errors, -1 on error. these errors can result from an interruption of power or non- maskable interrupt occurring during a write to eeprom if a nonrecoverable error is detected, call the resetee() function. ? obviously, this function cannot detect a loss of data due to a power loss before or shortly after a call to writeee(). int void resetee() ? completely erases flash blocks c0000h and d0000h. ca ll this function only af ter checkee() detects an error. ? after calling this function, call ee_size(). int writeee(int value, int tag) ? writes the word ?value? to eeprom at eeprom location ?tag? (0 to size -1). returns 1 if no errors, - 1 on srd error, or 0 on invalid ?tag?. before writing, this function checks if the value to be written is the same as that stored in the eeprom. if so, function returns with no error. char readsrd() ? returns the flash srd register. an-dece-mcu-31-a february 2002 2
m16c/62 VIRTUAL flash eeprom driver for the m16c/62 int clearsrd() ? clears the flash srd register. int readee(int tag, int *value) ? upon return, *value contains t he eeprom value at the address ?tag?. returns 1 on no errors, 0 on invalid tag. 6. notes interrupts assigned to the fixed vector table cannot occur during any write to flash operation. this includes all the function calls above except for readsrd() and readee(). as a ?safety? feature, interrupts are suspended during flash operations. the worst case suspend time is over 600 ms (maximum erase block time). if this delay is unacceptable, remove the ?interruptoff? line at the beginning of the function ramcodestrt() in the file ram62.c, move the variable ve ctor table to ram, and then set the ?intb? register accordingly. note as the size of the eeprom increases, so can the time to ex ecute the writeee() function. for example, an eeprom size of 3ff0h or greater requi res an erase of both flash blocks and rewrite every time a value is updated. for sizes near the max. of 7ff0h a rewrite to an eeprom location could take up to 4 seconds! 7. demonstration program the driver file virtee.c contains a demonstration ?m ain.c? (remove or comment out when implementing as a driver). the program was developed to run on the msv1632, but it also works with any m16c/62 flash system running the kd30 debugger in single chip mode. the following steps are required to run the demonstration (it is assumed the user has a general understanding of the kd30 debugger): 1. connect the mdece0620 board to power and the host pc. 2. start kd30. in the ?init? screen, click on t he tab ?run mode? and select ?free run mode?. 3. load the ?virtee.x30? file. 4. insert a breakpoint in the main() function at the first ?y= *read_val;?. 5. run the code: debug-> go free. 6. hit the red ?stop? button on kd30 (in ?free run? mode, kd30 does not respond automatically to breakpoints). 7. view the global ?y? from the c watch window. 8. remove the breakpoint and insert one at the next ?y= *read_val;?. 9. repeat steps 5?8 until you reach the end of main(). 10. you can view the flash blocks and/or change the variabl es passed (e.g. size, tag, values), recompile, and run again to see how the changes affect operation. an-dece-mcu-31-a february 2002 3
m16c/62 VIRTUAL flash eeprom driver for the m16c/62 8. references data sheets: ? 62aeds.pdf ? m16c/62a specifications application notes: ? cpurw62.pdf appnote - programming the m16c/62 flash in cpu rewrite mode ? wflash.pdf - applications of cpu rewrite mode manuals: ? 6020esm.pdf (software manual ) ? 6020ec.pdf (c manual ) ? 6020easm.pdf (assembler manual) ? nc30ue.pdf (compiler manual) an-dece-mcu-31-a february 2002 4
keep safety first in your circuit designs! ? mitsubishi electric corporation puts the maximum effort into ma king semiconductor products bette r and more reliable, but there is always a possibility of trouble occurring. trouble with semiconductors may lead to personal injury, fire, or property damage. remember to give due consideration to safety when making your circuit designs, with appropriate measures such as (i) placement of backup, auxiliary circuits, (ii) use of non- flammable material, or (iii) prevent ion against any malfunction or mishap. notes regarding this information ? this information is intended as a reference to assist our consumers in the selection of the mitsubishi semiconductor product best suited to the customer?s application; it does not convey any license under any intellectual property ri ghts, or any other righ ts, belonging to mitsubish i electric corpor ation or a third party. ? mitsubishi electric corporation assumes no responsibility for any damage, or infringement of any third- party?s rights, origi nating in the us e of any product data, diagrams, charts, progr ams, algorithms, or circuit application examples contained in these materials. ? all information c ontained in these materials, including pr oduct data, diagrams, charts, pr ograms and algorithms, represents info rmation on produ cts at the time of publication of these materials, and is subject to change by mitsubishi electric corporation without notice due to product improvements or other reasons. it is therefore recommended that customers contact mitsubishi electric corporation or an authorized mitsubishi semiconductor product distributor for the latest product information before purchasing a product listed herein. ? the information described herein may contain technical inaccuracies or typographical errors. mitsubishi electric corporation assumes no responsibility for any damage, liability, or other loss arising from these inaccuracies or errors. ? please also pay attention to information published by mitsubishi electric corporation by various means, including the mitsubishi se miconductor home page (http:// www.mitsubishichip s.com). ? when using any or all of the information c ontained in these materials, in cluding produ ct, data, diagrams, charts, programs, and algorithms, please be sure to evaluate all info rmation as a to tal system before making a final decision on the app licability of t he information and produ cts. mitsubishi electric corporation assumes no responsibility for any damage, liability, or other loss resulting from the information contained herein. ? mitsubishi electric corporation semiconductors are not designed or manufactured for use in a device or system that is used under circumstances in which human life is potentially at stake. please contact mitsubishi electric corporation or an authorized mitsubishi semiconductor product distributor when considering the use of a product contained herein for any specific purposes, such as apparatus or systems for transportation, vehicular, medical, aerospace, nuclear, or undersea repeater use. ? the prior written approval of mitsubishi electric corporation is necessary to reprint or reproduce these materials in whole or in part. ? if these products or technologies are subject to japanese export c ontrol restriction s, they must be exported under a license from the japanese government and cannot be imported into a country other than the approved destination. ? any diversion or reexport contrary to the export control laws and regulations of japan and/or the country of destination is prohibited. ? please contact mitsubishi electric corporation or an authorized mitsubishi semiconductor product distributor for further deta ils on these materials or t he produ cts contained therein.
mitsubishi electric & electronics usa, inc. electronic device group usa headquarters mitsubishi electric & electronics usa, inc. electronic device group 1050 east arques avenue sunnyvale, ca 94085-4601 phone: 408-730-5900 fax: 408-732-9382 direct sales offices ? usa northwest mitsubishi electric & electronics usa, inc. electronic device group 1050 east arques avenue sunnyvale, ca 94085-4601 phone: 408-730-5900 fax: 408-737-1129 southwest mitsubishi electric & electronics usa, inc. electronic device group 20 fairbanks, suite 181 irvine, ca 92618 phone: 949-859-9453 fax: 949-859-9450 rocky m ountain mitsubishi electric & electronics usa, inc. electronic device group po box 273377 fort collin s, co 80527 phone: 970-669-4068 fax: 970-669-4129 north central mitsubishi electric & electronics usa, inc. electronic device group 3300 edinborough way, suite 511 edina, mn 55435 phone: 952-837-9053 fax: 952-837-9059 mitsubishi electric & electronics usa, inc. (automotive market only) 50 west big beaver rd., suite 136 troy, mi 48084 phone: 248-526-9580 fax: 248-526-9583 south central mitsubishi electric & electronics usa, inc. electronic device group 8310 capital of texas hwy. n., suite 260 austin, tx 78731 phone: 512-346-4200 fax: 512-346-4434 northeast mitsubishi electric & electronics usa, inc. electronic device group 92 montvale avenue, suite 2500 stoneham, ma 02180 phone: 781-245-6956 fax: 781-245-4233 mid-atlantic mitsubishi electric & electronics usa, inc. electronic device group 92 montvale avenue, suite 2500 stoneham, ma 02180 phone: 781-245-6956 fax: 781-245-4233 south atlantic mitsubishi electric & electronics usa, inc. electronic device group 2625 meridian parkway, suite 100 durham, nc 27713 phone: 919-767-7900 fax: 919-767-7902 southeast mitsubishi electric & electronics usa, inc. electronic device group 2810 premiere parkway, suite 400 duluth, ga 30097 phone: 678-258-4518 fax: 678-258-4519 mexico inquiries western mexico mitsubishi electric & electronics usa, inc. electronic device group 20 fairbanks, suite 181 irvine, ca 92618 phone: 949-859-9453 fax: 949-859-9450 eastern mexico mitsubishi electric & electronics usa, inc. electronic device group 8310 capital of texas hwy. n., suite 260 austin, tx 78731 phone: 512-346-4200 fax: 512-346-4434 puerto rico inquiries puerto rico mitsubishi electric & electronics usa, inc. electronic device group 2810 premiere parkway, suite 400 duluth, ga 30097 phone: 678-258-4518 fax: 678-258-4519 mitsubishi electric sales canada, inc. jqa-qs0161 direct sales offices ? canada central & western canada mitsubishi electric sales canada, inc. 4299 14th avenue markham, ontario, canada l3r 0j2 phone: 905-475-7728 fax: 905-475-1918 eastern canada mitsubishi electric sales canada, inc. 340 march road, suite 300 kanata, ontario, canada k2k 2e4 mitsubishi electric mcu products sold into the automotive marketplace are qs-9000 certified. phone: 613-591-3348 fax: 613-591-3948 ? 2002 mitsubishi electric & electronics usa, inc., electronic device group. mitsubishi electric & electronics usa, inc. is a wholly owned subsidiary of mitsubishi electric corporation. all trademarks are the property of their respective owners. the information supplied by mitsubishi electric & electronics usa, inc. is believed to be accurate and relia ble but in no event shall mitsubishi electric & electronics usa, inc. be liable for any damages whatsoever arising out of the use or inab ility to use the information or any errors that may appear in this publication. the information is provided as is without any warranties of any kind, either express or implied. mitsubishi electric & electronics usa, inc. reserves the right, without notice, to make changes to the information or to the design and specifications of its hardware and/or software products. products subject to availability. printed in u.s.a. www.mitsubishichips.com an-dece-mcu-31-a february 2002 6


▲Up To Search▲   

 
Price & Availability of VIRTUAL

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X