SlideShare a Scribd company logo
Chapter 7 : Serial Peripheral
            Interface C28x


  Digital Signal Controller
    TMS320F2812



Technology beyond the Dreams™   Copyright © 2006 Pantech Solutions Pvt
SPI Data Flow
     • Simultaneous transmits and receive

     • SPI Master provides the clock signal



        SPI Device #1 - Master                SPI Device #2 - Slave
                   shift                                shift
           SPI Shift Register
            SPI Shift Register                 SPI Shift Register
                                                SPI Shift Register

                                     clock




Technology beyond the Dreams™                      Copyright © 2006 Pantech Solutions Pvt
SPI Block Diagram
    C28x - SPI Master Mode Shown
                                                                      SPISIMO
                           RX FIFO_0


                           RX FIFO_15
                          SPIRXBUF.15-0

                   MSB                     LSB
                           SPIDAT.15-0                                SPISOMI


                          SPITXBUF.15-0
                            TX FIFO_0


                           TX FIFO_15
                   baud          clock     clock
      LSPCLK       rate         polarity   phase                      SPICLK
Technology beyond the Dreams™                    Copyright © 2006 Pantech Solutions Pvt
SPI Data Character Justification
 • Programmable data length of 1 to
   16 bits
                                        SPIDAT - Processor #1
 • Transmitted data of less than 16
   bits must be left justified              11001001XXXXXXXX
                                            11001001XXXXXXXX
    – MSB transmitted first

 • Received data of less than 16 bits
   are right justified

 • User software must mask-off                      SPIDAT - Processor #2
   unused MSB’s
                                           XXXXXXXX11001001
                                           XXXXXXXX11001001




Technology beyond the Dreams™                     Copyright © 2006 Pantech Solutions Pvt
SPI-A Registers
  Address      Register                Name
  0x007040     SPICCR           SPI-A configuration control register
  0x007041     SPICTL           SPI-A operation control register
  0x007042     SPISTS           SPI-A status register
  0x007044     SPIBRR           SPI-A baud rate register
  0x007046     SPIEMU           SPI-A emulation buffer register
  0x007047     SPIRXBUF         SPI-A serial receive buffer register
  0x007048     SPITXBUF         SPI-A serial transmit buffer register
  0x007049     SPIDAT           SPI-A serial data register
  0x00704A     SPIFFTX          SPI-A FIFO transmit register
  0x00704B     SPIFFRX          SPI-A FIFO receive register
  0x00704C     SPIFFCT          SPI-A FIFO control register
  0x00704F     SPIPRI           SPI-A priority control register
Technology beyond the Dreams™                 Copyright © 2006 Pantech Solutions Pvt
SPI-A Configuration Control Register
                           SPICCR @ 0x007040
      15-8         7       6            5-4        3            2          1          0
     reserved                        reserved


                                                              SPI CHAR.3-0
                                                 character length = number + 1
                                                 e.g. 0000b ⇒ length = 1
                                                      1111b ⇒ length = 16
                               CLOCK POLARITY
                                0 = rising edge data transfer
                                1 = falling edge data transfer

                       SPI SW RESET
                        0 = SPI flags reset
                        1 = normal operation

Technology beyond the Dreams™                          Copyright © 2006 Pantech Solutions Pvt
SPI-A Operation Control Register
                     SPICTL @ 0x007041
   OVERRUN INT ENABLE    MASTER/SLAVE
       0 = disabled          0 = slave                   SPI INT ENABLE
       1 = enabled           1 = master                     0 = disabled
                                                            1 = enabled


              15-5                 4      3      2         1          0
             reserved




                         CLOCK PHASE                         TALK
                     0 = no CLK delay                0 = transmission disabled,
                     1 = CLK delayed 1/2 cycle           output pin hi-Z’d
                                                     1 = transmission enabled

