ABSTRACTThis application report contains complete code examples for routines that have beendeveloped using a TMS320C54xE EVM platform. These programs demonstrate applicationsthat use a host interface and run in real time.Contents1 Running the Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Application Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3List of TablesTable 1. Target Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Table 2. Communication Interface Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4List of ExamplesExample 1. Vector Table Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4Example 2. Memory Allocation for Entire Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7Example 3. Main Program That Calls Different Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Example 4. Processor Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18Example 5. Handshake Between Host and Target . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20Example 6. Initialization of Variables, Pointers, and Buffers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23Example 7. Initialization of SerialPort 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27Example 8. ’AC01 Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31Example 9. ’AC01 Register Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35Example 10. Receive Interrupt Service Routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38Example 11. Task Scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42Example 12. Echo the Input Signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47Example 13. Low-Pass FIR Filtering Using MAC Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49Example 14. Low-Pass Symmetric FIR Filtering Using FIRS Instruction . . . . . . . . . . . . . . . . . . . . . . . . 54Example 15. Low-Pass Biquad IIR Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58Example 16. Adaptive Filtering Using LMS Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63Example 17. 256-Point Real FFT Initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71Example 18. Bit Reversal Routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74Example 19. 256-Point Real FFT Routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77Example 20. Unpack 256-Point Real FFT Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82Example 21. Compute the Power Spectrum of the Complex Output of the 256-Point Real FFT . . . . 87TMS320C54x is a trademark of Texas Instruments.SPRA6732 TMS320C54x Application Code ExamplesExample 22. Data Transfer ransfer from FIFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89Example 23. Interrupt 1 Service Routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93Example 24. Function Calls on Host Side . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97Example 25. Main Function Call on Host Side . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98Example 26. Graphic Drivers Routine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100Example 27. Display the Data on the Screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102Example 28. Linker Command File for the Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102Example 29. Memory Map of TMS320C541 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104……