W78E058DPG Nuvoton Technology Corporation of America, W78E058DPG Datasheet
![no-image](/images/manufacturer_photos/0/4/485/nuvoton_technology_corporation_of_america_sml.jpg)
W78E058DPG
Specifications of W78E058DPG
Available stocks
Related parts for W78E058DPG
W78E058DPG Summary of contents
Page 1
Preliminary W78E516D/W78E058D Data Sheet Table of Contents- 1 GENERAL DESCRIPTION ......................................................................................................... 3 2 FEATURES ................................................................................................................................. 4 3 PARTS INFORMATION LIST ..................................................................................................... 5 3.1 Lead Free (RoHS) Parts information list......................................................................... 5 4 PIN CONFIGURATIONS............................................................................................................. 6 5 PIN DESCRIPTIONS .................................................................................................................. 8 6 ...
Page 2
Preliminary W78E516D/W78E058D Data Sheet 13.1.1 External Reset ..............................................................................................................47 13.1.2 Software Reset .............................................................................................................47 13.1.3 RESET STATE .............................................................................................................47 13.2 Interrupt Sources ......................................................................................................... 48 13.3 Priority Level Structure ................................................................................................. 48 13.4 Interrupt Response Time .............................................................................................. 50 13.5 Interrupt Inputs.............................................................................................................. 51 14 PROGRAMMABLE TIMERS/COUNTERS ...
Page 3
Preliminary W78E516D/ W78E058D Data Sheet 1 GENERAL DESCRIPTION The W78E516D/W78E058D series is an 8-bit microcontroller which has an in-system programmable Flash EPROM for on-chip firmware updating. The instruction set of the W78E516D/W78E058D is fully compatible with the standard 8052. The ...
Page 4
... Lead Free (RoHS) DIP 40: - Lead Free (RoHS) PLCC 44: - Lead Free (RoHS) PQFP 44: - Lead Free (RoHS) LQFP 48: - Lead Free (RoHS) DIP 40: - Lead Free (RoHS) PLCC 44: - Lead Free (RoHS) PQFP 44: - Lead Free (RoHS) LQFP 48 C~85 C W78E516DDG W78E516DPG W78E516DFG W78E516DLG W78E058DDG W78E058DPG W78E058DFG W78E058DLG - 4 - ...
Page 5
... Preliminary W78E516D/ W78E058D Data Sheet 3 PARTS INFORMATION LIST 3.1 Lead Free (RoHS) Parts information list Table 3-1: Lead Free (RoHS) Parts information list PART NO. W78E516DDG W78E516DPG W78E516DFG W78E516DLG W78E058DDG W78E058DPG W78E058DFG W78E058DLG EPROM FLASH RAM PACKAGE SIZE DIP-40 Pin 512B 512B PLCC-44 Pin ...
Page 6
Preliminary W78E516D/W78E058D Data Sheet 4 PIN CONFIGURATIONS P1.5 P1.6 P1.7 RST RXD, P3.0 /INT2,P4.3 TXD, P3.1 INT0, P3.2 INT1, P3.3 T0, P3.4 T1, P3.5 T2, P1 VDD T2EX, P1 P0.0, AD0 P1 P0.1, AD1 ...
Page 7
Preliminary W78E516D/ W78E058D Data Sheet P1.5 1 P1.6 2 P1.7 3 RST 4 RXD, P3.0 5 PQFP 44-pin /INT2,P4.3 6 TXD, P3.1 7 INT0, P3.2 8 INT1, P3.3 9 T0, P3.4 10 T1, P3.5 11 INT7, P1.5 1 INT8, P1.6 ...
Page 8
Preliminary W78E516D/W78E058D Data Sheet 5 PIN DESCRIPTIONS SYMBOL TYPE EA I EXTERNAL ACCESS ENABLE: This pin forces the processor to execute the external ROM. The ROM address and data will not be present on the bus if the EA pin ...
Page 9
Preliminary W78E516D/ W78E058D Data Sheet 6 BLOCK DIAGRAM P1.0 Port 1 Port 1 Latch P1.7 Interrupt Timer 2 Timer 0 Timer 1 UART P3.0 Port 3 Port 3 Latch P3.7 INT2 / INT3 Port 4 P4.0 Port Latch 4 P4.3 ...
Page 10
Preliminary W78E516D/W78E058D Data Sheet 7 FUNCTIONAL DESCRIPTION The W78E516D/W78E058D series architecture consists of a core controller surrounded by various registers, four general purpose I/O ports, one special purpose programmable 4-bits I/O port, 512 bytes of RAM, three timer/counters, a serial ...
Page 11
Preliminary W78E516D/ W78E058D Data Sheet as an internal timer, depending on the setting of bit C/T2 in T2CON. Timer 2 has three operating modes: capture, auto-reload, and baud rate generator. The clock speed at capture or auto-reload mode is the ...
Page 12
Preliminary W78E516D/W78E058D Data Sheet 7.7.5 Stack Pointer The W78E516D/W78E058D series has an 8-bit Stack Pointer which points to the top of the Stack. This stack resides in the Scratch Pad RAM in the W78E516D/W78E058D series. Hence the size of the ...
Page 13
Preliminary W78E516D/ W78E058D Data Sheet 8 MEMORY ORGANIZATION The W78E516D/W78E058D series separate the memory into two separate sections, the Program Memory and the Data Memory. The Program Memory is used to store the instruction op-codes, while the Data Memory is ...
Page 14
Preliminary W78E516D/W78E058D Data Sheet Figure 8- 2 W78E516D/W78E058D RAM and SFR Memory Map Since the scratch-pad RAM is only 256bytes it can be used only when data contents are small. There are several other special purpose areas within the scratch-pad ...
Page 15
Preliminary W78E516D/ W78E058D Data Sheet FFH 80H 7FH 30H 2FH 2EH 2DH 2CH 2BH 2AH 29H 28H 27H 26H 25H 24H 23H 22H 21H 20H 1FH 18H 17H 10H 0FH 08H 07H 00H 8.2.1 Working Registers There are four sets ...
Page 16
Preliminary W78E516D/W78E058D Data Sheet selection is done by setting RS1-RS0 bits in the PSW. The R0 and R1 registers are used to store the address for indirect accessing. 8.2.2 Bit addressable Locations The Scratch-pad RAM area from location 20h to ...
Page 17
Preliminary W78E516D/ W78E058D Data Sheet 9 SPECIAL FUNCTION REGISTERS The W78E516D/W78E058D series uses Special Function Registers (SFRs) to control and monitor peripherals and their Modes. The SFRs reside in the register locations 80-FFh and are accessed by direct addressing only. ...
Page 18
Preliminary W78E516D/W78E058D Data Sheet Special Function Registers: SYMBOL DEFINITION CHPENR Chip enable register B B register ACC Accumulator P4 Port 4 PSW Program status word TH2 T2 reg. high TL2 T2 reg. low RCAP2H T2 capture low RCAP2L T2 capture ...
Page 19
Preliminary W78E516D/ W78E058D Data Sheet TCON Timer control PCON Power control POR Port option register P40AH HI address comparator of P4.0 P40AL LO address comparator of P4.0 DPH Data pointer high DPL Data pointer low SP Stack pointer P0 Port ...
Page 20
Preliminary W78E516D/W78E058D Data Sheet BIT NAME FUNCTION 7-0 DPH.[7:0] This is the high byte of the standard 8052 16-bit data pointer. P4.0 Base Address Low Byte Register Bit P40AL.7 P40AL.6 Mnemonic: P40AL BIT NAME FUNCTION 7-0 P40AL.[7:0] The ...
Page 21
Preliminary W78E516D/ W78E058D Data Sheet 1: Set automatically when a power-on reset has occurred. 3 GF1 General purpose user flags. 2 GF0 General purpose user flags The CPU goes into the POWER DOWN mode. In this mode, ...
Page 22
Preliminary W78E516D/W78E058D Data Sheet BIT NAME FUNCTION 7 GATE Gating control: When this bit is set, Timer/counter 1 is enabled only while the pin is high and the TR1 control bit is set. When cleared, the and Timer 1 is ...
Page 23
Preliminary W78E516D/ W78E058D Data Sheet Timer 0 MSB Bit TH0.7 TH0.6 Mnemonic: TH0 BIT NAME FUNCTION 7-0 TH0.[7:0] Timer 0 MSB. Timer 1 MSB Bit TH1.7 TH1.6 Mnemonic: TH1 BIT NAME FUNCTION 7-0 TH1.[7:0] Timer 1 ...
Page 24
Preliminary W78E516D/W78E058D Data Sheet PS2 PS1 PS0 Port 1 Bit P1.7 P1.6 Mnemonic: P1 ...
Page 25
Preliminary W78E516D/ W78E058D Data Sheet Mnemonic: SCON BIT NAME FUNCTION 7 SM0/FE Serial port mode select bit 0 or Framing Error Flag: The SMOD0 bit in PCON SFR determines whether this bit acts as SM0 or as FE. The operation ...
Page 26
Preliminary W78E516D/W78E058D Data Sheet consists of two separate internal 8-bit registers. One is the receive resister, and the other is the transmit buffer. Any read access gets data from the receive data buffer, while write access is to the transmit ...
Page 27
Preliminary W78E516D/ W78E058D Data Sheet Mnemonic:P42AH BIT NAME FUNCTION 7-0 P42AH.[7:0] The Base address register for comparator of P4.2. P42AH contains the High- order byte of address. Port 2 Expanded Control Bit P43CSIN P42CSIN Mnemonic: P2ECON BIT NAME ...
Page 28
Preliminary W78E516D/W78E058D Data Sheet P43AL.7 P43AL.6 Mnemonic: P43AL BIT NAME FUNCTION 7-0 P43AL.[7:0] The Base address register for comparator of P4.3. P43AL contains the low- order byte of address. P4.3 Base Address High Byte Register Bit P43AH.7 P43AH.6 ...
Page 29
Preliminary W78E516D/ W78E058D Data Sheet 1 FBOOTSL 0 FPROGEN External Interrupt Control Bit PX3 EX3 Mnemonic: XICON BIT NAME FUNCTION 7 PX3 External interrupt 3 priority high if set 6 EX3 External interrupt 3 enable if set 5 ...
Page 30
Preliminary W78E516D/W78E058D Data Sheet range depends on the SFR P41AH,P41AL,P41CMP1 and P41CMP0. 11: Mode 3. P4 Read/Write Strobe signal for chip select purpose. The address range depends on the SFR P41AH, P41AL, P41CMP1, and P41CMP0. 5,4 P41CMP1 Chip-select ...
Page 31
Preliminary W78E516D/ W78E058D Data Sheet Mnemonic: SFRAH BIT NAME FUNCTION 7-0 SFRAH.[7:0] The programming address of on-chip flash memory in programming mode. SFRFAH contains the high-order byte of address. SFR program For Data Bit SFRFD.7 SFRFD.6 SFRFD BIT ...
Page 32
Preliminary W78E516D/W78E058D Data Sheet BIT NAME FUNCTION 7 TF2 Timer 2 overflow flag: This bit is set when Timer 2 overflows also set when the count is equal to the capture register in down count mode. It can ...
Page 33
Preliminary W78E516D/ W78E058D Data Sheet Timer 2 Capture MSB Bit RCAP2h.7 RCAP2h.6 Mnemonic: RCAP2H BIT NAME FUNCTION 7-0 RCAP2H.[7:0] This register is used to capture the TH2 value when a timer 2 is configured in capture mode. RCAP2H ...
Page 34
Preliminary W78E516D/W78E058D Data Sheet 3 RS0 Register bank select bits Overflow flag: Set when a carry was generated from the seventh bit but not from the 8 result of the previous operation, or vice-versa User Flag ...
Page 35
Preliminary W78E516D/ W78E058D Data Sheet MOV CHPENR,#00H ;Disable CHPCON write attribute. Then any instruction MOVX @DPTR,A (with DPTR=1234H~1237H) will generate the positive polarity write strobe signal at pin P4.0 . And the instruction MOV P4,#XX will output the bit3 to ...
Page 36
Preliminary W78E516D/W78E058D Data Sheet Bit B.7 B.6 Mnemonic: B Bit Name Function 7-0 B The B register is the standard 8052 register that serves as a second accumulator. Chip Enable Register Bit CHPENR. CHPENR ...
Page 37
Preliminary W78E516D/ W78E058D Data Sheet 10 INSTRUCTION The W78E516D/W78E058D series execute all the instructions of the standard 8052 family. The operations of these instructions, as well as their effects on flag and status bits, are exactly the same. However, the ...
Page 38
Preliminary W78E516D/W78E058D Data Sheet SUBB SUBB SUBB SUBB SUBB SUBB SUBB SUBB SUBB A, @R0 96 ...
Page 39
Preliminary W78E516D/ W78E058D Data Sheet DEC @R1 17 DEC direct 15 MUL AB A4 DIV ANL ANL ANL ANL ANL ...
Page 40
Preliminary W78E516D/W78E058D Data Sheet XRL XRL XRL XRL XRL XRL XRL XRL A, @R0 66 XRL A, @R1 67 ...
Page 41
Preliminary W78E516D/ W78E058D Data Sheet MOV R3 MOV R4 MOV R5 MOV R6 MOV R7 MOV R0, direct A8 MOV R1, direct A9 MOV R2, direct AA MOV R3, direct ...
Page 42
Preliminary W78E516D/W78E058D Data Sheet MOV direct MOV direct MOV direct, @R0 86 MOV direct, @R1 87 MOV direct, direct 85 MOV direct, #data 75 MOV DPTR, #data 16 90 MOVC A, @A+DPTR 93 MOVC A, @A+PC ...
Page 43
Preliminary W78E516D/ W78E058D Data Sheet CPL bit B2 ANL C, bit 82 ANL C, /bit B0 ORL C, bit 72 ORL C, /bit A0 MOV C, bit A2 MOV bit ACALL addr11 71, 91, B1, 11, 31, 51, ...
Page 44
Preliminary W78E516D/W78E058D Data Sheet CJNE R5, #data, rel BD CJNE R6, #data, rel BE CJNE R7, #data, rel BF DJNZ R0, rel D8 DJNZ R1, rel D9 DJNZ R5, rel DD DJNZ R2, rel DA DJNZ R3, rel DB DJNZ ...
Page 45
Preliminary W78E516D/ W78E058D Data Sheet 11 INSTRUCTION TIMING A machine cycle consists of a sequence of 6 states, numbered S1 through S6. Each state time lasts for two oscillator periods. Thus a machine cycle takes 12 oscillator periods or 1ms ...
Page 46
Preliminary W78E516D/W78E058D Data Sheet 12 POWER MANAGEMENT The W78E516D/W78E058D has several features that help the user to control the power consumption of the device. The power saved features have basically the POWER DOWN mode and the IDLE mode of operation. ...
Page 47
Preliminary W78E516D/ W78E058D Data Sheet 13 RESET CONDITIONS The user has several hardware related options for placing the W78E516D/W78E058D into reset condition. In general, most register bits go to their reset value irrespective of the reset condition, but there are ...
Page 48
Preliminary W78E516D/W78E058D Data Sheet Interrupts The W78E516D/W78E058D has a two priority level interrupt structure with 8 interrupt sources. Each of the interrupt sources has an individual priority bit, flag, interrupt vector and enable bit. In addition, the interrupts can be ...
Page 49
Preliminary W78E516D/ W78E058D Data Sheet the same priority level. This hierarchy is defined as shown on Table. The interrupt flags are sampled every machine cycle. In the same machine cycle, the sampled interrupts are polled and their priority is resolved. ...
Page 50
Preliminary W78E516D/W78E058D Data Sheet determines which request is serviced. This is called the arbitration ranking. Note that the arbitration ranking is only used to resolve simultaneous requests of the same priority level. Table below summarizes the interrupt sources, flag bits, ...
Page 51
Preliminary W78E516D/ W78E058D Data Sheet Thus in a single-interrupt system the interrupt response time will always be more than 5 machine cycles and not more than 12 machine cycles. The maximum latency of 12 machine cycle is 48 clock cycles. ...
Page 52
Preliminary W78E516D/W78E058D Data Sheet 14 PROGRAMMABLE TIMERS/COUNTERS The W78E516D/W78E058D series have Three 16-bit programmable timer/counters.. 14.1 Timer/Counters 0 & 1 W78E516D/W78E058D has two 16-bit Timer/Counters. Each of these Timer/Counters has two 8 bit registers which form the 16 bit counting ...
Page 53
Preliminary W78E516D/ W78E058D Data Sheet Fosc 1/12 T0=P3.4 (T1=P3.5) TR0=TCON.4 (TR1=TCON.6) GATE=TMOD.3 (GATE=TMOD.7) INT0=P3.2 (INT1=P3.3) Figure 14- 1 Timer/Counters 0 & Mode 0,1 14.2.3 Mode 2 In Mode 2, the timer/counter is in the Auto Reload Mode. In ...
Page 54
Preliminary W78E516D/W78E058D Data Sheet C/ , GATE, TR0, INT0 and TF0. The TL0 can be used to count clock cycles (clock/12 control bits 1-to-0 transitions on pin T0 as determined by C/T (TMOD.2). TH0 is forced as a ...
Page 55
Preliminary W78E516D/ W78E058D Data Sheet Fosc 1/12 T2=P1.0 TR2=T2CON.2 T2EX=P1.1 EXEN2=T2CON.3 14.3.2 Auto-Reload Mode, Counting up The auto-reload mode counter is enabled by clearing the CP RL register. In this mode, Timer/Counter bit ...
Page 56
Preliminary W78E516D/W78E058D Data Sheet 14.3.3 Baud Rate0 Generator Mode The baud rate generator mode is enabled by setting either the RCLK or TCLK bits in T2CON register. While in the baud rate generator mode, Timer/Counter bit ...
Page 57
Preliminary W78E516D/ W78E058D Data Sheet 15 WATCHDOG TIMER The Watchdog timer is a free-running timer which can be programmed by the user to serve as a system monitor, a time-base generator or an event timer basically a set ...
Page 58
Preliminary W78E516D/W78E058D Data Sheet WIDL IDLE 1/6 OSC 1/12 W atchdog Timer Block Diagram Figure 15- 1 Watchdog Timer Block Diagram Typical Watch-Dog time-out period when OSC = 20 MHz ENW EXTERNAL RESET PRESCALE R CLRW PS2 PS1 PS0 Watchdog ...
Page 59
Preliminary W78E516D/ W78E058D Data Sheet 16 SERIAL PORT Serial port in this device is a full duplex port. The serial port is capable of synchronous as well as asynchronous communication. In Synchronous mode the device generates the clock and operates ...
Page 60
Preliminary W78E516D/W78E058D Data Sheet Write to SBUF Fosc 1/12 1/4 TX START SM2 CLOCK RX CLOCK RI REN TX START Serial Controllor RXD P3.0 Alternate Input Function The TI flag is set high in S6P2 following the ...
Page 61
Preliminary W78E516D/ W78E058D Data Sheet the divide by 16 counters. The 16 states of the counter effectively divide the bit time into 16 slices. The bit detection is done on a best of three basie. The bit detector samples the ...
Page 62
Preliminary W78E516D/W78E058D Data Sheet description is shown in the figure below. The frame consists of one start bit (0), 8 data bits (LSB first), a programmable 9th bit (TB8) and a stop bit (0). The 9th bit received is put ...
Page 63
Preliminary W78E516D/ W78E058D Data Sheet done must be 0 and 2. Either SM2 = 0, or the received stop bit = 1. If these conditions are met, then the stop bit goes to RB8, the 8 data bits ...
Page 64
Preliminary W78E516D/W78E058D Data Sheet Asynch Asynch Asynch. Timer 1 10 bits bits TCLKS Timer 1 11 bits Table 16- 1 Serial Ports Modes - ...
Page 65
Preliminary W78E516D/ W78E058D Data Sheet 17 F04KBOOT MODE (BOOT FROM 4K BYTES OF LDROM ) The W78E516D/W78E058D boots from APROM program (64K/32K bytes) by default at power on reset. On some occasions, user can force the W78E516D/W78E058D to boot from ...
Page 66
Preliminary W78E516D/W78E058D Data Sheet 18 ISP(IN-SYSTEM PROGRAMMING) ISP is the ability of prograbbable MCU to be programmed while F/W code in a AP-ROM or LD-ROM ...
Page 67
Preliminary W78E516D/ W78E058D Data Sheet rith ter In-S y stem ...
Page 68
Preliminary W78E516D/W78E058D Data Sheet - 68 - ...
Page 69
Preliminary W78E516D/ W78E058D Data Sheet Go Timer Interrupt Service Routine: Stop Timer & disable interrupt Is F04KBOOT Mode? No (CHPCON.7=1 or CHPCON.0=0) Yes Reset the CHPCON Register: MOV CHPENR,#87H MOV CHPENR,#59H MOV CHPCON,#03H Setting Timer and enable Timer interrupt for ...
Page 70
Preliminary W78E516D/W78E058D Data Sheet - 70 - ...
Page 71
Preliminary W78E516D/ W78E058D Data Sheet 19 CONFIG BITS During the on-chip Flash EPROM operation mode, the Flash EPROM can be programmed and verified repeatedly. Until the code inside the Flash EPROM is confirmed OK, the code can be protected. The ...
Page 72
Preliminary W78E516D/W78E058D Data Sheet 20 TYPICAL APPLICATION CIRCUITS Expanded External Program Memory and Crystal Vcc Vcc 10u CRYSTAL R 8. Figure A Expanded External Data Memory and Oscillator Vcc Vcc EA/VP 10u X1 OSCILLATOR X2 8.2K RESET INT0 ...
Page 73
Preliminary W78E516D/ W78E058D Data Sheet 21 ELECTRICAL CHARACTERISTICS 21.1 Absolute Maximum Ratings SYMBOL DC Power Supply Input Voltage Operating Temperature Storage Temperature Maximum Current into VDD Maximum Current out of VSS Note: Exposure to conditions beyond those listed under absolute ...
Page 74
Preliminary W78E516D/W78E058D Data Sheet 21.2 D.C. ELECTRICAL CHARACTERISTICS (V = 2.7~5V±10%, V =0V 25°C, unless otherwise specified Symbol Parameter V Operating Voltage DD I Operating Current DD I Idle Current IDLE I Power Down Current ...
Page 75
Preliminary W78E516D/ W78E058D Data Sheet Isr1 Source current P1, P2, P3, P4 (Quasi- didirectional mode) Isr2 Source current[*2] P0, P2, ALE, /PSEN Notes: *1, RST pin is a schmitt trigger input. RST has internal pull-low resistors. *2, P0, P2, ALE, ...
Page 76
Preliminary W78E516D/W78E058D Data Sheet PSEN Low to Data Valid Data Hold after PSEN High Data Float after PSEN High ALE Pulse Width PSEN Pulse Width Notes: 1. P0.0 − P0.7, P2.0 − P2.7 remain stable throughout entire memory cycle. 2. ...
Page 77
Preliminary W78E516D/ W78E058D Data Sheet 21.4.1 Program Fetch Cycle XTAL1 ALE T APL PSEN T PSW T AAS PORT 2 T PDA T AAH PORT 0 A0-A7 Code 21.4.2 Data Read Cycle XTAL1 ALE ...
Page 78
Preliminary W78E516D/W78E058D Data Sheet 21.4.3 Data Write Cycle XTAL1 ALE PSEN PORT 2 PORT 0 A0- DAW 21.4.4 Port Access Cycle XTAL1 ALE T PDS PORT INPUT SAMPLE A8-A15 DATA OUT ...
Page 79
Preliminary W78E516D/ W78E058D Data Sheet 21.4.5 Program Operation Program V P2 (A15... A0 P3 PWP V (CE P3.3 IH (OECTRL P3 (OE ...
Page 80
Preliminary W78E516D/W78E058D Data Sheet 22 PACKAGE DIMENSIONS 22.1 40-pin DIP Symbol α ...
Page 81
Preliminary W78E516D/ W78E058D Data Sheet 22.2 44-pin PLCC Seating Plane Symbol ...
Page 82
Preliminary W78E516D/W78E058D Data Sheet 22.3 44-pin PQFP See Detail F Seating Plane Symbol Min A A 0.002 1 A 0.075 2 b 0.01 c 0.004 D 0.390 E 0.390 e H 0.510 ...
Page 83
Preliminary W78E516D/ W78E058D Data Sheet 22.4 48-pin LQFP Publication Release Date: July 30, 2008 - 83 - Revision A01 ...
Page 84
Preliminary W78E516D/W78E058D Data Sheet Application Note: In-system Programming Software Examples This application note illustrates the in-system programmability of the microcontroller. In this example, microcontroller will boot from APROM bank and waiting for a key to enter in-system programming mode for ...
Page 85
Preliminary W78E516D/ W78E058D Data Sheet MOV R6,#FEH MOV R7,#FFH MOV TL0,R6 MOV TH0,R7 MOV TMOD,#01H MOV TCON,#10H MOV PCON,#01H ;PROGRAMMABILITY ;******************************************************************************** ;* Normal mode APROM program: depending user's application ;******************************************************************************** NORMAL_MODE: EXAMPLE 2: ;***************************************************************************************************************************** ;* Example of 4KB LDROM program: ...
Page 86
Preliminary W78E516D/W78E058D Data Sheet MAIN_4K: MOV CHPENR,#87H ;CHPENR=87H, CHPCON WRITE ENABLE. MOV CHPENR,#59H ;CHPENR=59H, CHPCON WRITE ENABLE. MOV 7FH,#01H MOV A,CHPCON ANL A,#01H CJNE A,#00H,UPDATE_ MOV 7FH,#00H MOV CHPCON,#01H ;CHPCON=01H, ENABLE IN-SYSTEM PROGRAMMING. MOV CHPENR,#00H ;DISABLE CHPCON WRITE ATTRIBUTE MOV ...
Page 87
Preliminary W78E516D/ W78E058D Data Sheet BLANK_CHECK_LOOP: SETB TR0 MOV PCON,#01H MOV A,SFRFD CJNE A,#FFH,BLANK_CHECK_ERROR INC SFRAL MOV A,SFRAL JNZ BLANK_CHECK_LOOP INC SFRAH MOV A,SFRAH CJNE A,#C0H,BLANK_CHECK_LOOP ;END ADDRESS=BFFFH JMP PROGRAM_ROM BLANK_CHECK_ERROR: MOV P1,#F0H MOV P3,#F0H JMP $ ;******************************************************************************* ;* RE-PROGRAMMING ...
Page 88
Preliminary W78E516D/W78E058D Data Sheet MOV DPTR,#0H MOV R2,#0H MOV R1,#0H MOV SFRAH,R1 MOV SFRCN,#00H READ_VERIFY_: MOV SFRAL,R2 MOV TCON,#10H MOV PCON,#01H INC R2 MOVX A,@DPTR INC DPTR CJNE A,SFRFD,ERROR_ CJNE R2,#0H,READ_VERIFY_ INC R1 MOV SFRAH,R1 CJNE R1,#C0H,READ_VERIFY_ ;****************************************************************************** ;* PROGRAMMING ...
Page 89
Preliminary W78E516D/ W78E058D Data Sheet 23 REVISION HISTORY VERSION DATE A01 June 24, 2008 Nuvoton products are not designed, intended, authorized or warranted for use as components in systems or equipment intended for surgical implantation, atomic energy control instruments, airplane ...