Freescale Semiconductor, Inc.
Each EEPROM command subroutine has input data and output data. This data is inherent with some
commands while others need the information passed to them before the subroutine is called. Table 2 lists
the input data needed and output data generated for each of the seven commands.
Table 2:
Command
Subroutine Input
Subroutine Output
READ
EWEN
ERASE
ERAL
ADDR
DATA_H/L
—
—
—
—
—
—
—
ADDR
—
ADDR & DATA_H/L
DATA_H/L
—
WRITE
WRALL
EWDS
Code was written and tested with a level of quality equal to the Carnegie-Mellon Software Engineering
Institute (SEI) Level 2. A test routine consisting of writing and reading the EEPROM is listed in Appendix C.
Refer to Appendix A for the schematic used in the design and test of the software. An LED is used to verify
that the test code works properly. The test routine executes the following:
1) Initializes the port on the HC705J1A for serial transmission. LED is turned off.
2) Writes EEPROM address $00 with $AA55.
3) Writes EEPROM address $20 with $1234.
4) Reads EEPROM address $00 and stores it to RAM location TEST1 and TEST2.
5) Reads EEPROM address $20 and stores it to RAM location TEST3 and TEST4.
6) Checks if TEST1 = $AA, TEST2 = $55, TEST3 = $12, and TEST4 = $34.
7) If check is good, then light the LED. If check is bad, do not light the LED.
8) Continue to run in an infinite loop until reset.
For increased reliability, the software watchdog on the MC68HC705J1A is used. Also, a low voltage inhibit
circuit, the MC34064, is used to decrease susceptibility to brown out or short power failure conditions.
SUMMARY
This application note has described the interface needed to successfully communicate between the
MC68HC705J1A and the 9356. For more information on the MC68HC705J1A, please consult the
Technical Data Manual, MC68HC705J1A/D. Contact National Semiconductor or SGS Thompson for
technical data on the 93XX series of EEPROM memories.
An electronic copy of the code listing in Appendix C and a listing of the test program to fully test all the
EEPROM commands can be found on the Freescale MCU BBS. The BBS number is (512) 891-3733. The
filename is j1a_9356.arc and is on the CSIC BBS under the APPNOTES directory.
Also, Freescale Application Note AN1221/D further details the software and hardware interfaces needed
between the 93XX series and other HC05 MCUs.
AN1241/D
For More Information On This Product,
Go to: www.freescale.com
3