a ppli ca tion note m16c/62 PROGRAMMING t h e m16c/62 flash in as y n c h r o nous serial mode 1.0 abstract the followi ng article de scri bes u s ing a n asyn ch ron o u s se rial po rt and the flash s tart applicati on to prog ra m the use r flash m e mory of the m16c/6 2 se ri e s of microcon trollers. thi s is refe rre d to in the m16c/6 2 data sh eets as the ?standa rd serial i/o mode 2? meth od of flash pro g ramming. 2.0 introduction the re ne sa s m16c/62 se ries of micro c ontroll ers is a 16-bit family of mcus, based on rene sas? po pula r m 16c cpu core. these part s provide high m e mory efficiency, power-saving ability, low noi se emission, and improved noise immunit y . the flash version s of the device contai n fl ash memo ry that can be re written with a single volta ge. the m1 6c/6 2 flash ca n b e pro g ramme d usi ng o ne of th ree m e th ods: pa rallel i/o mode, standa rd se rial i/o mode, an d cpu re write mode. stand ard se rial i/o mode ca n be furthe r di vided into a synchrono us mod e (standa rd se rial i/o mode 1) an d an a synch ron o u s m ode (stand ard se rial i/o mode 2 ) . th e flash m e mo ry is divided into two majo r blo c ks, a use r prog ram area and a boot rom area. th e use r prog ra m area is for the norm a l ap plication p r og ra m and d a ta. any prog ram in the bo ot rom a r e a is acce ssed o n l y when a sp ecia l hardware re set seque nce is initiated. this boot rom are a has a co ntrol pro g ra m stored in it w hen shi ppe d from the factory. the pro g ra m allows asyn ch ronou s or syn c h r on ou s seri al prog rammi ng of the user area of the flash . cha nge s to the boot a r ea of the flash can only be m ade u s ing pa rallel i/o mod e . ren e sas pro v ides a wind ows ? ba se d pro g ra m, fla s hstart, to se rially do wnlo ad code (in s-re co rd format) to m16 c /62 mcus. th e we bsite for downlo ading the pr og r a m is lis te d in s e c t ion 5 . 0 r e fer e nc e 3.0 hardw a re requirement s for asy n chronous serial PROGRAMMING the cnvss pin on the mic r ocontroller is the primary c ontrol line t hat determi nes whether the user area of the flash or the boot area i s accessed after the rel e ase of a reset. if the cn vss pi n is l o w the device will al way s acce ss the u s er flash a r ea and will sta r t in single chip mode. to exe c ute the asyn ch ron o u s seri al rewrite pro g ram in the boot area of the flash, the pins listed belo w must be conne cte d as sho w n when a reset is perfo rme d (ei t her duri ng po we r-up of the microco n troll e r o r by forcin g th e reset line lo w and th en se tting it high). figure 1 sho w s a typical co nne ction. reu05 b 00 1 3 -0 100z june 20 03 page 1 of 6
m16c/62 PROGRAMMING the m16 c / 62 flash in as y n chronous serial mode p i n r e quire d con n e c t i o n c n v s s v c c ce (p5-0) vcc epm (p5-5) vss sclk1 (p6- 5) vss 1 2 3 4 5 6 7 8 9 rs- 232 tr an sc ei v e r rs-2 3 2 tr a n s m i t rs-2 3 2 recei v e m1 6 c / 6 2 rx d 1 tx d1 scl k 1 p5_ 0 ( c e) vc c p5_ 5 ( e p m ) cnvs s vc c jum p e r t o e n t e r boot m ode c o n n e c t to p c c o m p o r t u s i ng s t r a i ght - t h r ough s e r i a l cabl e tt l receiv e ttl t r ansm it figure 1 t y p i cal conne ction for asy n chronou s se rial PROGRAMMING 4.0 using the flashs t art program 4.1 startup selecting ?flashstart.exe? will start t he program. for the m16c/60 series mc us, select ?internal flash memory? and the com port that is conne cted to the ha rd ware. select ?ok ? . s e e . f i g u r e 2 reu05 b 00 1 3 -0 100z june 20 03 page 2 of 6
m16c/62 PROGRAMMING the m16 c / 62 flash in as y n chronous serial mode figure 2 select progr am dialog bo x once comm u n icatio ns are establi s h ed, the id check dialog box op ens. if a communi cation error o c curs, follow the messa g e s to pro perly set up comm unication s 4.2 selecting a file and id ch eck the id ch eck dialog box is for inputting the name a nd id of your work file. the pro g ram us es motorola s2 format. if no id was p r eviou s ly defi ned, the id code would b e all zeros o r a ll ones (?00? h e x or ?ff? hex ). figure 3 id che ck dialo g box reu05 b 00 1 3 -0 100z june 20 03 page 3 of 6
m16c/62 PROGRAMMING the m16 c / 62 flash in as y n chronous serial mode input the pat h and file n a m e in the fil e path field b o x and the i d code i n the id field box. selectin g the refer button will open a browse window to locate the file on your pc. if the id f ile is i n the sam e folder (refer to the flashstart m anual ), the id cod e i s loa d ed when the f ile is sel e cte d . if there is no id file, a warning m e ssa g e will be sh own that indicate s the id file c annot be found. sel e ct "ok" in the warning b o x and enter the corre c t id bytes in the id boxes o r ?ff? or ? 00? in the box es if there i s no id co de b e ing u s ed. figure 4 id che ck dialo g box once the id cod e has b e e n entere d , se lecting the o k button will start the id check and o p e n s the flash s tar t prog ramm er wind ow. thi s allows the device comma nds to be ex ecute d . if an id matchin g error o c curs, the flashstart programme r wi ndo w will still open; ho wev e r, the user will be unable to execute the comman d s. in this ca se, re ch ec k t he i d co de . selectin g the can c el butto n will o pen t he fla s hstart programme r wind ow with out run n ing a n id ch eck. the flashstart all o ws device comman d s to be used with clea re d flash without pe rforming an id check. 4.3 flashsta r t programm i ng windo w the flashstart program mi ng wind ow e x ecute s device com m an d s . if the flash mcu is cl eared, the device comm and s can be u s ed wi thout run n ing an id ch eck. ho weve r, if th e flash is written, only the load (id), status, and setting comman d s ca n be used unt il the id check is run. on ce the correct id che c k is co mpleted, all of the followin g co m m and s are available: ? load (id) select s a file and che c ks the id co de. ? blank che c ks if a selecte d area of flash ro m is blan k. ? rea d com pares th e conte n ts of t he flash ro m with the sel e cted file. ? status displays the cu rre nt status of the flash rom. reu05 b 00 1 3 -0 100z june 20 03 page 4 of 6
m16c/62 PROGRAMMING the m16 c / 62 flash in as y n chronous serial mode ? e.p.r erases the fl ash, follo wed by a progr am cycle, followed by a rea d verify check. ? b.p.r. run s a blan k che ck, follo wed by a pr og ram cycl e, followe d by a re ad verify che ck. ? prog ram prog ram s the device with t he sel e cte d file (note that the pr ogram a r ea mu st bebl ank). ? erase erases the e n tire u s er fl a s h rom area . ? setting is use d to ch ange the ba u d rate. ? do wnlo ad load s control prog ram file sele cted into ram and exe c ute s file. figure 5 id che ck dialo g box whe n progra m and other comm and s are sele cted, the input addre ss dial og box opens. the default addre s ses are the lo w an d high ad dre s se s of the file that was sele cted in the id che c k dial o g box. if a file is not sele cted, th e start an d end add re sses of the m16 c /62 are u s e d . figure 6 input add r es s dialog bo x reu05 b 00 1 3 -0 100z june 20 03 page 5 of 6
m16c/62 PROGRAMMING the m16 c / 62 flash in as y n chronous serial mode 5.0 reference ren esa s tec hnolog y corporation se miconductor home page http://www.r e nes as. c om e-mail support sup p o r t_apl @rene sa s.co m da ta shee ts ? m16 c /62 dat ash eets:6 2ae ds.pdf user?s manual ? flashstart programme r m anual reu05 b 00 1 3 -0 100z june 20 03 page 6 of 6
keep safety first in your circuit designs! ? ren e sas t e chnolo g y co rporation put s the maximu m effort into makin g sem i con d u c tor p r odu cts better an d m o re reliabl e, b u t there is al ways the po ssi b ility that trouble may occu r with them. t r ou ble with se micon ducto rs may lead to pe rson al injury, fire or prope rty damag e. rem e mbe r to give due co nsid eration to safety whe n maki ng you r circuit de sig n s, with ap pro p riate mea s ures su ch a s (i) pl acement of su b s titutive, aux iliary circuit s , (i i) use of nonfl a mmabl e mat e rial o r (iii) p r eventio n again s t any malfunctio n or mishap. notes regarding these materials ? the s e materi als are intend ed as a refe rence to assi st our cu stome r s in the sele ction of the renesa s technol ogy co rpo r ation p r od uct be st suited to the custom er' s ap plicatio n; the y do not co n v ey any licen se un der any intelle ct ual p r op erty rights, o r any other rig h ts, belon ging to ren e sas te chnolo g y co rpo r ation o r a third pa rty. ? ren e sas te chnolo g y corp oratio n assu mes no re spo n si bility for an y damage, or infring e ment of any third-pa rty's ri ghts, ori g inati ng in the u s e of any pro d u c t data, diagr a m s, ch art s , progr ams, al gorithms, or ci rcuit appl ication exa m ples contai ne d in these m a terial s. ? all informatio n contai ned i n these mate rials, in cl udin g produ ct data, diagra m s, ch arts, program s and algo rithms re pre s e n ts info rmation on produ cts at t he time of publi c ation of these material s, an d are subj ect to ch ange by ren e sa s t e chnol ogy co rp orat i on with out n o t ice du e to p r odu ct improvement s or oth e r rea s on s. it is t herefore re commen ded t hat cu stom ers cont a c t rene sa s te ch nolog y co rpo r ation or an auth o ri zed ren e sas techn o logy co rpo r ation pro d u c t distri butor for the latest pro d u c t information befo r e purcha s in g a prod uct liste d herein. the informati on de scrib ed here may con t ain te chni cal inaccu ra cie s or typographi cal e rro rs. ren e sas te chnolo g y co rp oratio n a s su mes no re sp onsi b ility for any dam age, liability, or ot her l o ss risi ng from th ese in accu ra cie s or e r rors. please also p a y attention to information publish ed by rene sa s te chn o logy co rporation by vario u s mean s, incl uding the rene sa s tech nolo g y corp orati on semico ndu ctor h o m e pag e (http://www.renes a s . c o m). ? whe n usi ng any or all of the informat ion co ntai ne d in these material s, incl u d ing p r od uct data, diag ram s , ch arts, p r og ram s , and algo rithms, ple a se be sure to e v aluate all inf o rmatio n a s a total system before maki ng a fi nal deci sion on the applicability of the in formation and pr oducts. renesas technol ogy co rpo r ation assum e s n o re spo n si bility for any dam age, liability or othe r lo ss re sultin g from the information contai ned he rei n . ? ren e sas te chnolo g y corp oratio n semi condu cto r s ar e not design ed or manufa c tured for use in a device o r sy stem that is used und er circumsta n ces in which hum a n lif e is potent ially at stake. please conta c t re ne sa s technol o g y corp oratio n or an auth o rized ren e sas techn o logy co rpo r ation p r od uct distri butor wh en con s id eri n g the use of a produ ct c ont ained he rei n for any spe c ifi c purpo se s, such a s appa ratu s or systems fo r transp o rt ati on, vehicul a r, medical, a e ro sp ace, nuclea r , or un derse a rep eater u s e. ? the p r io r written ap proval o f rene sa s t e chn o logy co rporation i s ne ce ssary to re print o r repro duce in whol e or in p a rt these material s. ? if these pro d u c ts or tech nol ogie s are su b j ect to t he japane se export cont rol re strictions, they must b e exporte d und er a licen se from the ja pan ese g o vern m ent and cann ot be importe d into a cou n try othe r than the app roved de stinat ion. any diversion or reexpo rt cont rary to the expor t cont rol laws and reg u lation s of japan an d/o r the cou n try of de stination i s prohibited. ? please conta c t re ne sa s technol ogy co rpo r ation f o r furth e r de tails on the s e materi als or the pro d u c ts cont ained the r ei n.
|