Accessing the Chip Temp sample diagram

This section gets you started using Embed by stepping you through the Chip Temp on F28069 diagram. This diagram measures the temperature in centigrade of a Texas Instruments Piccolo F28069 device. The ADC channel 5 is redirected from an external pin to the on-chip temperature sensor. The compound block Turn On Ch 5 Temp Conversion performs the redirection.

To access the chip temperature model

1.    Click Examples > Embedded > Piccolo > ADC.

2.    Select Chip Temp on F28069.

The following diagram appears:

MeasureChipTempexamplefig1

3.    Right-click Chip Temperature on F28069 to move down one level of hierarchy.

MeasureChipTempexamplefig2

The above diagram reads ADC channel 5 and applies an offset and gain to convert the reading to degrees centigrade. It also executes the code contained in Turn on Ch 5 Temp Conversion, which switches ADC 5 from an external pin to the internal temperature sensor. Note that Turn on Ch 5 Temp Conversion is triggered by the built-in variable $firstPass. This means that the block and its contents are executed once at boot time.

4.    Right-click Turn on Ch 5 Temp Conversion to move down one level of hierarchy.

MeasureChipTempexamplefig3

The above diagram enables the internal temperature sensor on ADC A5. The Extern Read (*(int*)0x3D7E82L) and Extern Write (*(int*)0x3D7E85L) blocks write directly to the hardware registers. To enforce the order of execution, Embed executes parallel flows in top-down order. The ePWM block sends Start of Conversion pulses to the ADC A5.

This code also enables the ePWM block to send Start of Conversion pulses to the ACD A5.

MeasureChipTempexamplefig4