SlideShare a Scribd company logo
2
Most read
3
Most read
11
Most read
MASTER SYNCHRONOUS SERIAL PORT
(MSSP)MODULE
• The Master Synchronous Serial Port (MSSP) module is
a serial interface useful for communicating with other
peripheral or micro controller devices.
• These peripheral devices may be serial EEPROMs,
shift registers, display drivers, A/D converters,SD
Cards,USB devices etc.
• The MSSP module can operate in one of two modes:
– Serial Peripheral Interface (SPI)
– Inter-Integrated Circuit (I2
C)
Master synchronous serial port (mssp)
Control Registers
• The MSSP module has three associated registers.
• status register (SSPSTAT) and two control registers
(SSPCON1 and SSPCON2).
SPI Mode
• SPI bus was started by Motorola Corp
• The SPI mode allows 8-bits of data to be synchronously
transmitted and received, simultaneously.
• To accomplish communication, typically three pins are
used:
• Serial Data Out (SDO) - RC5/SDO
• Serial Data In (SDI) - RC4/SDI/SDA
• Serial Clock (SCK) - RC3/SCK/SCL/LVDIN
• Additionally, a fourth pin may be used when in a Slave
mode of operation:
• Slave Select (SS) - RA5/SS/AN4
SPI Read and Write Protocol
• In connecting a device with an SPI bus to µC, we use µC as the
master while the SPI device acts as slave.
• µC generates the SCLK, which is fed to SCLK pin of the SPI
device, to synchronize the transfer of data one bit at a time, MSB
goes in first.
• During transfer, the SS(Slave Select) pin must be HIGH.
• To distinguish b/w read and write, D7 bit of address byte(A7) is
always 1 for write, and for read this bit is Low.
Steps for writing data to SPI device
Single byte write
• Make SS=0 to select the device for writing.
• 8bit address is shifted in one bit at a time, with each edge of
SCLK. A7 =1 for the write operation and the A7 bit goes in first.
• After all 8bits of the address are sent in, the SPI device expects to
receive the data belonging to address location immediately.
• The 8bit data is shifted in one bit at a time,with each edge of
SCLK.
• Make SS =0 to indicate the end of write cycle.
Multi byte burst write
• SS=0
• 8bit address of first location is provided and shifted one bit at a
time, each edge of SCLK A7=1 for the write operation and A7 bit
goes in first.
• The 8bit data for the first location is provided and shifted one bit
at a time, with each edge of the SCLK.
• From then on, we simply provide consecutive bytes of data to be
placed in consecutive locations.
• During this process SS must Low.
• SS=1 to end write cycle.
Steps for Reading data from SPI device
Single byte Read
• Make SS=0 to select the device for writing.
• 8bit address is shifted in one bit at a time, with each edge of
SCLK. A7 =0 for the write operation and the A7 bit goes in first.
• After all 8bits of the address are sent in, the SPI device sends out
the data belonging to address location immediately.
• The 8bit data is shifted out one bit at a time,with each edge of
SCLK.
• Make SS =0 to indicate the end of read cycle.
Multi byte burst Read
• SS=0
• 8bit address of first location is provided and shifted one bit at a
time, each edge of SCLK A7=0 for the write operation and A7 bit
goes in first.
• The 8bit data for the first location shifted out one bit at a time,
with each edge of the SCLK.
• From then on, we simply keep getting consecutive bytes of data to
be placed in consecutive locations.
• During this process SS must Low.
• SS=1 to end read cycle.
REGISTERS
The MSSP module has four registers
for SPI mode operation. These are:
• MSSP Control Register1 (SSPCON1)
• MSSP Status Register (SSPSTAT)
• Serial Receive/Transmit Buffer
(SSPBUF)
• MSSP Shift Register (SSPSR) - Not
directly accessible
SSPSTAT:MSSPSTATUSREGISTER(SPIMODE)
SSPCON1:MSSPCONTROLREGISTER1(SPIMODE)
OPERATION
• When initializing the SPI, several options need to be specified.
• This is done by programming the appropriate control bits
(SSPCON1<5:0>) and SSPSTAT<7:6>.
• These control bits allow the following to be specified:
– Master mode (SCK is the clock output)
– Slave mode (SCK is the clock input)
– Clock Polarity (IDLE state of SCK)
– Data input sample phase (middle or end of data output time)
– Clock edge (output data on rising/falling edge of SCK)
– Clock Rate (Master mode only)
– Slave Select mode (Slave mode only)
• The MSSP consists of a transmit/receive Shift Register (SSPSR) and a
buffer register (SSPBUF).
• The SSPSR shifts the data in and out of the device, MSb first.
• The SSPBUF holds the data that was written to the SSPSR, until the
received data is ready.
• Once the 8 bits of data have been received, that byte is moved to the
SSPBUF register.

