Техническая Спецификация для Microchip Technology GPIODM-KPLCD

Скачать
Страница из 438
© 2009 Microchip Technology Inc.
 
DS39632E-page 195
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 R-0
U-0
R-0 
R/W-0 
R/W-0 
R/W-0 
R/W-0 
RDSPP
WRSPP
SPPBUSY
ADDR3
ADDR2
ADDR1
ADDR0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
-n = Value at POR
‘1’ = Bit is set
‘0’ = Bit is cleared
x = Bit is unknown
bit 7
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
bit 6
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
bit 5
Unimplemented: Read as ‘0’
bit 4
SPPBUSY: SPP Handshaking Override bit
1 = The SPP is busy
0 = The SPP is ready to accept another read or write request
bit 3-0
ADDR3:ADDR0: SPP Endpoint Address bits
1111 = Endpoint Address 15
                      •
                      •
0001 
0000 = Endpoint Address 0