Technology beyond the Dreams™                    Copyright © 2006 Pantech Solutions Pvt
SPI-A Baud Rate Register
                           SPIBRR @ 0x007044
         Need to set this only when in master mode!
                  15-7                              6-0
                reserved                       SPI BIT RATE




                                 LSPCLK
                                               ,   SPIBRR = 3 to 127
                                (SPIBRR + 1)
      SPICLK signal =
                                  LSPCLK
                                               ,   SPIBRR = 0, 1, or 2
                                      4



Technology beyond the Dreams™                      Copyright © 2006 Pantech Solutions Pvt
SPI-A Status Register
              15-8
                    SPISTS @ 0x0070424-0
                        7   6   5
            reserved                                  reserved


                                           TX BUF FULL (read only)
                                           • Set to 1 when char written
                                             to SPITXBUF
                                           • Cleared when char in SPIDAT
                                    SPI INT FLAG (read only)
                                    • Set to 1 when transfer completed
                                    • Interrupt requested if SPI INT ENA
                                      bit set (SPICTL.0)
                                    • Cleared by reading SPIBRXUF
        RECEIVER OVERRUN (read/clear only)
        • Set to 1 if next reception completes before SPIRXBUF read
        • Interrupt requested if OVERRUN INT ENA bit set (SPICTL.4)
        • Cleared by writing a 1

Technology beyond the Dreams™                   Copyright © 2006 Pantech Solutions Pvt
SPI-A FIFO Transmit Register
                               SPIFFTX @ 0x00704A FIFO Status (read-only)
                                               TX
        SPI FIFO                                     00000       TX FIFO empty
                              TX FIFO Reset          00001       TX FIFO has 1 word
      Enhancements          0 = reset (pointer to 0) 00010
        0 = disable                                              TX FIFO has 2 words
                            1 = enable operation 00011       .   TX FIFO.has 3 words.
        1 = enable                                           .
                                                             .               .
                                                                             .              .
                                                                                            .
                                                    10000        TX FIFO has 16 words

              15       14      13     12      11      10      9       8
                            TXFIFO
           reserved SPIFFEN        TXFFST4 TXFFST3 TXFFST2 TXFFST1 TXFFST0
                            RESET

              7      6       5       4       3       2       1       0
                  TXFFINT
          TXFFINT         TXFFIEN TXFFIL4 TXFFIL3 TXFFIL2 TXFFIL1 TXFFIL0
                    CLR




       TX FIFO         TX FIFO           TX FIFO             TX FIFO Interrupt Level
       Interrupt       Interrupt         Interrupt
    Flag (read-only)   Flag Clear       (on match)           Interrupt when TXFFST4-0
    0 = not occurred   0 = no effect      Enable             and TXFFIL4-0 match
    1 = occurred       1 = clear         0 = disable
                                         1 = enable
Technology beyond the Dreams™                                    Copyright © 2006 Pantech Solutions Pvt
SPI-A FIFO Receive Register
                            SPIFFRX @ 0x00704B RX FIFO Status (read-only)
    RX FIFO       RX FIFO                         00000 RX FIFO empty
    Overflow      Overflow      RX FIFO Reset00001      RX FIFO has 1 word
 Flag (read-only) Flag Clear 0 = reset (pointer to00010
                                                   0)   RX FIFO has 2 words
  0 = no overflow   0 = no effect 1 = enable operation
                                                     00011    .   RX FIFO.has 3 words.
  1 = overflow      1 = clear                                 .
                                                              .            .
                                                                           .              .
                                                                                          .
                                                      10000       RX FIFO has 16 words


              15    14     13     12      11      10      9       8
            RXFF- RXFF- RXFIFO
                               RXFFST4 RXFFST3 RXFFST2 RXFFST1 RXFFST0
             OVF OVF CLR RESET

               7      6       5       4       3       2       1       0
                   RXFFINT
           RXFFINT         RXFFIEN RXFFIL4 RXFFIL3 RXFFIL2 RXFFIL1 RXFFIL0
                     CLR




       RX FIFO          RX FIFO          RX FIFO        RX FIFO Interrupt Level
       Interrupt        Interrupt        Interrupt
    Flag (read-only)    Flag Clear      (on match)       Interrupt when RXFFST4-0
     0 = not occurred   0 = no effect     Enable         and RXFFIL4-0 match
     1 = occurred       1 = clear       0 = disable
                                        1 = enable
