PIC16LC72 Microchip Technology, PIC16LC72 Datasheet - Page 42
![no-image](/images/manufacturer_photos/0/4/439/microchip_technology_sml.jpg)
PIC16LC72
Manufacturer Part Number
PIC16LC72
Description
8-Bit CMOS Microcontrollers
Manufacturer
Microchip Technology
Datasheet
1.PIC16LC72.pdf
(124 pages)
Available stocks
Company
Part Number
Manufacturer
Quantity
Price
Company:
Part Number:
PIC16LC72-04/SO
Manufacturer:
Microchip Technology
Quantity:
135
Part Number:
PIC16LC72-04/SP
Manufacturer:
MIC
Quantity:
20 000
Part Number:
PIC16LC72A
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Company:
Part Number:
PIC16LC72A-04/SO
Manufacturer:
Microchip Technology
Quantity:
5 000
Company:
Part Number:
PIC16LC72A-04I/ML
Manufacturer:
Microchip Technology
Quantity:
135
PIC16C72 Series
8.2.1
A block diagram of the SSP Module in SPI Mode is
shown in Figure 8-3.
The SPI mode allows 8-bits of data to be synchro-
nously transmitted and received simultaneously. To
accomplish communication, typically three pins are
used:
• Serial Data Out (SDO) RC5/SDO
• Serial Data In (SDI)
• Serial Clock (SCK)
Additionally a fourth pin may be used when in a slave
mode of operation:
• Slave Select (SS)
When initializing the SPI, several options need to be
specified. This is done by programming the appropriate
control bits in the SSPCON register (SSPCON<5:0>).
These control bits allow the following to be specified:
• Master Operation (SCK is the clock output)
• Slave Mode (SCK is the clock input)
• Clock Polarity (Output/Input data on the Rising/
• Clock Rate (master operation only)
• Slave Select Mode (Slave mode only)
To enable the serial port, SSP enable bit SSPEN
(SSPCON<5>) must be set. To reset or reconfigure SPI
mode, clear enable bit SSPEN, re-initialize SSPCON
register, and then set enable bit SSPEN. This config-
ures the SDI, SDO, SCK, and SS pins as serial port
pins. For the pins to behave as the serial port function,
they must have their data direction bits (in the TRIS reg-
ister) appropriately programmed. That is:
• SDI must have TRISC<4> set
• SDO must have TRISC<5> cleared
• SCK (master operation) must have TRISC<3>
TABLE 8-1
DS39016A-page 42
Address
0Bh,8Bh
0Ch
8Ch
87h
13h
14h
85h
94h
Legend: x = unknown, u = unchanged, - = unimplemented read as '0'. Shaded cells are not used by the SSP in SPI mode.
Note 1:
Falling edge of SCK)
cleared
OPERATION OF SSP MODULE IN SPI
MODE - PIC16C72
These bits are unimplemented, read as '0'.
Name
INTCON
PIR1
PIE1
TRISC
SSPBUF
SSPCON
TRISA
SSP-
STAT
REGISTERS ASSOCIATED WITH SPI OPERATION
PORTC Data Direction Register
Synchronous Serial Port Receive Buffer/Transmit Register
WCOL
Bit 7
GIE
(1)
(1)
—
—
RC4/SDI/SDA
RC3/SCK/SCL
RA5/SS/AN4
SSPOV SSPEN
PEIE
ADIF
ADIE
Bit 6
—
—
PORTA Data Direction Register
Bit 5
T0IE
D/A
(1)
(1)
Preliminary
INTE
Bit 4
CKP
(1)
(1)
P
SSPM3 SSPM2 SSPM1
SSPIE CCP1IE TMR2IE TMR1IE 0000 0000 0000 0000
SSPIF
RBIE
Bit 3
S
• SCK (Slave mode) must have TRISC<3> set
• SS must have TRISA<5> set (if implemented)
FIGURE 8-3:
RC4/SDI/SDA
RC5/SDO
RA5/SS/AN4
RC3/SCK/
SCL
CCP1IF TMR2IF TMR1IF 0000 0000 0000 0000
Bit 2
T0IF
R/W
INTF
Bit 1
UA
Read
SS Control
SSP BLOCK DIAGRAM
(SPI MODE)
Select
TRISC<3>
Edge
SSPM3:SSPM0
Enable
bit0
Select
Edge
SSPM0 0000 0000 0000 0000
SSPBUF reg
RBIF
Bit 0
BF
SSPSR reg
1998 Microchip Technology Inc.
Clock Select
4
0000 000x 0000 000u
1111 1111 1111 1111
xxxx xxxx uuuu uuuu
--11 1111 --11 1111
--00 0000 --00 0000
Value on:
2
POR,
BOR
Write
Prescaler
4, 16, 64
clock
shift
TMR2 output
data bus
Internal
Value on
all other
resets
2
T
CY