More Related Content

PPTX
Pic microcontroller architecture
PPTX
8051 Microcontroller PPT's By Er. Swapnil Kaware
PPTX
8255 PPI
PPT
PDF
Programmable Peripheral Interface 8255
PDF
ARM CORTEX M3 PPT
PDF
Unit II arm 7 Instruction Set
PPTX
Pic microcontroller architecture
8051 Microcontroller PPT's By Er. Swapnil Kaware
8255 PPI
Programmable Peripheral Interface 8255
ARM CORTEX M3 PPT
Unit II arm 7 Instruction Set

What's hot (20)

PPTX
ARM Processors
PDF
8051 interfacing
PDF
Unit II Arm 7 Introduction
PPTX
Digital signal processor architecture
PPT
Interfacing 8255
PPTX
Architecture of 8051
PPSX
Lect 2 ARM processor architecture
PPT
Demultiplexing of buses of 8085 microprocessor
PPTX
ARM Processor
PPTX
PIC-18 Microcontroller
PDF
DAC Interfacing with 8051.pdf
PPTX
Vlsi design flow
PPTX
Arm cortex-m4 programmer model
DOCX
Arm7 Interfacing examples
PPTX
TMS320C6X Architecture
PPT
I2C Protocol
DOCX
Lambda design rule
PDF
ASIC vs SOC vs FPGA
ARM Processors
8051 interfacing
Unit II Arm 7 Introduction
Digital signal processor architecture
Interfacing 8255
Architecture of 8051
Lect 2 ARM processor architecture
Demultiplexing of buses of 8085 microprocessor
ARM Processor
PIC-18 Microcontroller
DAC Interfacing with 8051.pdf
Vlsi design flow
Arm cortex-m4 programmer model
Arm7 Interfacing examples
TMS320C6X Architecture
I2C Protocol
Lambda design rule
ASIC vs SOC vs FPGA
Ad

Similar to Master synchronous serial port (mssp) (20)

PPTX
SPI introduction(Serial Peripheral Interface)
PPT
Serial Peripheral Interface(SPI)
PPTX
Serial Peripheral Interface
PPTX
spi-180501092933-converted.pptx
PPT
SPI Bus Protocol
PPTX
UNI T 6- SPI_I2C_Lecture8.pptx
PDF
SPI Protocol in LPC2148
PPTX
Spi in arm7(lpc2148)
PPTX
embedded system on board communication.pptx
PPTX
embedded system on board communication.pptx
PPTX
embedded system on board communication.pptx
PDF
communication interfaces-Embedded real time systems
PDF
SOC Peripheral Components & SOC Tools
PDF
Serial Peripheral Interface
PPT
8085-micropprocessor power ponts7-phpapp01.ppt
PPT
Spi master core verification
PPTX
Presentation (1)-3.pptx
PPTX
LPC2148 SPI (Serial Peripheral Interface).pptx
PPT
10_2Starting with serial_II.ppt
PDF
SPI Design Report used in serial communication
SPI introduction(Serial Peripheral Interface)
Serial Peripheral Interface(SPI)
Serial Peripheral Interface
spi-180501092933-converted.pptx
SPI Bus Protocol
UNI T 6- SPI_I2C_Lecture8.pptx
SPI Protocol in LPC2148
Spi in arm7(lpc2148)
embedded system on board communication.pptx
embedded system on board communication.pptx
embedded system on board communication.pptx
communication interfaces-Embedded real time systems
SOC Peripheral Components & SOC Tools
Serial Peripheral Interface
8085-micropprocessor power ponts7-phpapp01.ppt
Spi master core verification
Presentation (1)-3.pptx
LPC2148 SPI (Serial Peripheral Interface).pptx
10_2Starting with serial_II.ppt
SPI Design Report used in serial communication
Ad