Technology beyond the Dreams™                             Copyright © 2006 Pantech Solutions Pvt
SPI Summary
   • Provides synchronous serial communications
      – Two wire transmit or receive (half duplex)
      – Three wire transmit and receive (full duplex)

   • Software configurable as master or slave
      – C28x provides clock signal in master mode

   • Data length programmable from 1-16 bits

   • 125 different programmable baud rates




Technology beyond the Dreams™                           Copyright © 2006 Pantech Solutions Pvt
SPI Example 1: DAC TLV 5617
 • Texas Instruments Digital to Analogue Converter (DAC) TLV 5617A
    – 10 MBPS SPI Data Communication
    – Dual Channel Analogue Output ( Out A + B)
    – 10 Bit resolution
    – /CS is connected to C28x GPIO – D0 at the Zwickau Adapter Board
    – REF – Voltage defines Analogue Range / 2
    – SOIC-8
    – Operating Voltage : 0 to 3.3V




Technology beyond the Dreams™                      Copyright © 2006 Pantech Solutions Pvt
SPI Example : DAC TLV 5617
 • Timing Diagram:




            © Texas Instruments SLAS234F – JULY 1999 – REVISED JULY 2002 ; page 6




Technology beyond the Dreams™                                     Copyright © 2006 Pantech Solutions Pvt
SPI Example : DAC TLV 5617
  • Serial Data Format:
                   SPD                PWR
             Speed Control         Power Control
                 0 = slow mode       0 = normal operation
                 1 = fast mode       1 = power down


           15       14        13       12      11      10           9           8
          R1       SPD      PWR       R0     DATA9   DATA8      DATA7       DATA6

           7         6        5        4       3       2            1           0
         DATA5    DATA4     DATA3    DATA2   DATA1   DATA0          0          0


                         R1 , R0 Register Select
                   00: Write to DACB and Buffer
                   01: Write to Buffer
                   10: Write to DACA and update
                       DACB with Buffer
                   11: reserved

Technology beyond the Dreams™                               Copyright © 2006 Pantech Solutions Pvt
Lab 7: DAC TLV 5617
• Objective:
   – Generate a rising saw-tooth (0V…3.3V) at channel OUTA and a falling saw-
     tooth (3.3V…0V) at channel OUTB
   – GPIO – D0 is DAC’s chip select (/CS) at the Zwickau Adapter Board
   – To measure the DAC outputs:
       • Use JP7 for OUTA
       • Use JP8 for OUTB ( Zwickau Adapter Board)
   – REF = 3.3V
   – Feedback the voltages into the C28x ADC:
       • JP7 closed: OUTA  ADCINA1
       • JP8 closed: OUTB  ADCINB1




Technology beyond the Dreams™                        Copyright © 2006 Pantech Solutions Pvt
SPI Example 2: EEPROM M95080
 • ST Microelectronics EEPROM M95080
    – 10 MBPS SPI Data Communication
    – Capacity: 1024 x 8 Bit
    – /CS is connected to C28x GPIO – D5 (Zwickau Adapter Board)
    – 6 Instructions:
        • Write Enable, Write Disable
        • Read Status Register, Write Status Register
        • Read Data, Write Data
    – SOIC-8
    – Single Power Supply : 3.3V




Technology beyond the Dreams™                      Copyright © 2006 Pantech Solutions Pvt
SPI Example : EEPROM M95080
  • Timing Diagram:




            © ST Microelectronics Datasheet M95080 – November 2002, page 4




