English
Language : 

PIC18F4550-IP Datasheet, PDF (197/438 Pages) Microchip Technology – 28/40/44-Pin, High-Performance, Enhanced Flash, USB Microcontrollers with nanoWatt Technology
PIC18F2455/2550/4455/4550
18.3.3 READING FROM THE SPP
Reading from the SPP involves reading the SPPDATA
register. Reading the register the first time initiates the
read operation. When the read is finished, indicated by
the SPPBUSY bit, the SPPDATA will be loaded with the
current data.
The following is an example read sequence:
1. Write the 4-bit address to the SPPEPS register.
The SPP automatically starts writing the
address. If address write is not used then skip to
step 3.
2. Monitor the SPPBUSY bit to determine when the
address has been sent. The duration depends
on the wait states.
3. Read the data from the SPPDATA register; the
data from the previous read operation is
returned. The SPP automatically starts the read
cycle for the next read.
4. Monitor the SPPBUSY bit to determine when the
data has been read. The duration depends on
the wait states.
5. Go back to step 3 to read the current byte from
the SPP and start the next read cycle.
REGISTER 18-3: SPPEPS: SPP ENDPOINT ADDRESS AND STATUS REGISTER
R-0
RDSPP
bit 7
R-0
WRSPP
U-0
R-0
R/W-0
R/W-0
R/W-0
—
SPPBUSY ADDR3
ADDR2
ADDR1
R/W-0
ADDR0
bit 0
Legend:
R = Readable bit
-n = Value at POR
W = Writable bit
‘1’ = Bit is set
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5
bit 4
bit 3-0
RDSPP: SPP Read Status bit (Valid when SPPCON<SPPOWN> = 1, USB)
1 = The last transaction was a read from the SPP
0 = The last transaction was not a read from the SPP
WRSPP: SPP Write Status bit (Valid when SPPCON<SPPOWN> = 1, USB)
1 = The last transaction was a write to the SPP
0 = The last transaction was not a write to the SPP
Unimplemented: Read as ‘0’
SPPBUSY: SPP Handshaking Override bit
1 = The SPP is busy
0 = The SPP is ready to accept another read or write request
ADDR3:ADDR0: SPP Endpoint Address bits
1111 = Endpoint Address 15
•
•
•
•
0001
0000 = Endpoint Address 0
© 2009 Microchip Technology Inc.
DS39632E-page 195