More from babak danyal (20)

DOCX
applist
PPT
Easy Steps to implement UDP Server and Client Sockets
PPT
Java IO Package and Streams
PPT
Swing and Graphical User Interface in Java
PPT
Tcp sockets
PPTX
block ciphers and the des
PPT
key distribution in network security
PPT
Lecture10 Signal and Systems
PPT
Lecture8 Signal and Systems
PPT
Lecture7 Signal and Systems
PPT
Lecture6 Signal and Systems
PPT
Lecture5 Signal and Systems
PPT
Lecture4 Signal and Systems
PPT
Lecture3 Signal and Systems
PPT
Lecture2 Signal and Systems
PPT
Lecture1 Intro To Signa
PPT
Lecture9 Signal and Systems
PPT
Lecture9
PPT
Cns 13f-lec03- Classical Encryption Techniques
PPT
Classical Encryption Techniques in Network Security
applist
Easy Steps to implement UDP Server and Client Sockets
Java IO Package and Streams
Swing and Graphical User Interface in Java
Tcp sockets
block ciphers and the des
key distribution in network security
Lecture10 Signal and Systems
Lecture8 Signal and Systems
Lecture7 Signal and Systems
Lecture6 Signal and Systems
Lecture5 Signal and Systems
Lecture4 Signal and Systems
Lecture3 Signal and Systems
Lecture2 Signal and Systems
Lecture1 Intro To Signa
Lecture9 Signal and Systems
Lecture9
Cns 13f-lec03- Classical Encryption Techniques
Classical Encryption Techniques in Network Security

Recently uploaded (20)

PDF
Classroom Observation Tools for Teachers
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
Insiders guide to clinical Medicine.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
RMMM.pdf make it easy to upload and study
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Basic Mud Logging Guide for educational purpose
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
Cell Types and Its function , kingdom of life
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Complications of Minimal Access Surgery at WLH
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
Classroom Observation Tools for Teachers
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Insiders guide to clinical Medicine.pdf
Microbial disease of the cardiovascular and lymphatic systems
RMMM.pdf make it easy to upload and study
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Basic Mud Logging Guide for educational purpose
O7-L3 Supply Chain Operations - ICLT Program
Renaissance Architecture: A Journey from Faith to Humanism
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
human mycosis Human fungal infections are called human mycosis..pptx
Abdominal Access Techniques with Prof. Dr. R K Mishra
Cell Types and Its function , kingdom of life
Module 4: Burden of Disease Tutorial Slides S2 2025
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Complications of Minimal Access Surgery at WLH
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Final Presentation General Medicine 03-08-2024.pptx

