BL4S200 User’s Manual
66
4.2.5 Use of microSD™ Cards with BL4S200 Model
The following sample program can be found in the
SAMPLES\BLxS2xx\SD_Flash
folder.
•
SDFLASH_INSPECT.c
—This program is a utility for inspecting the contents of a
microSD™ Card
. It provides examples of both reading and writing pages or sectors to
the a
microSD™ Card
. When the sample program starts running, it attempts to initial-
ize the
microSD™ Card
on Serial Port B. The following five commands are displayed
in the Dynamic C
STDIO
window if a
microSD™ Card
is found:
p — print out the contents of a specified page on the
microSD™ Card
r — print out the contents of a range of pages on the
microSD™ Card
c — clear (set to zero) all of the bytes in a specified page
f — sets all bytes on the specified page to the given value
t — write user-specified text to a selected page
The sample program prints out a single line for a page if all bytes in the page are set to
the same value. Otherwise it prints a hex/ASCII dump of the page.
This utility works with the
microSD™ Card
at its lowest level, and writing to pages
will likely make the
microSD™ Card
unreadable by a PC. For PC compatibility, you
must use the Dynamic C FAT file system module, which allows you to work with files
on the
microSD™ Card
in a way that they will be PC-compatible.
4.2.6 Real-Time Clock
If you plan to use the real-time clock functionality in your application, you will need to set
the real-time clock. You may set the real-time clock using the
SETRTCKB.C
sample pro-
gram from the Dynamic C
SAMPLES\RTCLOCK
folder. The
RTC_TEST.C
sample pro-
gram in the Dynamic C
SAMPLES\RTCLOCK
folder provides additional examples of how
to read and set the real-time clock
4.2.7 TCP/IP Sample Programs
TCP/IP sample programs are described in Chapter 5.
electronic components distributor