Technology beyond the Dreams™                                       Copyright © 2006 Pantech Solutions Pvt
SPI Example : EEPROM M95080
             
                     M95080 Status Register:
         7       6         5      4       3       2       1         0
      SRWD       0        0       0      BP1     BP0    WEL        WIP



                                 Block protect select
                                                                Write in progress
                        00 = no protection
                                                                    0 = no write cycle
                        01 = 0x300 – 0x3FF protected                1 = write in progress
                        10 = 0x200 – 0x3FF protected
                        11 = 0x000 – 0x3FF protected

                                                        Write Enable Latch
             Status Register Write Protect               0 = write disabled
              1 = no write access to SR                  1 = write enabled
              0 = normal operation
Technology beyond the Dreams™                           Copyright © 2006 Pantech Solutions Pvt
SPI Example : EEPROM M95080
              Instruction       Description        Code
                WREN            Write Enable    0000 0110

                 WRDI           Write Disable   0000 0100

                   E            Read Status     0000 0101
                                 Register
                WDSR            Write Status    0000 0001
                                 Register
                READ            Read Data       0000 0011

                WRITE            Write Data     0000 0010


      M95080 Instruction Sets
Technology beyond the Dreams™                   Copyright © 2006 Pantech Solutions Pvt
SPI Example : EEPROM M95080
 • Timing Diagram WREN:




                 © ST Microelectronics ; Datasheet (8028.pdf) – November 2002; Page 8




Technology beyond the Dreams™                                       Copyright © 2006 Pantech Solutions Pvt
SPI Example : EEPROM M95080

 • Timing Diagram RDSR:




                 © ST Microelectronics ; Datasheet (8028.pdf) – November 2002; Page 10




Technology beyond the Dreams™                                      Copyright © 2006 Pantech Solutions Pvt
SPI Example : EEPROM M95080
 • Timing Diagram READ:




           © ST Microelectronics ; Datasheet (8028.pdf) – November 2002; Page 13



Technology beyond the Dreams™                                          Copyright © 2006 Pantech Solutions Pvt
SPI Example : EEPROM M95080
 • Timing Diagram WRITE:




           © ST Microelectronics ; Datasheet (8028.pdf) – November 2002; Page 14



Technology beyond the Dreams™                                          Copyright © 2006 Pantech Solutions Pvt
Lab 7B: EEPROM M95080
 • Objective:
    – Based on hardware of Zwickau Adapter Board
    – Store the value of 8 input switches (GPIO – B15…B8) into EEPROM –
      Address 0x40 when command input button GPIO-D1 is pressed (low
      active).
    – Read EEPROM-Address 0x40 and show its content on 8 LED’s ( GPIO-B7…
      B0) when command input button GPIO-D6 is pressed (low active).
    – GPIO – D5 is EEPROM’s chip select (/CS) at the Zwickau Adapter Board




Technology beyond the Dreams™                     Copyright © 2006 Pantech Solutions Pvt

More Related Content

PDF
Microprocessor 8051
PPT
Digital Logic Circuits
DOCX
APPLICATIONS OF PLA - POLY (LACTIC ACID) IN TISSUE ENGINEERING AND DELIVERY S...
PPT
01 introduction et architecture (2011)
PPT
Poly lactic acid
PPT
Additives for plastic_ii+(3)
PPTX
Atomic transfer radical polymerisation
PPT
PAL And PLA ROM
Microprocessor 8051
Digital Logic Circuits
APPLICATIONS OF PLA - POLY (LACTIC ACID) IN TISSUE ENGINEERING AND DELIVERY S...
01 introduction et architecture (2011)
Poly lactic acid
Additives for plastic_ii+(3)
Atomic transfer radical polymerisation
PAL And PLA ROM

What's hot (7)

PDF
Quine Mc Clusky (Tabular) method
PPTX
ATOMIC TRANSFER RADICAL POLYMERIZATION
PPTX
Starch Based biopolymer
PPTX
PPT
Digital Logic & Design (DLD) presentation
PPT
Karnaugh maps
PPT
Presentation.ppt
Quine Mc Clusky (Tabular) method
ATOMIC TRANSFER RADICAL POLYMERIZATION
Starch Based biopolymer
Digital Logic & Design (DLD) presentation
Karnaugh maps
Presentation.ppt
Ad

