May
2006, Issue 190
Mobile
Phone Book
M16C/62P-Based
Data Backup System
Renesas M16C 2005 Honorable Mention
FUNCTIONAL
FLOWCHART
At
power-up, a welcome message appears on the LCD screen.
Several seconds later, the main menu appears with two
options. Switches S1, S2, and S3 enable you to make
selections (see Figure 4).
|

(Click
here to enlarge)
|
Figure
4—The system reads the phone book records into the
internal RAM. The data records can be obtained by
establishing a dialog with the SIM card by taking
them from the microcontroller’s flash memory from
a previous session or by receiving them directly
from the PC through the serial port. |
The
first menu option enables the phone book to be read
from either the SIM smart card or the M16C/62P’s internal
flash memory. The second option enables the phone book
to be received through the RS-232 serial interface.
It’s configured as 115,200 bps, 8 bits, no parity, 1
stop bit using HyperTerminal. The phone book stored
in the PC is a text file formatted as a comma separated
value (CSV) file that’s compatible with the Address
Book application in Windows.
After
reading the full phone book, the main menu changes accordingly
(see Figure 5). You can review all of the available
records. Their names are displayed in the first row
on the LCD. The phone numbers appear in second row.
Switches S1 and S2 enable you to select the records.
If a name or number is too long to display in full,
you can press the S2 (as a shift key) and the S1 or
S3 buttons at the same time to shift the display to
the right or left.
|

(Click
here to enlarge)
|
Figure
5—The system enables you to view and save the phone
book records. After the phone book has been updated,
you can store all of the records to the SIM card
again, save them in the microcontroller’s internal
flash memory, or send them over the serial port
to a PC. |
You
can back up your phone book to a SIM smart card, the
M16C/62P’s internal flash memory, or to a PC using the
RS-232 serial interface. Because of the M16C/62P’s limited
amount of data flash memory, you might not be able to
store all of your records in it. It depends on the number
of active records you need to store.
When
making menu selections, remember that the S3 switch
enables you to return to the previous level. This isn’t
displayed on the LCD because of its limited display
capacity.
Before
reading or updating the SIM smart card, a PIN number
must be verified. The PIN consists of a string of four
numbers. Use the analog potentiometer knob to enter
the numbers. When you turn the knob counterclockwise,
the digits increase from 0 to 9 in increments of one.
Conversely, when the knob moves clockwise, the digits
drop from 9 to 0. The S3 switch is the Enter key. It’s
an inexpensive solution for entering numeric information
without having to use a dedicated keypad.
There
are typically only three attempts to verify the PIN
number. After the third unsuccessful attempt, the PIN
locks. Another device, such as a GSM phone that asks
for the PIN unlock key (PUK), is then needed to unlock
the PIN.