SN8P2200 Series
USB 1.1 Low-Speed 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 102
Version 1.7
Example: Check the Endpoint 1’s OUT request
B0BTS1 UE1R.5
NOP
CALL EP1_FUNCTION
EP1_FUNCTION:
READ_EP1:
EP1_RD_RAM_addr_set
#0x8
;SET
Endpoint
1
FIFO
address
EP1_RD_RAM_data
;Data
move
to
ACC
MOV
FIFO_DATA_0,
A
;Data
move
to
FIFO_DATA_0
EP1_RD_RAM_addr_add
#0x1
;FIFO
address
+
1
EP1_RD_RAM_data
;Data
move
to
ACC
…
…
b0bclr
UE1R.5
;Clear bit after "read data from FIFO already”
;Hardware
will
set
the
bit
after
receive
the
data.
RET
9.5.4 USB ENDPOINT 2 ENABLE REGISTER
The communication with the USB host using endpoint 2, endpoint 2’s FIFO is implemented as 8 bytes of dedicated
RAM. The endponit2 is an interrupt endpoint.
0A3H
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
UE2R UE2E FFS2 UE2DO UE2DI UE2C3 UE2C UE2C1 UE2C0
Read/Write R/W
R
R/W
R/W R/W R/W R/W R/W
After
reset
0 0 0 0 0 0 0 0
Bit [3:0] UE2C [3:0]:
Indicate the number of data bytes in a transaction: For IN transactions, firmware loads the
count with the number of bytes to be transmitted to the host from the endpoint 2 FIFO.
Bit 4
UE2DI:
Indicate endpoint 2 data ready to host (IN token).
0 = Data is ready in EP2 FIFO for USB host drawing out. Firmware set the bit zero to indicate that data is
ready. Hardware will send an ACK to complete the transaction and set the bit to 1 after the IN token
transaction.
1 = Data is not ready in EP2 FIFO for IN token. Hardware will send NAK handshakes response to any IN
token sent to this endpoint. In addition, set this bit and the bit 5 of UPID register will send the STALL
handshake response to any IN token sent to this endpoint.
Bit 5
UE2DO:
Indicate endpoint 2 data ready from host (OUT token).
0 = Data doesn’t finish carrying. Data doesn’t finish carrying. Clear the bit by firmware after the FIFO data is
already read.
1 = Data carries successfully, and data is ready in EP2 FIFO.
Bit 6
FFS2
: endpoint 2 FIFO selection control bit.
FFS2
UE2DO=1, endpoint OUT data
UE2DI=1, endpoint IN data
0
FIFO 1
FIFO 0
1
FIFO 0
FIFO 1
Bit 7
UE2E:
USB endpoint 2 function enable bit.
0 = disable USB endpoint 2 function.
1 = enable USB endpoint 2 function.