SlideShare ist ein Scribd-Unternehmen logo
1 von 25
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

Weitere ähnliche Inhalte

Was ist angesagt?

Iain Richardson: An Introduction to Video Compression
Iain Richardson: An Introduction to Video CompressionIain Richardson: An Introduction to Video Compression
Iain Richardson: An Introduction to Video CompressionIain Richardson
 
Full Custom IC Design Implementation of Priority Encoder
Full Custom IC Design Implementation of Priority EncoderFull Custom IC Design Implementation of Priority Encoder
Full Custom IC Design Implementation of Priority EncoderBhargavKatkam
 
Final esd lab manual (1)
Final esd lab manual (1)Final esd lab manual (1)
Final esd lab manual (1)Deepak Jena
 
8086 architecture and pin description
8086 architecture and pin description 8086 architecture and pin description
8086 architecture and pin description Aswini Dharmaraj
 
Turing Machine
Turing MachineTuring Machine
Turing MachineRajendran
 
Microprocessor 8086-lab-mannual
Microprocessor 8086-lab-mannualMicroprocessor 8086-lab-mannual
Microprocessor 8086-lab-mannualyeshwant gadave
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086Akhila Rahul
 
Full custom digital ic design of priority encoder
Full custom digital ic design of priority encoderFull custom digital ic design of priority encoder
Full custom digital ic design of priority encoderVishesh Thakur
 
Introduction to arm architecture
Introduction to arm architectureIntroduction to arm architecture
Introduction to arm architectureZakaria Gomaa
 
System verilog assertions
System verilog assertionsSystem verilog assertions
System verilog assertionsHARINATH REDDY
 
digital electronics Design of 101 sequence detector without overlapping for...
digital  electronics Design of 101 sequence detector without  overlapping for...digital  electronics Design of 101 sequence detector without  overlapping for...
digital electronics Design of 101 sequence detector without overlapping for...sanjay kumar pediredla
 
History of microprocessors
History of microprocessorsHistory of microprocessors
History of microprocessorsEmrah Aptoula
 
UNIT-II CPLD & FPGA Architectures and Applications
UNIT-II CPLD & FPGA  Architectures   and ApplicationsUNIT-II CPLD & FPGA  Architectures   and Applications
UNIT-II CPLD & FPGA Architectures and ApplicationsDr.YNM
 
Presentation on 8086 Microprocessor
Presentation  on   8086 MicroprocessorPresentation  on   8086 Microprocessor
Presentation on 8086 MicroprocessorNahian Ahmed
 

Was ist angesagt? (20)

stack in assembally language
stack in assembally languagestack in assembally language
stack in assembally language
 
Iain Richardson: An Introduction to Video Compression
Iain Richardson: An Introduction to Video CompressionIain Richardson: An Introduction to Video Compression
Iain Richardson: An Introduction to Video Compression
 
RISC-V Introduction
RISC-V IntroductionRISC-V Introduction
RISC-V Introduction
 
Full Custom IC Design Implementation of Priority Encoder
Full Custom IC Design Implementation of Priority EncoderFull Custom IC Design Implementation of Priority Encoder
Full Custom IC Design Implementation of Priority Encoder
 
Final esd lab manual (1)
Final esd lab manual (1)Final esd lab manual (1)
Final esd lab manual (1)
 
8086 architecture and pin description
8086 architecture and pin description 8086 architecture and pin description
8086 architecture and pin description
 
ALU
ALUALU
ALU
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Microprocessor 8086-lab-mannual
Microprocessor 8086-lab-mannualMicroprocessor 8086-lab-mannual
Microprocessor 8086-lab-mannual
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
Full custom digital ic design of priority encoder
Full custom digital ic design of priority encoderFull custom digital ic design of priority encoder
Full custom digital ic design of priority encoder
 
Introduction to arm architecture
Introduction to arm architectureIntroduction to arm architecture
Introduction to arm architecture
 
4 bit add sub
4 bit add sub4 bit add sub
4 bit add sub
 
System verilog assertions
System verilog assertionsSystem verilog assertions
System verilog assertions
 
digital electronics Design of 101 sequence detector without overlapping for...
digital  electronics Design of 101 sequence detector without  overlapping for...digital  electronics Design of 101 sequence detector without  overlapping for...
digital electronics Design of 101 sequence detector without overlapping for...
 
History of microprocessors
History of microprocessorsHistory of microprocessors
History of microprocessors
 
UNIT-II CPLD & FPGA Architectures and Applications
UNIT-II CPLD & FPGA  Architectures   and ApplicationsUNIT-II CPLD & FPGA  Architectures   and Applications
UNIT-II CPLD & FPGA Architectures and Applications
 
8 bit alu design
8 bit alu design8 bit alu design
8 bit alu design
 
8086 microprocessor lab manual
8086 microprocessor lab manual8086 microprocessor lab manual
8086 microprocessor lab manual
 
Presentation on 8086 Microprocessor
Presentation  on   8086 MicroprocessorPresentation  on   8086 Microprocessor
Presentation on 8086 Microprocessor
 

Ähnlich wie Spi f28x (20)

SCI F28x
SCI F28xSCI F28x
SCI F28x
 
Interrupt system f28x
Interrupt system f28xInterrupt system f28x
Interrupt system f28x
 
Dsp interrupciones
Dsp interrupcionesDsp interrupciones
Dsp interrupciones
 