Similar to Spi f28x (20)

PPTX
LPC2148 SPI (Serial Peripheral Interface).pptx
PPTX
SPI introduction(Serial Peripheral Interface)
PPTX
Serial Peripheral Interface
PPTX
Spi in arm7(lpc2148)
PDF
Serial Peripheral Interface
PPTX
Designing of fifo and serial peripheral interface protocol using Verilog HDL
PDF
SPI Protocol
PPT
Spi (1)
PDF
AREA OPTIMIZATION OF SPI MODULE USING VERILOG HDL
PPT
Serial Peripheral Interface(SPI)
PDF
International Journal of Computational Engineering Research(IJCER)
PPT
Master synchronous serial port (mssp)
PPTX
Serial Communication - Serial Peripheral Interface
PDF
SPI Protocol in LPC2148
PPTX
Serial Peripheral Interface (SPI).pptx
PDF
Serial Peripheral Interface Design for Advanced Microcontroller Bus Architect...
PPTX
Deepu Kumar Shah.pptx
PPTX
Serial peripheral Interface - Embedded System Protocol
PPT
8051 zigbee interface
LPC2148 SPI (Serial Peripheral Interface).pptx
SPI introduction(Serial Peripheral Interface)
Serial Peripheral Interface
Spi in arm7(lpc2148)
Serial Peripheral Interface
Designing of fifo and serial peripheral interface protocol using Verilog HDL
SPI Protocol
Spi (1)
AREA OPTIMIZATION OF SPI MODULE USING VERILOG HDL
Serial Peripheral Interface(SPI)
International Journal of Computational Engineering Research(IJCER)
Master synchronous serial port (mssp)
Serial Communication - Serial Peripheral Interface
SPI Protocol in LPC2148
Serial Peripheral Interface (SPI).pptx
Serial Peripheral Interface Design for Advanced Microcontroller Bus Architect...
Deepu Kumar Shah.pptx
Serial peripheral Interface - Embedded System Protocol
8051 zigbee interface
Ad

More from Pantech ProLabs India Pvt Ltd (20)

PDF
Registration process
PPTX
Choosing the right processor for embedded system design
PPT
Brain Computer Interface
PPTX
Electric Vehicle Design using Matlab
PPTX
Image processing application
PPTX
Internet of Things using Raspberry Pi
PPTX
Internet of Things Using Arduino
PPTX
Brain controlled robot
PPTX
Brain Computer Interface-Webinar
PPTX
Development of Deep Learning Architecture
PPTX
Gate driver design and inductance fabrication
PPTX
Brainsense -Brain computer Interface
PPT
Median filter Implementation using TMS320C6745
PPT
Introduction to Code Composer Studio 4
PPT
Waveform Generation Using TMS320C6745 DSP
PPT
Interfacing UART with tms320C6745
PPT
Switch & LED using TMS320C6745 DSP
PPT
Led blinking using TMS320C6745
PPT
Introduction to tms320c6745 dsp
Registration process
Choosing the right processor for embedded system design
Brain Computer Interface
Electric Vehicle Design using Matlab
Image processing application
Internet of Things using Raspberry Pi
Internet of Things Using Arduino
Brain controlled robot
Brain Computer Interface-Webinar
Development of Deep Learning Architecture
Gate driver design and inductance fabrication
Brainsense -Brain computer Interface
Median filter Implementation using TMS320C6745
Introduction to Code Composer Studio 4
Waveform Generation Using TMS320C6745 DSP
Interfacing UART with tms320C6745
Switch & LED using TMS320C6745 DSP
Led blinking using TMS320C6745
Introduction to tms320c6745 dsp

Recently uploaded (20)

