SPRAD62 February 2023 F29H850TU , F29H859TU-Q1 , TMS320F280023C , TMS320F280025C , TMS320F280025C-Q1 , TMS320F280037C , TMS320F280037C-Q1 , TMS320F280038C-Q1 , TMS320F280039C , TMS320F280039C-Q1 , TMS320F28386D , TMS320F28386D-Q1 , TMS320F28386S , TMS320F28386S-Q1 , TMS320F28388D , TMS320F28388S , TMS320F28P650DH , TMS320F28P650DK , TMS320F28P650SH , TMS320F28P650SK , TMS320F28P659DH-Q1 , TMS320F28P659DK-Q1 , TMS320F28P659SH-Q1
This application report describes how to design a custom serial interface using the configurable logic block (CLB). A step-by-step methodology for designing a CLB-based serial port is given along with a description of common design challenges and potential solutions. Finally, two serial port design examples are given with full design details, simulation results, and hardware test results. The first example covers the design of a CLB-based serial port to send and receive data over a time-division multiplexing (TDM) bus commonly used in audio systems. The second example uses a CLB-based serial port to send data to an LED matrix display. All example code is included in the C2000ware software development kit (SDK).
C2000™ and Code Composer Studio™ are trademarks of Texas Instruments.
All trademarks are the property of their respective owners.
Serial interfaces are commonly used in many industrial and automotive applications. Standard serial interfaces available in today's microcontrollers can support access to a multitude of peripheral devices. However, in some cases, a custom serial interface may be required to support a unique serial protocol. The configurable logic block (CLB) included in C2000™ real-time microcontrollers can be programmed to emulate these custom serial interfaces.
In this application note, a step-by-step design methodology is presented to guide the designer in the design, simulation, and testing of a custom serial interface. Some common design challenges and potential solutions are presented throughout the application report. Finally, two examples are presented with full design details, simulation results, and hardware test results. The example code can be easily obtained from the C2000ware software development kit (SDK).
The following is a step-by-step guide to designing a custom serial interface using the CLB. The steps presented here walk the designer from start to finish during the CLB logic design. Solutions are presented to common design challenges and pitfalls.
This application report assumes the reader is already familiar with the architecture of the CLB and with Code Composer Studio (CCS) integrated development environment (IDE). Below is a list of training materials that can be used for a quick overview of the CLB and C2000 real-time microcontrollers:
It is important to keep in mind that the CLB type, number of CLB tiles, and crossbar (XBAR) logic differs between C2000 real-time microcontrollers. For detailed information on the CLB relating to a specific C2000 real-time microcontroller, see the device-specific TRM.
The key to any successful CLB logic design is having a clear understanding of the design requirements. In the case of a serial interface design, a thorough understanding the bus protocol will be required during the CLB logic design phase. This includes basic information such as number of signals, input and output configuration, and frame encoding requirements such as start, stop, parity, and checksum bits.
Second, the timing requirements of the bus interface must be clearly understood to determine the feasibility of implementing the design using the CLB. Special attention should be given to the serial bus operating speed, signal polarities, and required setup and hold times.
Lastly, any support signals that will be required to implement the serial bus interface must be identified. This can include, for example, an input clock signal generated by an on-chip PWM to clock data in and out of the CLB tile, or a periodic timer interrupt to trigger the transmission of a synchronization command on the serial bus.