![Texas Instruments TMS320C80 User Manual Download Page 35](http://html.mh-extra.com/html/texas-instruments/tms320c80/tms320c80_user-manual_1094755035.webp)
Obtaining Device-Specific Information
2-5
Programming for Compatibility
2.2.4 Counting the Number of PPs
Counting the number of PPs is essentially a process of checking
which device is executing a program and then using that informa-
tion to determine the number of PPs that are available on the pro-
cessor. For example, if the device check returns ’C80 as the de-
vice type, then the the software should return four as the number
of PPs.
Example 2–2 shows an MP C function that checks the MP’s
CONFIG register to determine which PPs are present on the ’C8x
device. The function returns an 8-bit mask in which each bit indi-
cates whether or not PP0–PP7 are present: bit 0 corresponds to
PP0, bit 1 corresponds to PP1, etc. When executed on a ’C80 de-
vice, the function returns the value 0Fh to indicate that PP0, PP1,
PP2, and PP3 are present. When executed on a ’C82 device, the
function returns the value 03h to indicate that PP0 and PP1 are
present.
Example 2–2.MP C Function for Counting the Number of PPs
#include <mvp.h>
/*
* Return a mask that specifies the PPs that are
* present on the ’C8x device. Bits 0 to 7 of the
* mask represent PPs 0 to 7. If a PP is present,
* the corresponding mask bit is set to 1.
*
* The software checks the device it is running on by
* checking the type field in the config register.
*/
int PpGetMask(void)
{
return((0xff03010f >> ((config & 0x3000) >> 9)) & 0xff);
}
Summary of Contents for TMS320C80
Page 2: ...SPRU154 Printed in U S A November 1995 M418017 9741 revision ...
Page 8: ...vi TMS320C80 to TMS320C82 Software Compatibility User s Guide ...
Page 16: ...xiv TMS320C80 to TMS320C82 Software Compatibility User s Guide ...
Page 30: ...1 14 TMS320C80 to TMS320C82 Software Compatibility User s Guide ...
Page 40: ...2 10 TMS320C80 to TMS320C82 Software Compatibility User s Guide ...
Page 64: ...A 6 TMS320C80 to TMS320C82 Software Compatibility User s Guide ...