Sie sind auf Seite 1von 15

Chapter 13

PIC Family Microcontroller

Lesson 07
Master Synchronous Serial Port (MSSP)

Synchronous Serial Ports (MSSP) 10-bit ADC USART 8-bit Timer TMR0

Internal Peripherals

16-bit Timer TMR1 8-bit Timer TMR2 CCP1, CCP2 8

Flash Memory 13 Program counter 13 2011 8-level stack (13-bit)

Data EEPROM 256 Byte Ports


Microcontrollers-... 2nd Ed. Raj Kamal A to Pearson Education

RAM Registers data bus 8 368 Byte


3

Master Synchronous Serial Port (MSSP)


Master Synchronous Serial Interface Port Communicating with other peripheral (serial EEPROMs, shift registers, display drivers, AD etc) or MCU

2011

Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education

MSSP
Two modes SPI (serial peripheral interface) I2C (Inter Integrated Circuit)

2011

Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education

SPI mode
SDO (Serial data out) and SDI (serial data in) pins [8-bit serial data synchronously out and simultaneously synchronously in] Serial clock SCK pin synchronising clock output SCK is set as input in slave mode An optional 4th signal may be used as SS (Slave select, when 0 then functions SPI functions as slave)
2011 Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education 6

Port C Pins RC3, 4, and 5


RC3 also as synchronous serial clock in or clock Out for SPI or I2C modes. Capture 2 input or Compare 2 output or PWM2 output RC4 also as synchronous serial for SPI data in or I2C data-in/data-out modes. RC5 also as synchronous serial for data out in SPI mode

2011

Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education

SPI six registers


INTCON (interrupt control register) PIR1 (peripheral interrupt flags register 1) PIE2 (peripheral interrupt enable register 1) SSPBUF(SSP transmit/receive buffer register) SSPSTAT (SSP status register) SSPCON (SSP control register)

2011

Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education

I2C
Master and slave functions SDA (serial data pin) and SCL (serial clock pin) Two pins

2011

Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education

Port C Pins RC3 and 4


RC3 as synchronous serial clock in I2C modes RC4 as synchronous serial for I2C data-in/dataout modes.

2011

Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education

10

I2C associates six registers


SSPCON (SSP control register) SSPCON2 (SSP control register2) SSPSTAT (SSP status register) SSPBUF(SSP transmit/receive buffer register) SSPSR (SSP shift register) SSADD (SSP address register)

2011

Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education

11

Summary

We learnt
Master Synchronous Serial Port Two modes: SPI and I2C SPI mode uses SDI, SDO, SCLK pins and optional SS I2C mode uses SDA, SCL pins

2011

Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education

13

We learnt
SPI Port C RC3, RC4 and RC5 pins I2C Port C RC3 and RC4 pins SFRs registers for Control, Status and Interrupts

2011

Microcontrollers-... 2nd Ed. Raj Kamal Pearson Education

14

End of Lesson 07 on
Master Synchronous Serial Port (MSSP)

Das könnte Ihnen auch gefallen