SH79F085/SH79F165 Application Note
SH79F085/SH79F165 Application Note
1 Introduction
SH79F085/SH79F165 is an 8051 compatible micro-controller with a redesigned CPU of high efficiency and high performance. The device provides high-endurance Flash program memory to store user’s code. In circuit programming and debugging is offered to facilitate testing and debugging the systems using SH79F085/SH79F165 without removing the circuit from the board.
The Sinowealth 8051 JET51 Driver is intended to provide the product development engineer with a complete microcontroller design tool set for Sinowealth 8 bit microcontrollers. Software control of the JET51 Driver is advanced by the Keil µ vision Integrated Development Environment via a JTAG interface, which allows editing, building, downloading and source debugging from a single environment.
1.1 Package
SH79F165: SOP24/SOP28 package
SH79F085: TSSOP20 package
2 Using Target Board
2.1 Software Installation
Steps
1)Install Keil c uvision2 (V2.34 or above) or uvision3
2)Install JET51_Keil_Vxxx.exe (Vxxx means version), the device library for Sinowealth 8-bit microcontrollers, to the
Keil C directory.
3)Connect the JET51emluator to the PC via a USB cable. The red power LED and green USB LED will turn on if the installation is successful.
2.2Target Board
Set up the target board as follows:
1)Connect the flat cable from the SH79F085/SH79F165 target board to the JET51emluator via JTAG
2)Connect C pin with external 47uF capacitor to GND.
3)The JTAG pins of the SH79F085/SH79F165 cannot be used as I/O function when downloading and debugging . To communicate successfully with the emulator, make sure the JTAG pins are connected with no loads.
1/27 |
V 1.0 |
SH79F085/SH79F165 Application Note
4)Make sure the selected options (Oscillator option, Power option, etc) on the Setting dialog are the same as what target board actually selects.
5)The capacitance between VDD and GND cannot be greater than 220µF; otherwise communication error may occur.
|
PWR |
JET51 |
|
|
|
|
|
|
|
|
|
|
USB |
VDD TCK |
|
|
VDD TCK |
|
|
|
|
||
USB |
|
GND TDI |
10 |
10 |
TDI |
|
GND TMS |
PINs |
PINs |
TMS |
|
|
|
||||
|
|
TDO |
TDO |
||
|
|
|
|
||
|
|
GND |
|
|
GND |
SH79F085/SH79F165
Target Board
When designing user’s own board, 5 jumpers connecting JTAG pins with application circuit are recommended. To program the device or run the device in emulation mode, the jumpers should be disconnected.
SH79F085/ |
JET 51 |
|
|
SH79F165 |
|
VDD |
|
TCK |
|
TDI |
|
TMS |
|
TDO |
|
GND |
|
To Application |
|
Circuit |
|
Jumper |
|
2/27 |
V 1.0 |
|
SH79F085/SH79F165 Application Note
2.3 Creating a Project
The following steps describe how to create a new project.
Note: The source file – aa.asm located in ...\user directory.
3/27 |
V 1.0 |
|
SH79F085/SH79F165 Application Note
An empty project has been created, then setting the attribute as follow.
4/27 |
V 1.0 |
|
SH79F085/SH79F165 Application Note
The attribute of project is now finished, and then the program will be added to the project as follow.
5/27 |
V 1.0 |
|
SH79F085/SH79F165 Application Note
Step12:
Right click12: the blank space at the program, file star, which, a pop-up menu comes, up. Select the head file of menu item, and add head file to program.
Right click the head file to open a
, pop-up menu. Select the menu
, , item ”Open document <SH79F165.H>”
to open the head file in a new window.
6/27 |
V 1.0 |
|
SH79F085/SH79F165 Application Note
2.4 Building a Project and Downloading to the Flash Memory 2.4.1 Building a Project
Select Project->Build target or click the corresponding button to build the source files. If no compilation error and linking error are found, OBJ and HEX files will generate. The generated files can be found in the directory
\user.
7/27 |
V 1.0 |
|
SH79F085/SH79F165 Application Note
2.4.2 Downloading to the Flash Program Memory 2.4.2.1 Setting for Downloading
Before downloading the code, some options, including programming device, device’s code option and power supply source, must be determined. Since the options will save automatically each time you set them, this step can be skipped once you did before.
8/27 |
V 1.0 |
|
SH79F085/SH79F165 Application Note
9/27 |
V 1.0 |
|