Data Memory Organization
The USB Controller includes 128 bytes of data RAM. The upper 16 bytes of the data memory are used as USB FIFOs for Endpoint
0 and Endpoint 1. Each endpoint is associated with an 8-byte FIFO.
The USB controller includes two pointers into data RAM, the Program Stack Pointer (PSP) and the Data Stack Pointer (DSP).
The value of PSP after reset is 0x00. The PSP increments by 2 whenever a CALL instruction is executed and it decrements by
2 whenever a RET instruction is used.
The DSP pre-decrements by 1 whenever a PUSH instruction is executed and it increments by 1 after a POP instruction is used.
The default value of the DSP after reset is 0x00, which would cause the first PUSH to write into USB FIFO space for Endpoint 1.
Therefore, the DSP should be mapped to a location such as 0x70 before initiating any data stack operations. Refer to the Reset
section for more information about DSP remapping after reset.
illustrates the Data Memory Space.
USB FIFO - Endpoint 0
USB FIFO - Endpoint 1
Figure 5-2. Data Memory Space
Document #: 38-08026 Rev. **
Page 8 of 31