Home
Megawin 8051 Writer
Contents
1. EP mo LYFWP Ean I For checking Set 25KB TAPLB 0x1200 ENL YR r etal Bs HWBS jv i gt hls 25KB fOxt200 Now IAPLB 0x1200 sB rir rr z Lock wE aie EWEN A i oablel ar osco MIr aig pean mm ENROSC P Ain HWPS HWENW P r is ile on PE E RUR This document information is the intellectual property of Megawin Technology Co Ltd 22 Megawin Technology Co Ltd 2007 All right reserved 4 YN MEGAWIN Megawin 8051 Writer CC MAKE YOU WIN User Manual v3 80 5 5 2 The hardware option is programmed along with the Flash memory Sections 5 2 5 4 show that only the Flash memory is programmed while the hardware option is left unchanged In fact the user can program the hardware option along with the Flash memory The user just needs to configure the hardware option and add Program Option into the Auto batch processing as shown below After batch processing not only the Flash memory but also the hardware option are programmed I Whole chip Erase V Check ID Exit Add Program Option V Blank Check V Program v Verify Note that if the Program Option is added into the Auto batch processing and the H W Option setting is left blank as shown below all the hardware options will be disabled after the batch processing HW Option ISP memory va i Whole chip Program Set Erase ey om p Set Now LYFWP ag a in j TAPLB QUA ENLYR J fis f HWES I F AE ow IAPLB SB
2. 4 2 For MPC89L E 51 52 53 54 58 515 MOVCL enabled MOVC instruction is invalid for security while MCU is executing from external program disabled MOVC instruction is always available SB enabled Code dumped on a universal Writer or Programmer is scrambled for security disabled Not scrambled LOCK enabled Code dumped amp Device ID read on a universal Writer or Programmer is locked to OxFF for security disabled Not locked FZWDTCR enabled The WDTCR register will be initialized to its reset value 0x00 only by power on reset For example if WOTCR 0x2D it still keeps at Ox2D rather than 0x00 after RST pin S W or WDT reset disabled The WDTCR register will be initialized to its reset value 0x00 by all reset including power on RST pin S W and WDT reset OSCDN enabled Oscillating gain is reduced down for EMI reduction if Fosc lt 25MHz disabled Normal gain For Fosc gt 25MHz HWBS enabled When powered up MCU will boot from ISP memory if SP memory is configured disabled MCU always boots from AP memory ENGT enabled MCU runs at 6T mode 6 clocks per machine cycle double speed compared to a traditional 8051 disabled MCU runs at 12T mode 12 clocks per machine cycle like a traditional 8051 This document information is the intellectual property of Megawin Technology Co Ltd 13 Megawin Technology Co Ltd 2007 All right reserved 4 H M
3. 2007 All right reserved 25 sY gt MEGAWIN Megawin 8051 Writer AY F MAKE YOU WIN User Manual v3 80 5 8 To disable the hardware option SB amp LOCK For a locked chip i e LOCK option is enabled all read out data including the device ID will become OxFF So the user always get the following error message even if you have selected the correct part no AE Wrong device ID HEE Oy chip is locked For a scrambled chip i e SB option is enabled all read out data are scrambled to become random data except that its device ID is left unchanged In both these conditions only whole chip erase can make LOCK amp SB become disabled Step1 Select Part No Step2 Click Whole chip Erase Step3 Check if un lock successfully by clicking Check ID Note Step3 is optional Step1 4 Megawin 8051 Writer v3 70 MEGAWIN MAKE YOU WIN Programming Area Part Number MPC89E52 v AP memory IAP memory C ISP memory C AP IAP ISP Binary Code Buffer Load File Save MPJ Save Buffer Dump Target Get Checksum Insert ISP code HAN Option ISP memory Whole chi aay tale hip Program Read hole chip Eine lt gt OR Set VA Erase Option Option Now J Now ow TE Set Now See MOYCL T Set I IAPLB l N Gi S LOCK P Now IAPLB l FZWDICRI OSCDN P Set Now HWBS r HWWIDL orl l EN6T Z r HWPS va a re If HWEN W is enabled Bal el alee ela 5 i eee DBE
4. 3 IAPLB N Bs Pr LOSE BS Now IAPLB l FZWDICRI M If HWENW isenabled oscpy re HWWIDL Set Now Oorl HWPS l J A u S Automatically configured after inserting ISP code Bh a lille Clear Message Exit CodeSize 991 Bytes CheckSum 0x9A53 29 This document information is the intellectual property of Megawin Technology Co Ltd Megawin Technology Co Ltd 2007 All right reserved MAKE YOU WIN Ly Megawin 8051 Writer CAST MEGA WIN User Manual v3 80 6 Megawin Project File MPJ File The user can save all the relevant programming information together in a Megawin project file MPJ file The MPJ file includes the following relevant programming information appearing on the GUI 1 Part Number 2 Programming Area 3 H W Option 4 Binary Code Buffer and 5 The configuration of the Auto button wwe wa WH Note The MPJ file is also used for Customer Programming Request Service provided by Megawin For this service the user needs to send this MPJ file to Megawin Save to an MPJ File To save all the relevant programming information to an MPJ file click the button Save MPJ as shown below Of course before clicking this button you should have finished the proper configuration the Part Number the Programming Area and the H W Option And the application code should be loaded Megawin 8051 Writer v3 70 MEGAWIN MAKE YOU WIN Are Programming Area P
5. ENLVRO enabled Enable MCU to generate low voltage reset when VDD pin voltage drops below 3 7V disabled No low voltage reset ENROSC enabled Enable built in RC oscillator disabled Disable built in RC oscillator WDSFWP enabled The special function register WDTCR will be software write protected except the bit CLRW disabled The special function register WDTCR is free to be written by software HWENW accompanied with arguments HWWIDL and HWPS 2 0 enabled Automatically enable Watch dog Timer by the hardware when the MCU is powered up It means that In the WDTCR register the hardware will automatically 1 set ENW bit 2 load HWWIDL into WIDL bit and 3 load HWPS 2 0 into PS 2 0 bits For example If HWWIDL and HWPS 2 0 are programmed to be 1 and 5 respectively then WDTCR will be initialized to be Ox2D when MCU is powered up as shown below WDTCR Vatch Dog Timer Control Register 7 6 5 4 3 2 1 0 WRF ENW CLRW WIDL e feet load load 1 HWWIDL HWPS 2 0 disabled No action on Watch dog Timer when the MCU is powered up 15 This document information is the intellectual property of Megawin Technology Co Ltd Megawin Technology Co Ltd 2007 All right reserved User Manual v3 80 sY MEGAWIN Megawin 8051 Writer AY MAKE YOU WIN 4 5 For MG84FL54BD amp MG84FL54RBD HWBS enabled When power on MCU will boot from ISP memory if ISP memory is configur
6. document information is the intellectual property of Megawin Technology Co Ltd Megawin Technology Co Ltd 2007 All right reserved 21 sY gt MEGAWIN Megawin 8051 Writer F MAKE YOU WIN User Manual v3 80 5 5 To program the hardware option 5 5 1 Only the hardware option is programmed The hardware option includes ISP memory IAP memory cf Section 3 and miscellaneous hardware control cf Section 4 The following steps show how to program the hardware option Step1 Select part no Step2 Configure the hardware option Step3 Click Program Option Step4 Click Read Option to read back for checking Note Step4 is optional Step1 lt 4 Megawin 8051 Writer v3 70 MEGAWIN MAKE YOU WIN Programming Area z AP memory Il P memory C ISP memory AP IAP ISP Check ID Part Number MPC82L 52 use Adaptor Binary Code Buffer Load File Save MPJ Save Buffer Dump Target Get Checksum HIG Insert ISP code HAN Option Message ISP memory Program Option gt PASS Set OxiCO0 OxiFFF UKE gt Step4 Now IAP memory LYFWP T E e Step2 Set 25KB 2 IAPLB 0x1200 ENLYR M r Olio Configure a cr er cron PEMA ae nor a OF ENROSC M P SA Ez ea POO MEEO OO OFr we s Now Ox1CO0 0x1FFF 1KB Set Ox1CO0 Ox1FFF KB v ogm fee Set Now Set Now
7. eee Clear Message Ss al Step2 This document information is the intellectual property of Megawin Technology Co Ltd 26 Megawin Technology Co Ltd 2007 All right reserved sY MEGAWIN Megawin 8051 Writer MAKE YOU WIN User Manual v3 80 5 9 To insert the ISP code Normally the MCU chips shipped from Megawin already have the following configuration For all parts except MG84 series 1 ISP memory with 1K bytes is configured 2 Megawin provided ISP code is programmed and 3 the H W options HWBS SB and LOCK are enabled For MG84 series 1 ISP memory with 2K bytes is configured 2 Megawin provided ISP code is programmed and 3 the H W options HWBS HWBS2 SB and LOCK are enabled However for developing purpose the user may apply the whole chip erasing to the chip and therefore the ISP function is cancelled To activate the ISP function again after the developing is finished the user just needs to click the button Insert ISP code Two kinds of ISP code can be inserted One is the Megawin provided ISP code which is the same as that programmed when shipping And the other one is the User defined ISP code which is developed by the user himself for special purpose Click Insert ISP code to insert the ISP code Megawin 8051 Writer v3 70 MEGAWIN MAKE YOU WIN Programming Area Fal Part Number MPCB9L51 AP memory IAP memory C ISP memory C AP IAP ISP lt n Binar
8. has been configured at least 1K bytes For MPC89L E 515 there is always no IAP memory Table 3 3 shows the relation between IAP memory and ISP memory Figure 3 3 MPC89L E 54 58 515 Flash Memory Configuration 0x0000 ry 0x0000 a 0x0000 A A Application AP memory Ox3FFF pplication AP m emoty Application Oa Total Flash Nopvoiatii 0x7FFF Memory 63KB IAP memory ISP memory ISP memory Nonvolatile ISP memory start address start address IAP memory start address ocean SAE p EISA RSs OxF800 iSP 1KB OxF800 ISP 1KB OxF800 SP 1KB ISP cod si ISP cod B aKB 2KEVIKB None Pasa SKBI2KE IKB None mig aKBI2KE IKB None OxFBFF y 0xFBFF Y 0xFBFF y y MPC89L54 MPC89L58 MPC89L515 MPC89E54 MPC89E58 MPC89E515 1I Note MPC89L E 515 has no IAP memory Table 3 3 IAP memory Range and Size for MPC89L E 54 58 IAP memory Range Size Part No ISP_size OKB ISP_size 1KB ISP_size 2KB ISP_size 4KB 0x4000 0xF 7FF 0x4000 0xF3FF 0x4000 0xEBFF MERE iai 46KB 45KB 43KB 0x8000 0xF7FF 0x8000 0xF3FF 0x8000 0xEBFF MERATE dai 30KB 29KB 27KB This document information is the intellectual property of Megawin Technology Co Ltd Megawin Technology Co Ltd 2007 All right reserved sY MEGAWIN Megawin 8051 Writer CsA F MAKE YOU WIN User Manual v3 80 3 4 MPC82L E 52 Figure 3 4 shows the configuration of the Flash memory of MPC82L E 52 The total memory si
9. ranch veedesdteolicbhasevaddeuudyebieedeexeuanceitcaandexdemede 12 4 2 PORMPGOA BE 5 192 5a 941 OO i tcccctrztoicse coseenceerpessnssetereetasadiisutabeoteedcneny Aaa ccetnesehaesss 13 4 3 POT PCG 2 Ey 2 iaria na EANAN EaR ai 14 44 For NM ca ene ea arn Se nc ee ee aa en eb aa ea ar nee cane nE EISEAN 15 4 5 For MG84FL54BD amp MG84FL54RBD sic csincstest teas tececdisauiiacevbetewsdaeandGueceoteenwuiaatedeudiaaetiaxs 16 5 Easily Use the VV sacecescecedasa icd nacepecarencdeanocdaedntennscadantebessccuacduncmecaneaticdds 17 Del The Auto DUON seeiis a E aa a a 5 2 To program the AP memory amp IAP Memory c ceecscceeeeeeeeeesecceceeeeeeeeeesesneeeeneeeeneneesnees 5 3 To program the ISP MeOMOTY vccvscicveciarsaveisecuatanedtcxedarincavadcentaiesesvaduuahedukentensanvwekawulta teeveadeiansuecs 5 4 To program the AP memory amp IAP memory amp ISP memory c ccceeeeeeeeeeeeteeeeeeeeeeeeeaaaee 5 5 To program the hardware Option cccccccccecccceccceeeeeceeeeeeeceaeeeaaeeaaeeaaeeaaeeaaeeaaeeaaaeaaaeaaaeaaaees 5 5 1 Only the hardware option is programmed cc ceeeeeeeeeeeteeeeeeneeeeeeeaaaeeeeeeaeeeseenaeeeeeeiaeeeeeeneeeeeenaes 5 5 2 The hardware option is programmed along with the Flash MEMOT cceeceeeeeeteeeeeeteeeeeenaes 5 6 To dump the Target S Flash data ecccea cctstesiasencoacaveasveedagecorsaceateeenssaten odcapeidenantiand teatabeenilbes cies 5 7 To get the checksum of the Targets Flash dat
10. 5 shows the configuration of the Flash memory of MPC82L E 54 The total memory size is 15 5K bytes and the IAP memory amp ISP memory are user configured by using this Writer Figure 3 5 MPC82L E 54 Flash Memory Configuration Application code AP memory 0000h OD ier K i o IAP_lower_boundary Total Flash Memory Determined by the IAPLB 15 5KB Non volatile data IAP memory ISP_start_address 0x3000 for ISP 3 5KB 0x3400 for ISP 2 5KB 0x3800 for ISP 1 5KB IP Ole ISP memory 3 5KB 2 5KB 1 5KB None 3DFFhl 0o o E E 1 The IAP memory lower boundary is determined by the MCU s hardware option APLB Two examples show how to configure the IAPLB Example 1 4K bytes of IAP memory is wanted while no ISP memory is configured gt IAPLB should be programmed to 0x2E so the IAP memory range will be 0x2E00 0x3DFF total 4K bytes Example 2 4K bytes of IAP memory is wanted while 1 5K bytes of ISP memory has been configured at 0x3800 0x3DFF gt IAPLB should be programmed to 0x28 so the IAP memory range will be 0x2800 0x37FF total 4K bytes The user can find that the range of AP memory range is Lower boundary IAPLBx256 and Upper boundary ISP_start_address 1 Where IAPLB should be an even number This document information is the intellectual property of Megawin Technology Co Ltd 9 Megawin Technology Co Ltd 2007 All right reserved
11. MOYCL W Set i IAPLB l l 3B V LOCK v Now l IAPLB l FZWDICRI If HWEN W is enabled Samar Set Now orl l l EN6T id 5 HWPS 0 7 pi et EE f File D Toolsitest Green bin This document information is the intellectual property of Megawin Technology Co Ltd Megawin Technology Co Ltd 2007 All right reserved gt OK Automatically configured after inserting ISP code Exit CodeSize 15360 Byte CheckSum OxE092 Clear Message 28 sY MEGAWIN Megawin 8051 Writer User Manual v3 80 MAKE YOU WIN When an application code was not loaded before inserting the ISP code As shown below the GUI setting after inserting the ISP code will automatically become 1 Programming Area SP memory is selected 2 ISP memory a proper size for the ISP code is selected and 3 H W option HWBS is enabled Or HWBS amp HWBS2 are enabled for MG84 series In addition to the options related to ISP operation now the user may configure the other H W options Of course the user may load the application code at this time and therefore the Programming Area will be automatically changed to AP AP ISP lt 4 Megawin 8051 Writer v3 70 MEGAWIN MAKE YOU WIN Programming Area Part Number MPC89L51 z C AP memory LAP memo Binary Code Buffer Load File Save MPJ Save Buffer Dump Target Get Checksum Set 0x2800 0x2BFF IKB v Now Set Now SP remy MOYCL M r Set KI
12. Megawin 8051 Writer User Manual v3 80 7 MEGAWIN CAST MAKE YOU WIN Megawin 8051 Writer User Manual By Vincent Y C Yu This document information is the intellectual property of Megawin Technology Co Ltd Megawin Technology Co Ltd 2007 All right reserved Megawin 8051 Writer User Manual v3 80 1Y MEGAWIN CAST MAKE YOU WIN Contents T MPP OGMUICHIGM orsina E TEE a 3 2 Install the PC site AP and Driver for the Writer ccceccsseeeeeeeeeeeeeeeeeeeeeees 4 Zl SMNStall the Driver sssaaa manpreni na weavdseahaassca staan aai an Aaen 4 2 2 Astal the AP ceres cereis cisrenan E EE E E E OER Ea 4 3 MCU s Flash Memory Configuration ccccceceeeeeeeeeeeeeeeeeeeeeeeeeaeeeeeeeeeeeeees 5 Del MPC89L916 5560X2 resrs santai ana Sa aa aaa aAA E A Taa A Eaa TONSA E aa E a EEA a CEA iadaa 5 3 2 MPC89L E 51 52 53 iiiaae aa aiaa aaa note eater aai aiaa 6 ad MPCE9L EJ94 98 ol Srpen n a E E A E E a t 7 ro MPC 82L E Ls ae een E E eee ee ane 8 3 5 MIPCB 21 E54 acc icdast idunpasesstinas ixccco skeen E p ERE EERE OR EA RAOS 9 3 6 IO acca faeces iene ea a SE n ra EnaA EE nae deei RAEE ni AEE AE AAEE A a ANA Saeba EAEra 10 3 7 MG84FL54BD amp MG84FL54RBD a cncrcscnnctscnachabtdcunddasd Maca tiendesateravbitasndbasecinaatlotddeeheaventQuseiivedd 11 4 MCUs Hardware Opto iiviss ccticcunsnnerscoiets cenduartuasvrenctinnnvanuuieiiededsotdeveiecctuneds 12 4 1 ForMPC89L516 556X2 cocci riccantacaiasciendentdecsenndabentcca
13. SP Check ID Binary Code Buffer Load an zi MPJ file Save MPJ Select File Type MPJ Save Buffer Dump Target Get Checksum Insert ISP code HAW Option ISP memory Whole chip Program Read Set VA z Erase Option Option Now J J Set Now a PINEN Set F a IAPLB l N MOYCL P Now IAPLB l api If HWENW is enabled ENGT Set Now r r HWWIDL z orl a Ea a r r HWPS yee a a uw a gt Dele wig TS ele le Bl Slee Sea ee This document information is the intellectual property of Megawin Technology Co Ltd 31 Megawin Technology Co Ltd 2007 All right reserved fy User Manual v3 80 Megawin 8051 Writer CA 7 MAKE YOU WIN Revision History Revision Description Date 1 Change the Writer s MCU from MPC89L516 to MPC89L515 veo 2 Add automatically upgrading the firmware of the Writer s MCU AOO TOG AR 1 Fix the AP bug if load a HEX file by ALL Files the HEX file will be wrongly regarded as a binary file v3 50 2 Update the Writer MCU s F W version to v0206 2007 07 17 3 Update the driver to 0E6A0304_8051Writer_v3 00 inf for Vista OS 4 Add Megawin Project File MPJ File v3 60 Not released 2007 08 01 v3 70 Add Insert ISP code function 2007 10 05 Modify description for HWENW Section 4 3 amp 4 4 2007 11 15 v3 80 Correct description for ENLVRO from 3 8V to 3 7V Section 4 4 2007 12 06 Add ne
14. Timer when the MCU is powered up 16 This document information is the intellectual property of Megawin Technology Co Ltd Megawin Technology Co Ltd 2007 All right reserved MAKE YOU WIN 27 Y MEGAWIN Cry Megawin 8051 Writer User Manual v3 80 5 Easily Use the Writer The following figure shows the GUI Graphic User Interface of the PC site application program Based on the GUI the following sub sections will demonstrate how to easily use this Writer Load HEX or BIN file into the buffer Save MPJ file Save buffer s data to disk Read whole Flash data and put into the buffer Get checksum of whole Flash data in the chip Automatically insert ISP code Hardware Option Set to be programmed Now already in the chip i enable M disable File information Select Part No Megawin 8051 Writer v3 70 MEGAWIN MAKE YOU WIN Select memory area to be dealt with Part Number MPC99E52 Save MPJ Save Buffer Dump Target Get Checksum Insert ISP code Program Option wa Be allele If HWEN W is enabled Set HWWIDL or 1 HWPS 7 EI CI gugana es ole Gila lela Erase Blank Check Program Verify Auto Message window Clear Message Exit CodeSize 610 Bytes Read hardware option Program hardware option Erase whole chip including hardware option This document information is the intellectual property of Megawin Technology C
15. a 020 cccccseesssseecceeeeeeeeeeeeeeeeeeneeeeeneeeenees 5 8 To disable the hardware option SB amp LOCK 5 9 To insert the ISP code Megawin Project File MPJ File 6 Revision History This document information is the intellectual property of Megawin Technology Co Ltd Megawin Technology Co Ltd 2007 All right reserved sN Megawin 8051 Writer US MEGA WIN User Manual v3 80 MAKE YOU WIN 1 Introduction The Megawin 8051 Writer is a proprietary programmer designed for all Megawin s 8051 MCU products It functions as a bus powered USB device and thus doesn t need any extra power supply And the compact hardware and the friendly software help users easily use this Writer In addition its low cost prevents users from suffering an expensive universal Programmer Picture of the Megawin 8051 Writer DUT Socket MPC89L515 This document information is the intellectual property of Megawin Technology Co Ltd Megawin Technology Co Ltd 2007 All right reserved sY MEGAWIN Megawin 8051 Writer AY User Manual v3 80 MAKE YOU WIN 2 Install the PC site AP and Driver for the Writer 2 1 Install the Driver Plug the Writer into the PC s USB port and do as follows when the monitor shows a prompt about new hardware found 1 Select No not this time click Next 2 Select Install from a list or specific location click Next 3 Select Search for the best driver in these
16. ange is Lower boundary IAPLBx256 and Upper boundary ISP_start_address 1 Where IAPLB should be an even number This document information is the intellectual property of Megawin Technology Co Ltd 11 Megawin Technology Co Ltd 2007 All right reserved Megawin 8051 Writer User Manual v3 80 MEGAWIN MAKE YOU WIN CAST 4 MCU s Hardware Option configured and P1 1 amp P1 0 are tied to ground PIN_EN 4 1 For MPC89L516 556X2 enabled When powered up or RST pin reset MCU will boot from ISP memory if ISP memory is disabled MCU always boots from AP memory enabled MOVC instruction is invalid for security while MCU is executing from external program MOVCL disabled MOVC instruction is always available enabled Code dumped on a universal Writer or Programmer is scrambled for security disabled Not scrambled LOCK SB enabled Code dumped amp Device ID read on a universal Writer or Programmer is locked to be OxFF for security enabled MCU runs at 6T mode 6 clocks per machine cycle double speed compared to a traditional 8051 disabled Not locked disabled MCU runs at 12T mode 12 clocks per machine cycle like a traditional 8051 ENGT This document information is the intellectual property of Megawin Technology Co Ltd Megawin Technology Co Ltd 2007 All right reserved 12 sY MEGAWIN Megawin 8051 Writer MAKE YOU WIN User Manual v3 80
17. art Number MPC82G516 use Adaptor v f AP memory IAP memory ISP memory C AP IAP ISP Binary Code Buffer Load File Save to an Save MPI MPJ file Save Buffer Dump Target Get Checksum Insert ISP code HAN Option Message Now J IAP memory LYFWP Set 2 0 KB 4 IAPLB OxF400 ENL RC HWBS Now IAPLB l SB LOCK If HWENW is enabled o oy OSCDN HWWIDL i ee aws mo o 7 ENROSC ISP memory Load file OK Whole chip Program Read i Set OxFCOO OxFFFF 1KB v ine Option Option et Now Now Set WDSFWP HWENW a BEB BBE Cee E E E E E E EE at Clear Message File D ToolsSP_Code_v5 00 BIN CodeSize 991 Bytes CheckSum 0x9453 This document information is the intellectual property of Megawin Technology Co Ltd Megawin Technology Co Ltd 2007 All right reserved 30 sY gt MEGAWIN Megawin 8051 Writer F MAKE YOU WIN User Manual v3 80 Load an MPJ File To restore all the relevant programming information to the GUI click the button Load File as shown below and select the file type Megawin Project Files MPJ Now all the files with extension MPJ will be listed Select the MPJ file you want Now you can click the Auto button to program a new chip 4 Megawin 8051 Writer v3 70 MEGAWIN i w y MAKE YOU WIN 2 Programming Area Part Number MPC89L516X2 lt 1 AP memory IAP memory C ISP memory AP IAP I
18. ed disabled MCU always boots from AP memory SB enabled Code dumped on a universal Writer or Programmer is scrambled for security disabled Not scrambled LOCK enabled Code dumped amp Device ID read on a universal Writer or Programmer is locked to OxFF for security disabled Not locked HWBS2 enabled Like HWBS the reset from RST pin can also cause MCU to boot from ISP memory disabled Where MCU boots from is determined by HWBS WDTCR_WP enabled If MCU runs in the AP memory the special function register WDTCR will be software write protected except the bit CLRW And if MCU runs in the ISP memory it will be software write protected except the bits CLRW PS2 PS1 and PSO disabled The special function register WDTCR is free to be written by software HWENW accompanied with arguments HWWIDL and HWPS 2 0 enabled Automatically enable Watch dog Timer by the hardware when the MCU is powered up It means that In the WDTCR register the hardware will automatically 1 set ENW bit 2 load HWWIDL into WIDL bit and 3 load HWPS 2 0 into PS 2 0 bits For example If HWWIDL and HWPS 2 0 are programmed to be 1 and 5 respectively then WDTCR will be initialized to be Ox2D when MCU is powered up as shown below WDTCR Vatch Dog Timer Control Register z 6 5 4 3 2 1 0 WRF ENW CLRW WIDL ee fost Hse fas 1 HWWIDL HWPS 2 0 disabled No action on Watch dog
19. egawin 8051 Writer isr 7 MEGA WIN User Manual v3 80 MAKE YOU WIN 4 3 For MPC82L E 52 54 LVFWP enabled Enable LVFWP Low Voltage Flash Write Protection while IAP or ISP programming disabled Disable LVFWP ENLVR enabled Enable LVR Low Voltage Reset disabled Disable LVR HWBS enabled When power on MCU will boot from ISP memory if ISP memory is configured disabled MCU always boots from AP memory SB enabled Code dumped on a universal Writer or Programmer is scrambled for security disabled Not scrambled LOCK enabled Code dumped amp Device ID read on a universal Writer or Programmer is locked to OxFF for security disabled Not locked OSCDN enabled Oscillating gain is reduced down for EMI reduction disabled Normal gain HWBS2 only for MPC82L E54 enabled Like HWBS the reset from RST pin can also cause MCU to boot from ISP memory disabled Where MCU boots from is determined by HWBS ENROSC enabled Enable built in RC oscillator disabled Disable built in RC oscillator HWENW accompanied with arguments HWWIDL and HWPS 2 0 enabled Automatically enable Watch dog Timer by the hardware when the MCU is powered up It means that In the WDTCR register the hardware will automatically 1 set ENW bit 2 load HWWIDL into WIDL bit and 3 load HWPS 2 0 into PS 2 0 bits For example If HWWIDL and HWPS 2 0 are programmed to be 1 and 5 r
20. erify This document information is the intellectual property of Megawin Technology Co Ltd 19 Megawin Technology Co Ltd 2007 All right reserved Z CAT MAKE YOU WIN 5 3 To program the ISP memory Step1 Select part no Step2 Select programming area ISP memory Step3 Load the ISP code with size not more than ISP memory size Note If the SP memory is not configure refer to Section 5 5 for how to configure an SP memory Step2 Megawin 8051 Writer User Manual v3 80 MEGAWIN Step4 Click Auto configure the wanted batch processing Step1 Step5 Click Run to start the batch processing ISP memory C AP IAP ISP Programming Area C AP memory LAP memory Megawin 8051 Writer v3 70 MEGAWIN MAKE YOU WIN Part Number MPC89E52 Binary Code Buffer Step3 Load File Save MPJ Save Buffer Dump Target Get Checksum Insert ISP code HIW Option Message ISP memory gt Wika Soo Read Load file gt OK Set VA Erase Option Option Now TAP Set Now Set Now memory MOYCL P EN Set IAPLB 0 Se Ei A LOCKE Gim fs ate Wow oe FZWDICR M lps r OSCDN GIE fia apa 5 trg Set Now HWBS T r TAD ort K P ENET B 5 a z Cd rr m pr Clear Message Exit File D Tools ISP_Code_v5 00 BIN CodeSize 991 Bytes CheckSum 0x9453 Configure the batch processing M Whole chip Erase JV Check ID Program Option V E
21. espectively then WDTCR will be initialized to be Ox2D when MCU is powered up as shown below WDTCR eS Dog ot Control ener ti WRF m he aan TaN A PS2 ae load load HWWIDL HWPS 2 0 disabled No action on Watch dog Timer when the MCU is powered up 14 This document information is the intellectual property of Megawin Technology Co Ltd Megawin Technology Co Ltd 2007 All right reserved sY MEGAWIN Megawin 8051 Writer CsA User Manual v3 80 MAKE YOU WIN 4 4 For MPC82G516 LVFWP enabled Enable LVFWP Low Voltage Flash Write Protection while IAP or ISP programming disabled Disable LVFWP ENLVRC enabled Enable PMU unit to generate low voltage reset when V30 pin voltage drops below 2 4V disabled Disable LVRC HWBS enabled When power on MCU will boot from ISP memory if ISP memory is configured disabled MCU always boots from AP memory SB enabled Code dumped on a universal Writer or Programmer is scrambled for security disabled Not scrambled LOCK enabled Code dumped amp Device ID read on a universal Writer or Programmer is locked to OxFF for security disabled Not locked OSCDN enabled Oscillating gain is reduced down for EMI reduction disabled Normal gain HWBS2 enabled Like HWBS the reset from RST pin can also cause MCU to boot from ISP memory disabled Where MCU boots from is determined by HWBS
22. ile ite i LOCK T If EINE EAE ae pea EENET oscpn M opie Then no ia ENROSC a bile pale HWENWI T r AR ie 0 7 m p ca pata Note It means all options will be disabled This document information is the intellectual property of Megawin Technology Co Ltd 23 Megawin Technology Co Ltd 2007 All right reserved Megawin 8051 Writer User Manual v3 80 SYND 2 3 MEGAWIN TAS MAKE YOU WIN 5 6 To dump the Target s Flash data If the target chip is not locked or scrambled then its whole Flash data can be dumped The dumped data are stored in the binary code buffer and the user can save it in the local disk Check ID Step1 Select part no Step2 Click Dump Target Step1 Programming Area Step3 Click Save Buffer to save the dumped data to the local disk Note The current hardware option is also dumped and displayed in the H W Option area amp P memory LAP memory C ISP memory AP IAP ISP Megawin 8051 Writer 3_70 MEGAWIN MAKE YOU WIN Part Number MPC89E52 Binary Code Buffer Load File Save MPJ Save Buffer r Dump Target gt OK Whole chip Program Read Read Option gt OK Erase Option Option Set Now Set Now Step3 Step2 E Get Checksum Insert ISP code Y H W Option ISP memory Set VA bi Now 0x3800 0x3BFF 1KB The dumped data I P memory AVELE al aya ela a e Ae a a a 779440471 IAPLB Now If HWEN W is e
23. in Technology Co Ltd 10 Megawin Technology Co Ltd 2007 All right reserved sY MEGAWIN Megawin 8051 Writer CsA F MAKE YOU WIN User Manual v3 80 3 7 MG84FL54BD amp MG84FL54RBD Figure 3 7 shows the configuration of the Flash memory of MG84FL54BD amp MG84FL54RBD The total memory size is 16K bytes and the IAP memory amp ISP memory are user configured by using this Writer Figure 3 7 MG84FL54BD amp MG84FL54RBD Flash Memory Configuration Application code AP memory 0000h a E Oe i o IAP_lower_boundary Total Flash Memory 16KB Determined by the IAPLB Non volatile data IAP memory ISP_start_address 0x3000 for ISP 4KB 0x3200 for ISP 3 5KB 0x3400 for ISP 3KB IP Ole ISP memory 0x3600 for ISP 2 5KB 1KB 4KB or None 0x3800 for ISP 2KB 0x3A00 for ISP 1 5KB 0x3C00 for ISP 1KB 3FFFh The IAP memory lower boundary is determined by the MCU s hardware option JAPLB Two examples show how to configure the IAPLB Example 1 1K bytes of IAP memory is wanted while no ISP memory is configured gt IAPLB should be programmed to 0x3C so the I AP memory range will be 0x3C00 0x3FFF total 1K bytes Example 2 1K bytes of AP memory is wanted while 2K bytes of ISP memory has been configured at 0x3800 0x3FFF gt IAPLB should be programmed to 0x34 so the IAP memory range will be 0x3400 0x37FF total 2K bytes The user can find that the range of AP memory r
24. lectual property of Megawin Technology Co Ltd Megawin Technology Co Ltd 2007 All right reserved Y gt MEGAWIN Megawin 8051 Writer TAAS waccvouwn User Manual v3 80 5 2 To program the AP memory amp IAP memory Step1 Select part no Step2 Select programming area AP memory IAP memory Step3 Click Read Option to check the current ISP memory size for Step4 Step4 Load file with size not more than total memory size ISP memory size Step5 Click Auto configure the wanted batch processing Step6 Click Run to start the batch processing Note Step3 is optional Step1 Step2 4 Megawin 8051 Writer v3_70 MEGAWIN MAKE YOU WIN Part Number MPC89E52 Binary Code Buffer Step4 Load File Save MPJ Save Buffer Dump Target Get Checksum Insert ISP code HUGE HW Option Message ISP memory 5 aay id Whole chip Program Read eee ae oE Set NA Erase Option Option l Set Now Step3 Set Now pi MOYCL I Per Set a IAPLB h Sci he nein LOCK Vis ia afer kou IAFLE FZWDICR EE OSCDN T r Bah S am Set Now HWES T IV m pIE den O a Ce rr HWPS l 07 lal ta lala Clear Message Exit File D Toolsitest Green bin CodeSize 610 Bytes CheckSum OxBCFE Configure the batch processing I Whole chip Erase V Check ID Program Option JV Erase JV Blank Check V Program IV V
25. locations and Include this location in the search click Browse 4 Locate the driver folder 2 PC site Driver click OK 5 Click Next The driver installation starts 6 Click Finish when the installation completes To check if the Programmer was correctly installed follow the listed steps 1 Open the My Computer folder 2 Open the Control Panel folder 3 Open the System 4 Click on the Hardware tab at the top of the dialog box then click on the Device Manager 5 Click on the plus sign in front of the Universal Serial Bus Controllers to check the device listing If the installation was completed successfully you may find an entry Megawin 8051 Writer in the listing 2 2 Install the AP Run Setup exe in the 1 PC site AP folder to install the application program for the Writer on your PC Using its default installing setting you will find the item Megawin Utilities Megawin 8051 Writer v appearing in the Windows START menu Note the v means the current version and may be upgraded in the future This document information is the intellectual property of Megawin Technology Co Ltd Megawin Technology Co Ltd 2007 All right reserved sY MEGA WIN MAKE YOU WIN 3 MCU s Flash Memory Configuration Before using the Megawin 8051 Writer it is necessary for the user to know the configuration of the MCU s Flash memory 3 1 _MPC89L516 556X2 Figure 3 1 shows the co
26. nabled ae Set f Now Dor 1 HWPS 0 7 The current hardware option File Contents of Target This document information is the intellectual property of Megawin Technology Co Ltd Megawin Technology Co Ltd 2007 All right reserved Clear Message se S 24 MEGAWIN 5 Step1 Z di MAKE YOU WIN 7_To get the checksum of the Target s Flash data If a chip is not locked or scrambled then you can get the checksum of its whole Flash data Step1 Select part no Step2 Click Get Checksum Megawin 8051 Writer v3_70 MEGAWIN MAKE YOU WIN Part Number MPC89E52 Ss Binary Code Buffer Save MPJ Save Buffer Dump Target IAP memory Set fi OKB a LAPLB N Now IAPLB HWBS EN6T If HWEN W is enabled Set a HWWIDL Step2 Insert ISP code HAN Option TSP memory Whole chip Program Read Set fava z Eras Option Option Now Set Now Set Now MOYCL P B8 Tr LOCKEN Megawin 8051 Writer User Manual v3 80 Programming Area Target CheckSum MPC89E52 0x0000 Ox3BFF AP memory IAP memory C ISP memory AP IAP ISP Part No Range Checksum 0x419 4 Get Target s CheckSum gt OK Exit Clear Message SSS SSS lal at ae eee FZWDICRI OSCDN Ge Se DN Sle Se Now or 1 a Ss HWPS 7 This document information is the intellectual property of Megawin Technology Co Ltd Megawin Technology Co Ltd
27. nfiguration of the Flash memory of MPC89L516 556X2 The total memory size is 64K Megawin 8051 Writer User Manual v3 80 bytes and the ISP memory is user configured by using this Writer For MPC89L516 556X2 there is no dedicated AP memory The AP memory and IAP memory are mixed together and share the same Flash area excluding the ISP memory Figure 3 1 MPC89L516 556X2 Flash Memory Configuration 0000h ISP_start_address Or none if no ISP Application code amp nonvolatile data ISP code FFFFh Mixed AP memory amp IAP memory 64KB ISP size Total Flash Memory 64KB 7 ISP memory OKB 8KB step 0 5KB II Note For MPC89L516 556X2 the AP memory and I AP memory are mixed together in the same Flash area This document information is the intellectual property of Megawin Technology Co Ltd Megawin Technology Co Ltd 2007 All right reserved Megawin 8051 Writer User Manual v3 80 SYD 2 MEGAWIN Cy MAKE YOU WIN 3 2 _MPC89L E 51 52 53 Figure 3 2 shows the configuration of the Flash memory of MPC89L E 51 52 53 The total memory size is 15K bytes and the ISP memory is user configured by using this Writer For MPC89L E 51 52 there is an AP memory if the SP memory has been configured at least 1K bytes For MPC89L E 53 there is always no AP memory Table 3 2 shows the relation between IAP memory and ISP memory Figure 3 2 MPC89L E 51 52 53 Flash Memor
28. o Ltd Megawin Technology Co Ltd 2007 All right reserved CheckSum 0xBCFE Buffer s contents Check device ID Erase the selected memory area Check if the selected mamory area is blank Program buffer s data into the selected memory area Compare the selected memory s data with the buffer s data Automatic batch processing Clear Message window Exit 17 sY gt MEGAWIN Megawin 8051 Writer User Manual v3 80 MAKE YOU WIN 5 1 The Auto button To facilitate the manual operation an automatic button Auto on the GUI is designed This button comprises 1 Whole chip Erase 2 Check ID 3 Program Option 4 Erase 5 Blank Check 6 Program and 7 Verify You can select any operation items you want and then click Run to start the batch processing 4 Megawin 8051 Writer v3_70 MEGAWIN MAKE YOU WIN Part Number MPCB9E52 Binary Code Buffer Load File Save MPJ Save Buffer Dump Target Get Checksum Insert ISP code HAW Option Message ISP memory Whole chip Program Read Set QUA bd Erase Option Option Now Set Now wW No r r r r r m r r r va a Be ele ele 1AP memory MOYCL P Set lt 4 IAPLB QU B T LOCK P Now IAPLB FZWDICR I OSCDN M Set Now HWBS x HWWIDL Oot E P ENGT z HWPS 0 7 Zz EE ia If HWEN W is enabled Ge vee ee 18 This document information is the intel
29. rase JV Blank Check V Program M Verify This document information is the intellectual property of Megawin Technology Co Ltd Megawin Technology Co Ltd 2007 All right reserved 20 OA ware yvouwn Megawin 8051 Writer User Manual v3 80 MEGAWIN 4 To program the AP memory amp IAP memory amp ISP memo Step2 5 Step1 Select part no Step2 Select programming area AP IAP ISP Step3 Load file with size not more total memory size Step4 Click Auto configure the wanted batch processing Step5 Click Run to start the batch processing Step1 Programming Area C AP memory LAP memory C ISP memory Megawin 8051 Writer v3_70 MEGAWIN MAKE YOU WIN Binary Code Buffer Message Load file gt OK Step3 Save MPJ Save Buffer Dump Target Get Checksum Insert ISP code H W Option ISP memory Whole chip Program Read Set QUA z Erase Option Option Now J iAP Set Now Set Now e aE a MOYCL M pata Set IAPLB N SHR Hia ja aia LOCK J El a fash IAPLB FZWDICRI M fl OSCDN T r pa pe x A Set Now HWBS T F fae ort ff a z a x a ov rr m pr Clear Message Exit File D Toolsitest Green63k bin CodeSize 64512 Bytes CheckSum OxAADF Configure the batch processing I Whole chip Erase V Check ID Program Option V Erase JV Blank Check V Program IV Verify This
30. sY MEGAWIN Megawin 8051 Writer CA F MAKE YOU WIN User Manual v3 80 3 6 MPC82G516 Figure 3 6 shows the configuration of the Flash memory of MPC82G516 The total memory size is 64K bytes and the IAP memory amp ISP memory are user configured by using this Writer Figure 3 6 MPC82G516 Flash Memory Configuration Application code AP memory 0000h OD L _ i IAP_lower_boundary Total Flash Memory 64KB Determined by the IAPLB Non volatile data IAP memory ISP_start_address 0xF000 for ISP 4KB OxF800 for ISP 2KB OxFCO00 for ISP 1KB IP Ole ISP memory 4KB 2KB 1KB None FFFFh oooO ooo Yoo 1 The IAP memory lower boundary is determined by the MCU s hardware option APLB Two examples show how to configure the IAPLB Example 1 4K bytes of AP memory is wanted while no ISP memory is configured gt IAPLB should be programmed to OxFO so the AP memory range will be OxFOOO OxFFFF total 4K bytes Example 2 4K bytes of IAP memory is wanted while 1K bytes of ISP memory has been configured at OxFCO0 OxFFFF gt IAPLB should be programmed to OxEC so the IAP memory range will be OxECOO OxFBFF total 4K bytes The user can find that the range of AP memory range is Lower boundary IAPLBx256 and Upper boundary ISP_start_address 1 Where IAPLB should be an even number This document information is the intellectual property of Megaw
31. w parts MG84FL54BD amp MG84FL54RBD 2008 01 09 This document information is the intellectual property of Megawin Technology Co Ltd Megawin Technology Co Ltd 2007 All right reserved 32
32. y Code Buffer Save MPJ Save Buffer Insert ISP Dump Target M Get Checksum inci ca H W Option ISP memory Whole chip Program Read Set VA b Eras Option Option Now Set Now ow i g E a E E E E E E nsnsi MOYCL W Set a IAPLB 1 SB WV LOCK v Now IAPLB FZWDICR I OSCDN Set Now HWBS HWWIDL Or fi ENGT HWPS If HWEN W is enabled BE De ee Se ie eta Clear Message Exit File D Tools test Green bin CodeSize 610 Bytes CheckSum 0xBCFI This document information is the intellectual property of Megawin Technology Co Ltd 27 Megawin Technology Co Ltd 2007 All right reserved MAKE YOU WIN 7 Y MEGAWIN Cry Megawin 8051 Writer User Manual v3 80 When an application code was loaded before inserting the ISP code As shown below the GUI setting after inserting the ISP code will automatically become 1 Programming Area AP AP ISP is selected 2 ISP memory a proper size for the ISP code is selected and 3 HWW option HWBS is enabled Or HWBS amp HWBS2 are enabled for MG84 series In addition to the options related to ISP operation the user may configure the other H W options at this time Megawin 8051 Writer v3_70 MEGAWIN MAKE YOU WIN Programming Area Part Number MPC89L51 v C AP memory LAP memory C ISP memory A Binary Code Buffer Save MPJ Save Buffer Dump Target Get Checksum Set 0x3800 0x3BFF 1KB v Now Laanen
33. y Configuration 0x0000 ry 0x0000 a 0x0000 A A Applicaton AP memory 0x0FFF f ADRIEN AH memory Application oie i Ox1FFF hea con Nonealatile x lemory IAP memory ISP memory SP memory Nonvolatila IAP memory ISP memory start address start address start address 0x2C00 ISP 4KB 0x2C00 ISP 4KB 0x2C00 ISP 4KB 0x3800 ISP 1KB 0x3800 ISP 1KB I 0x3800 ISP 1KB ISP code isp memory ISP code jsp memory ISP code isp memo 4KB 2KB 1KB None 4KB 2KB 1KB None 4KB 2KB 1KB None 0x3BFF y 0x3BFF Y 0x3BFF X LA MPC89L51 MPC89L52 MPC89L53 MPC89E51 MPC89E52 MPC89E53 II Note MPC89L E 53 has no IAP memory Table 3 2 IAP memory Range and Size for MPC89L E 51 52 IAP memory Range Size Part No ISP_size OKB ISP_size 1KB ISP_size 2KB ISP_size 4KB 0x1000 0x37FF 0x1000 0x33FF 0x1000 0x2BFF MPC89L E 51 NA ae a DIE 0x2000 0x37 FF 0x2000 0x33FF 0x2000 0x2BFF MPC89L E 52 NA i KE ANE This document information is the intellectual property of Megawin Technology Co Ltd Megawin Technology Co Ltd 2007 All right reserved fy MEGAWIN MAKE YOU WIN Megawin 8051 Writer User Manual v3 80 3 3 MPC89L E 54 58 515 Figure 3 3 shows the configuration of the Flash memory of MPC89L E 54 58 515 The total memory size is 63K bytes and the ISP memory is user configured by using this Writer For MPC89L E 54 58 there is an AP memory if the SP memory
34. ze is 8K bytes and the IAP memory amp ISP memory are user configured by using this Writer Figure 3 4 MPC82L E 52 Flash Memory Configuration Application code AP memory 0000h OD L _ i IAP_lower_boundary Total Flash Memory 8KB Determined by the IAPLB Non volatile 7 data IAP memory ISP_start_address 0x1400 for ISP 3KB 0x1800 for ISP 2KB 0x1C00 for ISP 1KB IP Ole ISP memory 3KB 2KB 1KB None 4FFFh SSS ooo 1 The IAP memory lower boundary is determined by the MCU s hardware option APLB Two examples show how to configure the IAPLB Example 1 4K bytes of AP memory is wanted while no ISP memory is configured gt IAPLB should be programmed to 0x10 so the IAP memory range will be 0x1000 0x1F FF total 4K bytes Example 2 4K bytes of IAP memory is wanted while 1K bytes of ISP memory has been configured at 0x1C00 0x1FFF gt IAPLB should be programmed to Ox0C so the IAP memory range will be OxOCO0 0x1BFF total 4K bytes The user can find that the range of AP memory range is Lower boundary IAPLBx256 and Upper boundary ISP_start_address 1 Where IAPLB should be an even number This document information is the intellectual property of Megawin Technology Co Ltd 8 Megawin Technology Co Ltd 2007 All right reserved sY MEGAWIN Megawin 8051 Writer CsA F MAKE YOU WIN User Manual v3 80 3 5 MPC82L E 54 Figure 3
Download Pdf Manuals
Related Search
Related Contents
GPS Wireless Clock System User Manual 本保証書は、 本書記載の内容で鯛を行うことをお約束するもの Dossier de Presse La Confusionite 2012年12月号 (662kbyte) User`s Manual Copyright © All rights reserved.
Failed to retrieve file