Image 1Image 2

89s52  is widely used  IC in 8051 FAMILY.

It is programmed using ICSP with an external programmer USBASP (AVRDUDE).

89S52 has no BOOTLOADER , so it cannot be programmed through SERIAL Port.

W78E052DDG is 8051 compatible 8-bit controller from Nuvoton with 8K programmable flash memory in 40 Pin DIP package

This chip has separate dedicated 2K boot-loader memory, which makes this chip robust and very stable .It supports ISP program downloading from PC using RX-TX lines only.

Other specifications match exactly 89S52.

It contains an 8K-byte Flash EPROM , a 256-byte RAM; four 8-bit bi-directional (P0, P1, P2, P3) and bit-addressable I/O ports , an additional 4-bit I/O port P4; three 16-bit timer/counters ,  a hardware watchdog timer , and a serial port

The instruction set is fully compatible with the standard 8052. Note that the actual part number of the chip in the 40-pin DIP package is W78E052DDG

TITLE

Because the Nuvoton W78E052D microcontroller comes with a UART boot-loader, it can directly be programmed from the serial (COM) port. You can use “Nuvoton ISP-ICP Utility software” to program the target MCU with the help of a  USB TO RS232 Cable

This cable has CH340 serial IC inside.

Driver for CH340 to be installed in PC , for COM port allotment.

Image 1

The same development of 89S52 can be used for Nuvotone  IC.

Image 2

 

Note that in this procedure, the MCU’s Reset (RST) pin is controlled by the programmer; hence, a power cycling should become necessary in most situations.

The microcontroller needs an oscillator for its clock generation, so an external 11.0592-MHz crystal with two 22-pF capacitors as shown in the hardware setup diagram is required.

Furthermore, the chip has no internal power-on-reset, so it is achieved externally through the Reset pin using a 10-uF capacitor or 0.1 uf and a 10K resistor.

Image 19

Details of programming from the official Nuvotone site :

For the 8051 MCU products with ISP function, there are two program memories: one is APROM and the other is LDROM. APROM contains the user’s application code for normal operation while LDROM contains the ISP code (cooperating with the ISP Programmer) for updating of APROM.

To use the ISP Programmer to update APROM, the ISP code should always reside in LDROM. If the ISP code disappears from LDROM because of accidentally being erased by a universal programmer, the ISP function will become always failed.

To recover the ISP function, please use a universal programmer to program the Nuvoton standard ISP code into LDROM, and have its CONFIG setting properly configured .

Why is the ISP code easily/accidentally erased by a universal programmer? Because the LDROM is also erased along with the APROM if the user uses a universal programmer to program APROM.

So, it is  strongly recommended  to use the ISP Programmer to program APROM in the beginning of getting the MCU sample with ISP code inside. Don’t use any universal programmer to program APROM unless the ISP function won’t be used.

The difference between ISP (In-System Programming) and ICP (In-Circuit Programming) is that ISP is implemented by software control of MCU itself while ICP is implemented by hardware control. So, before updating the MCU chip, ISP needs a software code (the ISP-code) pre-programmed in MCU’s LDROM to function as software control while ICP doesn’t need any software code pre-programmed.

During ISP operation, the 8051 MCU’s P3.1 behaves as ‘DTA’ (serial data). When ISP is not requested, P3.1 can function as its normal general purpose I/O pin as long as P3.1 conforms to the following requirements: * The state of P3.1 must be logic-1 before the MCU is just released from reset condition. * During the ISP operation, P3.1 cannot be pulled low by the other components connected to it.

Nuvotone Utility IDE is used to dump HEX file on to the Nuvotone Chip.

Download the utility here :

http://www.alselectro.com/files/8051_nuvotone.zip

 

Image 3

Open the Utility

Select ISP BY COM PORT & SELECT THE COM PORT from the drop down menu.

Part no as W78E052D , items to be updated APROM.

Click on LOAD FILE button and browse to the location of the HEX file to load on the APROM Buffer.

 

Image 3

 

The creation of HEX file is similar to that of 89S52 using KEIL U-VISION software.

Open KEIL & create NEW Project.

Select Device for target as W79E052D ( selection of 89S52 also works).

Image 1

 

Image 2

Right click Target & under options for Target click on OUTPUT tab & put a tick mark against

CREATE HEX File.

Image 3

 

Right click SOURCE GROUP & click Add New item to Group.

Select C File & provide a name for the file.

Image 4

 

Now write your C code & click on BUILD or press F7 key.

 

Image 5

 

Image 6

Your HEX file is created under Objects folder.

Image 7

 

Image 8

Click on LOAD FILE in the NUVOTONE Utility & browse to the HEX file location to select it.

Image 9

 

Ensure that APROM is selected in the utility.

Image 10

 

Now click on UPDATE CHIP.

While you see the blue update bar at the bottom you must press the RESET button on the development board.

Image 11

 

If RESET button is not pressed , you get FAIL report.

Also note that the NUVOTONE Utility must be started in ADMIN mode.

 

Image 12

 

 

Image 14

Once you get the PASS report , you need to press the OK button.

This will execute the file loaded.

Image 15

There is also a P.M selection for multiple IC programming.

Tick mark this P.M & click on UPDATE CHIP.

You can program multiple chips in this mode ,

After RESET you can change the IC & program repeatedly.

 

Image 13

 

VIDEO :

 

 

blog_image