1.10 SDMMC Driver Asynchronous - SDIO Read Write
This example application shows how to use the SDMMC (SDIO) driver in asynchronous mode to perform read/write operations on the ATWILC1000 SDIO card.
Description
- This example uses the SDIO driver in asynchronous mode and demonstrates read/write operations using CMD52 (single byte read/write) and CMD53 (multi-byte and block transfers).
-
The application reads and writes following registers:
1. Read Card Capability Register using CMD52
2. Read FN0 Block Size Register (16-bits) using CMD53
3. Write FN0 Block Size Register to 256 using CMD53
4. Read back and confirm if the FN0 Block Size Register is updated to 256
5. Write FN0 Block Size Register back to 512 using two CMD52 commands and Read after Write enabled
6. Confirm that FN0 Block Size Register is set back to 512
7. Read all 512 bytes of Card Common Control Register (CCCR) using CMD53 Block transfer
8. Enable FN1 CSA - Code Storage Area - by writing to address 0x100 in Function Basic Registers (FBR) region using CMD52
9. Read back and verify the value of FBR register at address 0x100
10. Write 3 bytes of Function 1 Code Storage Area (CSA) at address 0x10C to value 0x1000 using CMD52
11. Read 4 bytes of Chip ID from address 0x1000 using CMD53. The read chip ID must be 0x1003A0
Downloading and Building the Application
To clone or download this application from Github, go to the main page of this repository and then click Clone button to clone this repository or download as zip file. This content can also be downloaded using content manager by following these instructions.
Path of the application within the repository is apps/driver/sdmmc/async/sdio_read_write.
To build the application, refer to the following table and open the project using its IDE.
Project Name | Description |
---|---|
sam_9x75_curiosity.X | MPLABX project for SAM9X75 Curiosity Development Board |
Setting Up AT91Bootstrap loader
To load the application binary onto the target device, we need to use at91bootstrap loader. Refer to the at91bootstrap loader documentation for details on how to use it to bootstrap the application binaries.
Setting Up the Hardware
The following table shows the target hardware for the application projects.
Project Name | Description |
---|---|
sam_9x75_curiosity.X | SAM9X75 Curiosity Development Board |
Setting Up SAM9X75 Curiosity Development Board
- Insert the ATWILC1000-SD board into SD TF Card Socket Female to Micro-SD TF Male Memory Card Kit Extension Adapter, then insert it into SD BOOT (J14) slot on the board
- Connect the UART DEBUG J35 on board to the computer using a UART-FTDI cable (to enable debug com port)
- Connect the USB port J2 on board to the computer using a micro USB cable (to power the board)
Running the Application
- Open the Terminal application (Ex.:Tera term) on the computer
- Connect the COM port and
configure the serial settings as follows :
- Baud : 115200
- Data : 8 Bits
- Parity : None
- Stop : 1 Bit
- Flow Control : None
- Build and program the application using its IDE
- Observe the following messages on serial terminal