Detecting between '415 and '417 module types

Discussion to talk about software related topics only.
Post Reply
sblair
Posts: 162
Joined: Mon Sep 12, 2011 1:54 pm

Detecting between '415 and '417 module types

Post by sblair »

Ran into this recently where I needed to be able to detect between running on the single or dual interface module versions. Paul helpfully pointed me to the right register value to query the CPU ID so thought I'd share this here for others that might run into the same thing.

Code: Select all

//------------------- DEFINES ---------------------------------
#define CORE_MOD_MCF54410	0
#define CORE_MOD_MCF54415	1
#define CORE_MOD_MCF54416	2
#define CORE_MOD_MCF54417	3
#define CORE_MOD_MCF54418	4
#define CORE_MOD_MAX_INDEX 	CORE_MOD_MCF54418


//------------------- STRUCTS ---------------------------------

typedef struct
{
	short	CpuId;
	char	Name[10];

}s_CPUidList;

//------------------- GLOBAL VARS -----------------------------
unsigned short cpuID =0;


s_CPUidList sCPUidList[]=
{
	{ 0x09F,	"MCF54410"},
	{ 0x0A0,	"MCF54415"},
	{ 0x0A1,	"MCF54416"},
	{ 0x0A2,	"MCF54417"},
	{ 0x0A3,	"MCF54418"},

};


		/*** Identify Core Module Version ***/
		cpuID = sim1.ccm.cir >> 6;

		for(i=0; i < CORE_MOD_MAX_INDEX; i++)
		{
			if(sCPUidList[i].CpuId == cpuID)
			{
				iprintf("CPU MODULE: index[%d], CPUid: 0x%x, %s\n", i, sCPUidList[i].CpuId, sCPUidList[i].Name);
			}

		}

User avatar
TomNB
Posts: 541
Joined: Tue May 10, 2016 8:22 am

Re: Detecting between '415 and '417 module types

Post by TomNB »

Thank you. Have to look at making that an example
Post Reply