8 - 8 - 1 Texas Instruments Incorporated European Customer Training Centre University of Applied Sciences Zwickau (FH) Module 8 : Serial Communication Interface C2 Module 8 : Serial Communication Interface C2 32-Bit-Digital Signal Controller TMS320F2812
22
Embed
8 - 1 Texas Instruments Incorporated European Customer Training Centre University of Applied Sciences Zwickau (FH) Module 8 : Serial Communication Interface.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
8 - 8 - 11
Texas Instruments Incorporated
European Customer Training Centre
University of Applied Sciences Zwickau (FH)
Module 8 : Serial Communication Interface C28xModule 8 : Serial Communication Interface C28x
32-Bit-Digital Signal ControllerTMS320F2812
8 - 8 - 22
SPI SummarySPI Summary
Provides Provides synchronoussynchronous serial communications serial communications Two wire transmit or receive (Two wire transmit or receive (half duplexhalf duplex)) Three wire transmit and receive (Three wire transmit and receive (full full duplex)duplex)
Software configurable as master or slaveSoftware configurable as master or slave C28x provides clock signal in master modeC28x provides clock signal in master mode
Data length programmable from 1-16 bitsData length programmable from 1-16 bits 125 different programmable baud rates125 different programmable baud rates
8 - 8 - 33
SPI Example 1: DAC TLV 5617SPI Example 1: DAC TLV 5617
Texas Instruments Digital to Analogue Texas Instruments Digital to Analogue Converter (DAC) TLV 5617AConverter (DAC) TLV 5617A 10 10 MBPSMBPS SPI Data Communication SPI Data Communication Dual Channel Analogue Output ( Out A + B) Dual Channel Analogue Output ( Out A + B) 10 Bit resolution10 Bit resolution /CS is connected to C28x GPIO – D0 at the /CS is connected to C28x GPIO – D0 at the
Zwickau Adapter BoardZwickau Adapter Board REF – Voltage defines Analogue Range / 2 REF – Voltage defines Analogue Range / 2 SOIC-8SOIC-8 Operating Voltage : 0 to 3.3VOperating Voltage : 0 to 3.3V
8 - 8 - 44
SPI Example : DAC TLV 5617SPI Example : DAC TLV 5617
SPI Example : DAC TLV 5617SPI Example : DAC TLV 5617
Serial Data Format:Serial Data Format:
0
DATA0
SPD DATA6DATA9
DATA3
1234567
89101112131415
00DATA2 DATA1
DATA7
DATA4
DATA8
DATA5
R0PWRR1
SPDSpeed Control
0 = slow mode1 = fast mode
PWRPower Control
0 = normal operation1 = power down
R1 , R0 Register Select00: Write to DACB and Buffer01: Write to Buffer10: Write to DACA and update
DACB with Buffer 11: reserved
8 - 8 - 66
Lab 7: DAC TLV 5617Lab 7: DAC TLV 5617
Objective:Objective: Generate a rising saw-tooth (0V…3.3V) at Generate a rising saw-tooth (0V…3.3V) at
channel OUTA and a falling saw-tooth (3.3V…channel OUTA and a falling saw-tooth (3.3V…0V)0V) at channel OUTBat channel OUTB
GPIO – D0 is DAC’s chip select (/CS) at the GPIO – D0 is DAC’s chip select (/CS) at the Zwickau Adapter BoardZwickau Adapter Board
To measure the DAC outputs:To measure the DAC outputs: Use JP7 for OUTA Use JP7 for OUTA Use JP8 for OUTB ( Zwickau Adapter Board)Use JP8 for OUTB ( Zwickau Adapter Board)
REF = 3.3VREF = 3.3V Feedback the voltages into the C28x ADC:Feedback the voltages into the C28x ADC:
SPI Example 2: SPI Example 2: EEPROMEEPROM M95080 M95080
ST Microelectronics EEPROM M95080ST Microelectronics EEPROM M95080 10 MBPS SPI Data Communication 10 MBPS SPI Data Communication CapacityCapacity: 1024 x 8 Bit : 1024 x 8 Bit /CS is connected to C28x GPIO – D5 (Zwickau /CS is connected to C28x GPIO – D5 (Zwickau
Write Enable, Write DisableWrite Enable, Write Disable Read Status Register, Write Status RegisterRead Status Register, Write Status Register Read Data, Write Data Read Data, Write Data
SOIC-8SOIC-8 Single Power Supply : 3.3VSingle Power Supply : 3.3V
8 - 8 - 88
SCI Pin Connections SCI Pin Connections
Transmitter-databuffer register
Transmittershift register
SCI Device #1
SCIRXD
SCITXD SCITXD
SCIRXD
SCI Device #2
8
Receiver-databuffer register
Receivershift register
8
Transmitter-databuffer register
Transmittershift register
8
Receiver-databuffer register
Receivershift register
8
(Full Duplex Shown)
RX FIFO_0
RX FIFO_15
RX FIFO_0
RX FIFO_15
TX FIFO_0
TX FIFO_15
TX FIFO_0
TX FIFO_15
8 - 8 - 99
SCI-A Programmable Data FormatSCI-A Programmable Data Format
Allows numerous processors to be hooked up to Allows numerous processors to be hooked up to the bus, but transmission occurs between only the bus, but transmission occurs between only two of themtwo of them
Idle-line or Address-bit modesIdle-line or Address-bit modes Sequence of OperationSequence of Operation
1. Potential receivers set SLEEP = 1, which disables RXINT except 1. Potential receivers set SLEEP = 1, which disables RXINT except when an address frame is receivedwhen an address frame is received
2. All transmissions begin with an address frame2. All transmissions begin with an address frame
3. Incoming address frame temporarily wakes up all SCIs on bus3. Incoming address frame temporarily wakes up all SCIs on bus
4. CPUs compare incoming SCI address to their SCI address4. CPUs compare incoming SCI address to their SCI address
5. Process following data frames only if address matches5. Process following data frames only if address matches
8 - 8 - 1111
Address-Bit Wake-Up ModeAddress-Bit Wake-Up Mode
All frames contain an extra address bitAll frames contain an extra address bit Receiver wakes up when address bit detectedReceiver wakes up when address bit detected Automatic setting of Addr/Data bit in frame by setting Automatic setting of Addr/Data bit in frame by setting
TXWAKE = 1 prior to writing address to SCITXBUFTXWAKE = 1 prior to writing address to SCITXBUF
Last Data STST DataSCIRXD/SCITXD
Block of Frames
SP SP Last DataST Addr SP
Idle Periodlength of nosignificance
First frame withinblock is Address.
ADDR/DATAbit set to 1
1st data frame
0 1 0 0 SPST Addr 1SP
no additionalidle bits neededbeyond stop bits
8 - 8 - 1212
SCI SummarySCI Summary
Asynchronous communications formatAsynchronous communications format 65,000+ different programmable baud rates65,000+ different programmable baud rates Two wake-up multiprocessor modesTwo wake-up multiprocessor modes
Programmable data word formatProgrammable data word format 1 to 8 bit data word length1 to 8 bit data word length 1 or 2 stop bits1 or 2 stop bits even/odd/no parityeven/odd/no parity
FIFO-buffered transmit and receiveFIFO-buffered transmit and receive Individual interrupts for transmit and receiveIndividual interrupts for transmit and receive
8 - 8 - 1313
SCI-A RegistersSCI-A RegistersAddress Register Name
0x007050 SCICCR SCI-A commun. control register0x007051 SCICTL1 SCI-A control register 10x007052 SCIHBAUD SCI-A baud register, high byte0x007053 SCILBAUD SCI-A baud register, low byte0x007054 SCICTL2 SCI-A control register 2 register0x007055 SCIRXST SCI-A receive status register0x007056 SCIRXEMU SCI-A receive emulation data buffer0x007057 SCIRXBUF SCI-A receive data buffer register0x007059 SCITXBUF SCI-A transmit data buffer register0x00705A SCIFFTX SCI-A FIFO transmit register0x00705B SCIFFRX SCI-A FIFO receive register0x00705C SCIFFCT SCI-A FIFO control register0x00705F SCIPRI SCI-A priority control register
8 - 8 - 1414
SCI-A Communication Control RegisterSCI-A Communication Control Register
ADDR/IDLEMODE
STOPBITS
EVEN/ODDPARITY
PARITYENABLE
LOOP BACKENABLE
SCICHAR2
SCICHAR1
SCICHAR0
Communications Control Register (SCICCR) – 0x007050
0 = 1 Stop bit1 = 2 Stop bits
0 = Odd1 = Even
0 = Disabled1 = Enabled
0 = Disabled1 = Enabled
0 = Idle-line mode1 = Addr-bit mode
7 6 5 4 3 2 1 0
# of data bits = (binary + 1)e.g. 110b gives 7 data bits
[SCI-B Communications Control Register (SCICCR) – 0x007750]
Auto BauddetectionFlag Clear0 = no effect1 = clear
reserved
8 - 8 - 2222
SCI Example 1: transmit a text - stringSCI Example 1: transmit a text - string
Lab 8: Basic SCI Communication
Send a string from DSP to a PC’s COM-port. Connect the RS232 - Connector of the Zwickau adapter board
with a standard DB9 - cable ( 1:1 ) to a serial port of the PC (COM1or COM2).
DSP shall transmit a string from the DSP to the PC periodically. No SCI interrupt services in this lab After transmission of the first character we just poll the
transmission ready flag (TXEMPTY) before loading the next character into the transmit buffer - and wait again.
The Windows-Hyper Terminal program is used as the counterpart from the PC’s-side and must be initialized properly for correct function(Baud rate, Parity, no protocol).