USB MSD Library documentation.


1. The interrupt procedure

In the interrupt procedure of the application the MSD processing procedure should be called. This procedure does all USB_MSD processing (including handling of the "internal" USB_MSD activities like reading from and writing to the SDMMC card) based on interrupts received from the PIC's SIE (the USB engine). This is to be done like this:
procedure interrupt;
begin
  USB_Interrupt; // USB_MSD processing procedure
end;
The USB initialization procedure ("InitUsb") takes care of the enabling of the necessary interrupts.

Important: There is no need to "force" extra interrupts, e.g. via a timer, the "USB_Interrupt" procedure will only do something when actually an interrupt came from the SIE (the PIC's USB engine).

2. Initialization

The initialization of the USB_MSD software is like:
  InitUsb;                    // Init USB_MSD and start the enumeration process
  repeat until ConfiguredUsb; // wait for the completion of the USB enumeration    
As you can see, the initialisation of USB_MSD and starting up of the USB enumeration procedure is done with a call to "InitUsb". This procedure does not wait for the USB enumeration process to complete.
The completeness of the enumeration process can be checked with "ConfiguredUsb": it returns true when emumeration is complete.

3. Data transport to and from the SDMMC card.

No code is needed in the application to make this happen. All MSD activities are done under interrupt.

Important:

4. Technical data


-------------------------------------------