PPTX
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
PDF
HVAC Specification 2024 according to central public works department
PDF
Trump Administration's workforce development strategy
PDF
What if we spent less time fighting change, and more time building what’s rig...
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PPTX
History, Philosophy and sociology of education (1).pptx
PDF
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
PDF
FORM 1 BIOLOGY MIND MAPS and their schemes
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
PPTX
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
Computing-Curriculum for Schools in Ghana
PDF
AI-driven educational solutions for real-life interventions in the Philippine...
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PDF
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PPTX
TNA_Presentation-1-Final(SAVE)) (1).pptx
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
Chinmaya Tiranga Azadi Quiz (Class 7-8 )
HVAC Specification 2024 according to central public works department
Trump Administration's workforce development strategy
What if we spent less time fighting change, and more time building what’s rig...
B.Sc. DS Unit 2 Software Engineering.pptx
History, Philosophy and sociology of education (1).pptx
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
FORM 1 BIOLOGY MIND MAPS and their schemes
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Computing-Curriculum for Schools in Ghana
AI-driven educational solutions for real-life interventions in the Philippine...
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Chinmaya Tiranga quiz Grand Finale.pdf
TNA_Presentation-1-Final(SAVE)) (1).pptx
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc

Spi f28x

  • 1. Chapter 7 : Serial Peripheral Interface C28x Digital Signal Controller TMS320F2812 Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 2. SPI Data Flow • Simultaneous transmits and receive • SPI Master provides the clock signal SPI Device #1 - Master SPI Device #2 - Slave shift shift SPI Shift Register SPI Shift Register SPI Shift Register SPI Shift Register clock Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 3. SPI Block Diagram C28x - SPI Master Mode Shown SPISIMO RX FIFO_0 RX FIFO_15 SPIRXBUF.15-0 MSB LSB SPIDAT.15-0 SPISOMI SPITXBUF.15-0 TX FIFO_0 TX FIFO_15 baud clock clock LSPCLK rate polarity phase SPICLK Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 4. SPI Data Character Justification • Programmable data length of 1 to 16 bits SPIDAT - Processor #1 • Transmitted data of less than 16 bits must be left justified 11001001XXXXXXXX 11001001XXXXXXXX – MSB transmitted first • Received data of less than 16 bits are right justified • User software must mask-off SPIDAT - Processor #2 unused MSB’s XXXXXXXX11001001 XXXXXXXX11001001 Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 5. SPI-A Registers Address Register Name 0x007040 SPICCR SPI-A configuration control register 0x007041 SPICTL SPI-A operation control register 0x007042 SPISTS SPI-A status register 0x007044 SPIBRR SPI-A baud rate register 0x007046 SPIEMU SPI-A emulation buffer register 0x007047 SPIRXBUF SPI-A serial receive buffer register 0x007048 SPITXBUF SPI-A serial transmit buffer register 0x007049 SPIDAT SPI-A serial data register 0x00704A SPIFFTX SPI-A FIFO transmit register 0x00704B SPIFFRX SPI-A FIFO receive register 0x00704C SPIFFCT SPI-A FIFO control register 0x00704F SPIPRI SPI-A priority control register Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 6. SPI-A Configuration Control Register SPICCR @ 0x007040 15-8 7 6 5-4 3 2 1 0 reserved reserved SPI CHAR.3-0 character length = number + 1 e.g. 0000b ⇒ length = 1 1111b ⇒ length = 16 CLOCK POLARITY 0 = rising edge data transfer 1 = falling edge data transfer SPI SW RESET 0 = SPI flags reset 1 = normal operation Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 7. SPI-A Operation Control Register SPICTL @ 0x007041 OVERRUN INT ENABLE MASTER/SLAVE 0 = disabled 0 = slave SPI INT ENABLE 1 = enabled 1 = master 0 = disabled 1 = enabled 15-5 4 3 2 1 0 reserved CLOCK PHASE TALK 0 = no CLK delay 0 = transmission disabled, 1 = CLK delayed 1/2 cycle output pin hi-Z’d 1 = transmission enabled Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 8. SPI-A Baud Rate Register SPIBRR @ 0x007044 Need to set this only when in master mode! 15-7 6-0 reserved SPI BIT RATE LSPCLK , SPIBRR = 3 to 127 (SPIBRR + 1) SPICLK signal = LSPCLK , SPIBRR = 0, 1, or 2 4 Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 9. SPI-A Status Register 15-8 SPISTS @ 0x0070424-0 7 6 5 reserved reserved TX BUF FULL (read only) • Set to 1 when char written to SPITXBUF • Cleared when char in SPIDAT SPI INT FLAG (read only) • Set to 1 when transfer completed • Interrupt requested if SPI INT ENA bit set (SPICTL.0) • Cleared by reading SPIBRXUF RECEIVER OVERRUN (read/clear only) • Set to 1 if next reception completes before SPIRXBUF read • Interrupt requested if OVERRUN INT ENA bit set (SPICTL.4) • Cleared by writing a 1 Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 10. SPI-A FIFO Transmit Register SPIFFTX @ 0x00704A FIFO Status (read-only) TX SPI FIFO 00000 TX FIFO empty TX FIFO Reset 00001 TX FIFO has 1 word Enhancements 0 = reset (pointer to 0) 00010 0 = disable TX FIFO has 2 words 1 = enable operation 00011 . TX FIFO.has 3 words. 1 = enable . . . . . . 10000 TX FIFO has 16 words 15 14 13 12 11 10 9 8 TXFIFO reserved SPIFFEN TXFFST4 TXFFST3 TXFFST2 TXFFST1 TXFFST0 RESET 7 6 5 4 3 2 1 0 TXFFINT TXFFINT TXFFIEN TXFFIL4 TXFFIL3 TXFFIL2 TXFFIL1 TXFFIL0 CLR TX FIFO TX FIFO TX FIFO TX FIFO Interrupt Level Interrupt Interrupt Interrupt Flag (read-only) Flag Clear (on match) Interrupt when TXFFST4-0 0 = not occurred 0 = no effect Enable and TXFFIL4-0 match 1 = occurred 1 = clear 0 = disable 1 = enable Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 11. SPI-A FIFO Receive Register SPIFFRX @ 0x00704B RX FIFO Status (read-only) RX FIFO RX FIFO 00000 RX FIFO empty Overflow Overflow RX FIFO Reset00001 RX FIFO has 1 word Flag (read-only) Flag Clear 0 = reset (pointer to00010 0) RX FIFO has 2 words 0 = no overflow 0 = no effect 1 = enable operation 00011 . RX FIFO.has 3 words. 1 = overflow 1 = clear . . . . . . 10000 RX FIFO has 16 words 15 14 13 12 11 10 9 8 RXFF- RXFF- RXFIFO RXFFST4 RXFFST3 RXFFST2 RXFFST1 RXFFST0 OVF OVF CLR RESET 7 6 5 4 3 2 1 0 RXFFINT RXFFINT RXFFIEN RXFFIL4 RXFFIL3 RXFFIL2 RXFFIL1 RXFFIL0 CLR RX FIFO RX FIFO RX FIFO RX FIFO Interrupt Level Interrupt Interrupt Interrupt Flag (read-only) Flag Clear (on match) Interrupt when RXFFST4-0 0 = not occurred 0 = no effect Enable and RXFFIL4-0 match 1 = occurred 1 = clear 0 = disable 1 = enable Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 12. SPI Summary • Provides synchronous serial communications – Two wire transmit or receive (half duplex) – Three wire transmit and receive (full duplex) • Software configurable as master or slave – C28x provides clock signal in master mode • Data length programmable from 1-16 bits • 125 different programmable baud rates Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 13. SPI Example 1: DAC TLV 5617 • Texas Instruments Digital to Analogue Converter (DAC) TLV 5617A – 10 MBPS SPI Data Communication – Dual Channel Analogue Output ( Out A + B) – 10 Bit resolution – /CS is connected to C28x GPIO – D0 at the Zwickau Adapter Board – REF – Voltage defines Analogue Range / 2 – SOIC-8 – Operating Voltage : 0 to 3.3V Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 14. SPI Example : DAC TLV 5617 • Timing Diagram: © Texas Instruments SLAS234F – JULY 1999 – REVISED JULY 2002 ; page 6 Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 15. SPI Example : DAC TLV 5617 • Serial Data Format: SPD PWR Speed Control Power Control 0 = slow mode 0 = normal operation 1 = fast mode 1 = power down 15 14 13 12 11 10 9 8 R1 SPD PWR R0 DATA9 DATA8 DATA7 DATA6 7 6 5 4 3 2 1 0 DATA5 DATA4 DATA3 DATA2 DATA1 DATA0 0 0 R1 , R0 Register Select 00: Write to DACB and Buffer 01: Write to Buffer 10: Write to DACA and update DACB with Buffer 11: reserved Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 16. Lab 7: DAC TLV 5617 • Objective: – Generate a rising saw-tooth (0V…3.3V) at channel OUTA and a falling saw- tooth (3.3V…0V) at channel OUTB – GPIO – D0 is DAC’s chip select (/CS) at the Zwickau Adapter Board – To measure the DAC outputs: • Use JP7 for OUTA • Use JP8 for OUTB ( Zwickau Adapter Board) – REF = 3.3V – Feedback the voltages into the C28x ADC: • JP7 closed: OUTA  ADCINA1 • JP8 closed: OUTB  ADCINB1 Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 17. SPI Example 2: EEPROM M95080 • ST Microelectronics EEPROM M95080 – 10 MBPS SPI Data Communication – Capacity: 1024 x 8 Bit – /CS is connected to C28x GPIO – D5 (Zwickau Adapter Board) – 6 Instructions: • Write Enable, Write Disable • Read Status Register, Write Status Register • Read Data, Write Data – SOIC-8 – Single Power Supply : 3.3V Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 18. SPI Example : EEPROM M95080 • Timing Diagram: © ST Microelectronics Datasheet M95080 – November 2002, page 4 Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 19. SPI Example : EEPROM M95080  M95080 Status Register: 7 6 5 4 3 2 1 0 SRWD 0 0 0 BP1 BP0 WEL WIP Block protect select Write in progress 00 = no protection 0 = no write cycle 01 = 0x300 – 0x3FF protected 1 = write in progress 10 = 0x200 – 0x3FF protected 11 = 0x000 – 0x3FF protected Write Enable Latch Status Register Write Protect 0 = write disabled 1 = no write access to SR 1 = write enabled 0 = normal operation Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 20. SPI Example : EEPROM M95080 Instruction Description Code WREN Write Enable 0000 0110 WRDI Write Disable 0000 0100 E Read Status 0000 0101 Register WDSR Write Status 0000 0001 Register READ Read Data 0000 0011 WRITE Write Data 0000 0010  M95080 Instruction Sets Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 21. SPI Example : EEPROM M95080 • Timing Diagram WREN: © ST Microelectronics ; Datasheet (8028.pdf) – November 2002; Page 8 Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 22. SPI Example : EEPROM M95080 • Timing Diagram RDSR: © ST Microelectronics ; Datasheet (8028.pdf) – November 2002; Page 10 Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 23. SPI Example : EEPROM M95080 • Timing Diagram READ: © ST Microelectronics ; Datasheet (8028.pdf) – November 2002; Page 13 Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 24. SPI Example : EEPROM M95080 • Timing Diagram WRITE: © ST Microelectronics ; Datasheet (8028.pdf) – November 2002; Page 14 Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt
  • 25. Lab 7B: EEPROM M95080 • Objective: – Based on hardware of Zwickau Adapter Board – Store the value of 8 input switches (GPIO – B15…B8) into EEPROM – Address 0x40 when command input button GPIO-D1 is pressed (low active). – Read EEPROM-Address 0x40 and show its content on 8 LED’s ( GPIO-B7… B0) when command input button GPIO-D6 is pressed (low active). – GPIO – D5 is EEPROM’s chip select (/CS) at the Zwickau Adapter Board Technology beyond the Dreams™ Copyright © 2006 Pantech Solutions Pvt