NB2AS MicroSD Card Demo Program
The microSD card on the
NB2AS
is connected to the SPI port. Six I/O lines are required.
Three SPI lines (MOSI, MISO, SCK), a chip-select line (CS)
a card-detect line (CD) and a power-enable (USD_PWR).
This microSD demo sketch demonstrates the intialization
of the microSD card, readback of the card identifcation (CID)
register and read/write of a block. After the initialization
is complete the RTC will generate an interrupt every time
the seconds count is equal to twenty. Each time the interrupt
occurs the time will be written to the microSD card. The time
is written in a BCD format for ease of debugging.
The screenshot on the right shows the output from the
intialization sequence. The CID is output after the initialization,
a write command is executed followed by a read command. The
data that is read is output.
The screenshot on the bottom right shows the output of a
dlog command. The time is datalogged in a BCD format
and then the block is readback and output. All unused
bytes are filled with zeros.
NB2AS microSD Demo Sketch
File ../../docs/app-files/nb2as_dlog_r0.pde could not be opened for input