The SH69P31 EVB is used to evaluate the SH69P31 chip's function for the development of application program. It contains of
a SH69V31 chip to evaluate the functions of SH69P31. The following figure shows the placement diagram of SH69P31 EVB.
ON
+5VGND
J3
J2J1
JP1
5V 3V EXT
JP2
IDD TEST
J4
1
S1
C4C3
Y1
Crystal
ROSC
U2
U4
STOP HALTPOWER
74HC273
ROMH
SH69V31
1
JP4
DIP
234
5 6
PD3
PD2
J6
1
U1
74HC273
U5
U3
1
ROML
J5
ST
ICE
1
JP3
JP6
STKOVF
PORT
SW1
RESET
1/6
SH69P31 EVB
There are two configurations of SH69P31 EVB in application development: ICE mode and stand-alone m ode.
In the ICE mode, the SH66xx ICE (mother-board) is connected to the SH69P31 EVB by the ICE interface.
Power
User Application Board
User Application Board
Keyboard Array
SH69V56 Emulation
66 series RICE
Board
PC
(a) ICE mode
In the stand-alone mode, the SH69P31 EVB is no longer connected to the motherboard. But the EPROM chip should be
connected to EPROM sockets of the SH69P31 EVB. The EPROMs store the application program; they may be the 27512.
Power
User Application Board
User Application Board
Keyboard Array
(b) Stand-alone mode
The process of your program’s evaluation on SH69P31 EVB
Uasm66.exe: assemble the program, and get binary (*.obj) file and the other files.
Depart the one 16 bits obj file to two 8 bit files by convert.exe.
SH69V56 Emulation
Board
Usage example (for example: aaa.asm):
1. Run the SH66 series assemble program:
C: >uasm66 aaa.asm; to produce the obj file: aaa.obj
2. Depart the aaa.obj to two 8-bit file aaah.obj and aaal.obj, for example:
C: > convert
Input the 16 bits (.obj) file aaa.obj
Then aaah.obj and aaal.obj will be created.
3. Write the aaah.obj to EPROM (ROMH) and write the aaal.obj to EPROM (ROML)
4. Put the two EPROM (ROML and ROMH) into the EPROM sockets.
2/6
SH69P31 EVB
SH69P31 EVB Programming Notices:
1. Clear data RAM and initialize all system registers at the beginning..
2. Never use reserved registers.
3. If “IE” instruction (interrupt enable) is set outside the interrupt processing program and there is “HALT” or “STOP”
instruction, this two instructions should be followed by “IE” instruction closely.
4. After CPU responding to an interrupt, IRQ should be cleared before resetting IE in order to avoid many responses to one
interrupt.
5. Interrupt Enable instruction will be automatically cleared after entering interrupt-processing program. If setting IE too early,
it’s possible to re-entry the interrupt. So the Interrupt Enable instruction should be placed at the end and followed closely
by two instructions including “RTNI”.
6. During the two successive instruction cycles next to Interrupt Enable instruction, CPU will not respond to any interrupts.
7. After CPU responding to interrupts, each bit of IE will be cleared by hardware while IRQ should be cleared by software.
8. It is necessary to add NOP before or after the HALT instruction, else the CPU will execute error instruction when it wakes
up from the HALT.
.
. .
NOP
HAL T
NOP
.
. .
9. It is wise to set Interrupt Enable flag before you return from subroutine in two instructions.
10. When you set interrupt enable flag as the following and your subroutine do not set Interrupt Enable flag, then your system
will never wake up if an interrupt occurred between the NOP.
Wrong Example:
.
. .
LDI IE, 1111B; IE = Interru pt enable flag
NOP
NOP
NOP
HAL T
.
. .
11. Add "p=69P31" and "romsize=1536" at the beginning of a program. If finding problem in compiling the program, Please
check if the SH66.dev is located at the program directory.
12. Any instruction containing writing to or reading form memory, it should not be used to operate with I/O Port. It is best to
avoid using those instructions such as “SUB, ADD “ which do not contain Write operation with I/O Port but have
computation operation.
3/6
SH69P31 EVB
13. Setting I/O as Open Drain and then entering “STOP” will cause leakage current ranging from tens to hundreds micro-
ampere. So pull up or pull down resistor value from 1 to 2 MΩ must be used to prevent I/O “Floating” when the I/O is in
Open Drain mode.
14. Interrupt activating from STOP at the first time can save power.
15. Directly read PORT states to ensure the value is correct.
16. When the internal pull-up resistor is on, “1” must be written to I/O Port register before Reading.
17. It is necessary to insert 2 or 3 NOP instructions, when writing then reading I/O port.
18. When the Compiler of old version compiles program, the last line will be read twice. So, if the last line is an instruction, two
same operations will be occurred. If there is a Label in the last line, compiler will give the error named ‘repeated definition’.
This will happen in main program and included files and it is recommended that the last line should be a blank line or
END.
19. The stack has four layers, if an interrupt is enabled, there are only three layers can be used. Otherwise, if an interrupt
comes, the stack will overflow that will cause CPU Reset or other errors.
20. Key De-bounce time is recommended to be 50ms. If a user use Rubber Key, it is recommended to test Rubber Key’s De-
bounce time.
21. Index register DPH and DPM both have three bits only, so pay attention to the referred address when using them.
22. The “NOP” instruction should be added at the beginning of the program to ensure the IC is stable.
4/6
SH69P31 EVB
SH69P31 EVB Interface Connector: (Top View from EVB)
J1, J2 (VCC_EXT, GND):
External Power input as Stand-Alone mode. The voltage of VCC_EXT must be 3V±5%.
J3 (With USB ICE interface):
Connect with USB ICE66.
J4, J5 (With ICE interface J4, J5):
Connect with RICE66.
J6 (User’s interface):
SH69P31 interface
SH69P31 EVB Jumper Setting:
JP1 (SH69V31 chip power select):
Never short the +5V position, otherwise SH69V31 may not work properly or be damaged.
If short the +3V position, the voltage (+3V) of SH69V31 is internal source.
If short the EXT position, you can external input the power (1.8 ~ 3.6V, refer to SH69P31 spec.) of SH69V31 from EXT.
JP2 (SH69V31 chip power import):
This jumper must be connecting. (Default)
If you want to get the operating current (for reference only), remove the jump and link an amperemeter.
JP3 (With ICE/Stand-alone mode select):
If short the "With ICE" position, the clock of SH69P31 EVB can be fed from ICE. This is only for ICE mode.
If short the "Stand alone" position, the clock of SH69V31 must be provided by its oscillator or external clock (refer to
SH69P31 spec.).
JP4 (OSCI OSCO share select):
If short the "PD3" position, OSCI pin will be shared as PORTD3.
If short the "PD2" position, OSCO pin will be shared as PORTD2.
JP6 (STACK overflow ON/OFF):
The stack overflow function in ICE mode will on when it is short. (Default)