Master synchronous serial port (mssp)

  • 1. MASTER SYNCHRONOUS SERIAL PORT (MSSP)MODULE • The Master Synchronous Serial Port (MSSP) module is a serial interface useful for communicating with other peripheral or micro controller devices. • These peripheral devices may be serial EEPROMs, shift registers, display drivers, A/D converters,SD Cards,USB devices etc. • The MSSP module can operate in one of two modes: – Serial Peripheral Interface (SPI) – Inter-Integrated Circuit (I2 C)
  • 3. Control Registers • The MSSP module has three associated registers. • status register (SSPSTAT) and two control registers (SSPCON1 and SSPCON2). SPI Mode • SPI bus was started by Motorola Corp • The SPI mode allows 8-bits of data to be synchronously transmitted and received, simultaneously. • To accomplish communication, typically three pins are used: • Serial Data Out (SDO) - RC5/SDO • Serial Data In (SDI) - RC4/SDI/SDA • Serial Clock (SCK) - RC3/SCK/SCL/LVDIN • Additionally, a fourth pin may be used when in a Slave mode of operation: • Slave Select (SS) - RA5/SS/AN4
  • 4. SPI Read and Write Protocol • In connecting a device with an SPI bus to µC, we use µC as the master while the SPI device acts as slave. • µC generates the SCLK, which is fed to SCLK pin of the SPI device, to synchronize the transfer of data one bit at a time, MSB goes in first. • During transfer, the SS(Slave Select) pin must be HIGH. • To distinguish b/w read and write, D7 bit of address byte(A7) is always 1 for write, and for read this bit is Low.
  • 5. Steps for writing data to SPI device Single byte write • Make SS=0 to select the device for writing. • 8bit address is shifted in one bit at a time, with each edge of SCLK. A7 =1 for the write operation and the A7 bit goes in first. • After all 8bits of the address are sent in, the SPI device expects to receive the data belonging to address location immediately. • The 8bit data is shifted in one bit at a time,with each edge of SCLK. • Make SS =0 to indicate the end of write cycle.
  • 6. Multi byte burst write • SS=0 • 8bit address of first location is provided and shifted one bit at a time, each edge of SCLK A7=1 for the write operation and A7 bit goes in first. • The 8bit data for the first location is provided and shifted one bit at a time, with each edge of the SCLK. • From then on, we simply provide consecutive bytes of data to be placed in consecutive locations. • During this process SS must Low. • SS=1 to end write cycle.
  • 7. Steps for Reading data from SPI device Single byte Read • Make SS=0 to select the device for writing. • 8bit address is shifted in one bit at a time, with each edge of SCLK. A7 =0 for the write operation and the A7 bit goes in first. • After all 8bits of the address are sent in, the SPI device sends out the data belonging to address location immediately. • The 8bit data is shifted out one bit at a time,with each edge of SCLK. • Make SS =0 to indicate the end of read cycle.
  • 8. Multi byte burst Read • SS=0 • 8bit address of first location is provided and shifted one bit at a time, each edge of SCLK A7=0 for the write operation and A7 bit goes in first. • The 8bit data for the first location shifted out one bit at a time, with each edge of the SCLK. • From then on, we simply keep getting consecutive bytes of data to be placed in consecutive locations. • During this process SS must Low. • SS=1 to end read cycle.
  • 9. REGISTERS The MSSP module has four registers for SPI mode operation. These are: • MSSP Control Register1 (SSPCON1) • MSSP Status Register (SSPSTAT) • Serial Receive/Transmit Buffer (SSPBUF) • MSSP Shift Register (SSPSR) - Not directly accessible
  • 12. OPERATION • When initializing the SPI, several options need to be specified. • This is done by programming the appropriate control bits (SSPCON1<5:0>) and SSPSTAT<7:6>. • These control bits allow the following to be specified: – Master mode (SCK is the clock output) – Slave mode (SCK is the clock input) – Clock Polarity (IDLE state of SCK) – Data input sample phase (middle or end of data output time) – Clock edge (output data on rising/falling edge of SCK) – Clock Rate (Master mode only) – Slave Select mode (Slave mode only) • The MSSP consists of a transmit/receive Shift Register (SSPSR) and a buffer register (SSPBUF). • The SSPSR shifts the data in and out of the device, MSb first. • The SSPBUF holds the data that was written to the SSPSR, until the received data is ready. • Once the 8 bits of data have been received, that byte is moved to the SSPBUF register.