8051
80518051
8051
 
Architecture of 8051
Architecture of 8051Architecture of 8051
Architecture of 8051
 
Live B tech Projects & Industrial Training @Technogroovy
Live B tech Projects & Industrial Training @Technogroovy Live B tech Projects & Industrial Training @Technogroovy
Live B tech Projects & Industrial Training @Technogroovy
 
Serial Peripheral Interface
Serial Peripheral InterfaceSerial Peripheral Interface
Serial Peripheral Interface
 
SOC Peripheral Components & SOC Tools
SOC Peripheral Components & SOC ToolsSOC Peripheral Components & SOC Tools
SOC Peripheral Components & SOC Tools
 
8051 microprocessor
8051 microprocessor8051 microprocessor
8051 microprocessor
 
SPI introduction(Serial Peripheral Interface)
SPI introduction(Serial Peripheral Interface)SPI introduction(Serial Peripheral Interface)
SPI introduction(Serial Peripheral Interface)
 
8085 paper-presentation-1232646931472979-2
8085 paper-presentation-1232646931472979-28085 paper-presentation-1232646931472979-2
8085 paper-presentation-1232646931472979-2
 
8085 MICROPROCESSOR
8085 MICROPROCESSOR 8085 MICROPROCESSOR
8085 MICROPROCESSOR
 
At89 s8252
At89 s8252At89 s8252
At89 s8252
 
At89s51
At89s51At89s51
At89s51
 
At mega16 summary
At mega16 summaryAt mega16 summary
At mega16 summary
 
Spi in arm7(lpc2148)
Spi in arm7(lpc2148)Spi in arm7(lpc2148)
Spi in arm7(lpc2148)
 
At 89s51
At 89s51At 89s51
At 89s51
 
SPI Protocol in LPC2148
SPI  Protocol in LPC2148SPI  Protocol in LPC2148
SPI Protocol in LPC2148
 
Flash Programming F28x
Flash Programming F28xFlash Programming F28x
Flash Programming F28x
 
Uart 16550
Uart 16550Uart 16550
Uart 16550
 

Mehr von Pantech ProLabs India Pvt Ltd

Choosing the right processor for embedded system design
Choosing the right processor for embedded system designChoosing the right processor for embedded system design
Choosing the right processor for embedded system designPantech ProLabs India Pvt Ltd
 

Mehr von Pantech ProLabs India Pvt Ltd (20)

Registration process
Registration processRegistration process
Registration process
 
Choosing the right processor for embedded system design
Choosing the right processor for embedded system designChoosing the right processor for embedded system design
Choosing the right processor for embedded system design
 
Brain Computer Interface
Brain Computer InterfaceBrain Computer Interface
Brain Computer Interface
 
Electric Vehicle Design using Matlab
Electric Vehicle Design using MatlabElectric Vehicle Design using Matlab
Electric Vehicle Design using Matlab
 
Image processing application
Image processing applicationImage processing application
Image processing application
 
Internet of Things using Raspberry Pi
Internet of Things using Raspberry PiInternet of Things using Raspberry Pi
Internet of Things using Raspberry Pi
 
Internet of Things Using Arduino
Internet of Things Using ArduinoInternet of Things Using Arduino
Internet of Things Using Arduino
 
Brain controlled robot
Brain controlled robotBrain controlled robot
Brain controlled robot
 
Brain Computer Interface-Webinar
Brain Computer Interface-WebinarBrain Computer Interface-Webinar
Brain Computer Interface-Webinar
 
Development of Deep Learning Architecture
Development of Deep Learning ArchitectureDevelopment of Deep Learning Architecture
Development of Deep Learning Architecture
 
Future of AI
Future of AIFuture of AI
Future of AI
 
Gate driver design and inductance fabrication
Gate driver design and inductance fabricationGate driver design and inductance fabrication
Gate driver design and inductance fabrication
 
Brainsense -Brain computer Interface
Brainsense -Brain computer InterfaceBrainsense -Brain computer Interface
Brainsense -Brain computer Interface
 
Median filter Implementation using TMS320C6745
Median filter Implementation using TMS320C6745Median filter Implementation using TMS320C6745
Median filter Implementation using TMS320C6745
 
Introduction to Code Composer Studio 4
Introduction to Code Composer Studio 4Introduction to Code Composer Studio 4
Introduction to Code Composer Studio 4
 
Waveform Generation Using TMS320C6745 DSP
Waveform Generation Using TMS320C6745 DSPWaveform Generation Using TMS320C6745 DSP
Waveform Generation Using TMS320C6745 DSP
 
Interfacing UART with tms320C6745
Interfacing UART with tms320C6745Interfacing UART with tms320C6745
Interfacing UART with tms320C6745
 
Switch & LED using TMS320C6745 DSP
Switch & LED using TMS320C6745 DSPSwitch & LED using TMS320C6745 DSP
Switch & LED using TMS320C6745 DSP
 
Led blinking using TMS320C6745
Led blinking using TMS320C6745Led blinking using TMS320C6745
Led blinking using TMS320C6745
 
Introduction to tms320c6745 dsp
Introduction to tms320c6745 dspIntroduction to tms320c6745 dsp
Introduction to tms320c6745 dsp
 

Kürzlich hochgeladen

How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 

Kürzlich hochgeladen (20)

How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 

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