EasyManuals Logo

Texas Instruments TMS320F2837 D Series Workshop Guide And Lab Manual

Texas Instruments TMS320F2837 D Series
324 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #280 background imageLoading...
Page #280 background image
Lab 11: Inter-Processor Communications
11 - 10 TMS320F2837xD Microcontroller Workshop - Dual-Core Inter-Processor Communications
Adc.c
F2837xD_Headers_nonBIOS_cpu1.cmd
CodeStartBranch.asm
Gpio.c
Dac.c
Lab_11_cpu1.cmd
DefaultIsr_11_cpu1.c
Main_11_cpu1.c
DelayUs.asm
PieCtrl.c
EPwm_11.c
PieVect.c
F2837xD_Adc.c
SysCtrl.c
F2837xD_GlobalVariableDefs.c
Watchdog.c
The files used in the CPU2 project are:
CodeStartBranch.asm
Main_11_cpu2.c
DefaultIsr_11_cpu2.c
PieCtrl.c
F2837xD_GlobalVariableDefs.c
PieVect.c
F2837xD_Headers_nonBIOS_cpu1.cmd
SineTable.c
Lab_11_cpu2.cmd
Watchdog.c
Inspect the Project – CPU1
2. Click on the project name Lab11_cpu01 in the Project Explorer window to set the project
active. Then click on the plus sign (+) to the left of Lab11_cpu01 to expand the file list.
3. Open and inspect Main_11_cpu1.c. Notice the synchronization handshake code using
IPC17 during initialization:
//--- Wait here until CPU02 is ready
while (IpcRegs.IPCSTS.bit.IPC17 == 0) ; // Wait for CPU02 to set IPC17
IpcRegs.IPCACK.bit.IPC17 = 1; // Acknowledge and clear IPC17
CPU1 will start first and then wait until CPU2 releases it from the while() loop. This only
needs to be done once. In effect, CPU1 is waiting until CPU2 is ready to accept IPC
interrupts, thereby making sure that the CPUs are ready for messaging through the IPC.
4. Open and inspect DefaultIsr_11_cpu1.c. This file contains two interrupt service
routines – one (ADCA1_ISR) at PIE1.1 reads the ADC results which is sent over IPC1 to
CPU2, and the other (IPC0_ISR) at PIE1.13 reads the incoming sine table point for the DAC
which is sent over IPC0 from CPU2. Additionally, ADCA1_ISR toggles the LaunchPad LED
D9 at 1 Hz as a visual indication that it is running.
In ADCA1_ISR() the ADC result value being sent to CPU2 is written via the IPCSENDDATA
register. In IPC0_ISR() the incoming data from CPU2 for the DAC is read via the
IPCRECVADDR register. These registers are part of the IPC module and provide an easy way
to transmit single data words between CPUs without using memory.
Inspect the Project – CPU2
5. Click on the project name Lab11_cpu02 in the Project Explorer window to set the project
active. Then click on the plus sign (+) to the left of Lab11_cpu02 to expand the file list.
6. Open and inspect Main_11_cpu2.c. Notice the synchronization handshake code used to
release CPU1 from its while() loop:
//--- Let CPU1 know that CPU2 is ready
IpcRegs.IPCSET.bit.IPC17 = 1; // Set IPC17 to release CPU1
7. Open and inspect DefaultIsr_11_cpu2.c. This file contains a single interrupt service
routine – (IPC1_ISR) at PIE1.14 reads the incoming ADC results which is sent over IPC1
from CPU1, and writes the next sine table point for the DAC which is sent over IPC0 to
CPU1. Additionally, IPC1_ISR toggles the LaunchPad LED D10 at 5 Hz as a visual
indication that it is running.

Table of Contents

Other manuals for Texas Instruments TMS320F2837 D Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TMS320F2837 D Series and is the answer not in the manual?

Texas Instruments TMS320F2837 D Series Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS320F2837 D Series
CategoryMicrocontrollers
LanguageEnglish

Related product manuals