Query about QD4 TIMER

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Query about QD4 TIMER

2,455 Views
Deepak1
Contributor IV

Hi to all,
In my application I am using MC9S08QD4.When i refered the data sheet the vector number for TPM1 is 7 & for TPM2 is 10.
But when i refered MC9S08QD4.h file in that there is no defination for TPM1.But TPMSC ,TPM2SC is defined.
And in the data sheet or in MC9S08QD4.h file there is no Vector number is given for TPMSC.
Wheather TPMSC is having same vector number as TPM1SC ?

Labels (1)
0 Kudos
Reply
4 Replies

1,217 Views
J2MEJediMaster
Specialist I

What version of CodeWarrior are you using, and have you selected the correct processor derivative? I just downloaded the MC9S08QD4 datasheet from the Freescale site. Then I built a new CodeWarrior project choosing that derivative.

 

The datasheet says that there are several vectors for TPM1 and TPM2. These are defined in the header file MC9S08QD4.h as follows: for TPM1 there is channel 0, (vector number 5 in the header file), TPM1 channel 1 (vector number 6, header file) and TPM1 Overflow (vector number 7). For TPM2, the vector numbers are: TPM2 channel 0, (vector number 8 in the header file), TPM2 channel 1 (vector number 9) and TPM1 Overflow (vector number 10).

 

---Tom

0 Kudos
Reply

1,217 Views
Deepak1
Contributor IV

Dear Sir,

Thanks for Reply.

I am using the correct derivative file.Here i have attached the derivative file also the ver. file details which i am using.

In the derivative file there is no defination for TPM1.But TPM1 channels are defined.

 

mc9s08qd4.h

Installed Plugins.TXT

 

Message Edited by t.dowe on 2009-08-31 11:04 AM
0 Kudos
Reply

1,217 Views
bigmac
Specialist III

Hello,

 

Unfortunately, the register naming inconsistency is in the datasheet for this device, and the header file matches the naming used within the datasheet (which is as it should be).  So apart from the vector names which use the TPM1 designation, when referring to the various registers associated with the first TPM module, you will need to use the TPM designation within your code.

 

If your code must be portable between different HCS08 devices, a workaround might be to create an additional header file containing macros to rename the TPM registers, to specifically suit the QD4 device.  For example:

 

#define TPM1SC  TPMSC

 

and similarly for all other TPM1 registers.

 

Regards,

Mac 

0 Kudos
Reply

1,217 Views
bigmac
Specialist III

Hello,

 

I believe that the problem being alluded is an inconsistency in the register naming within the header file and the datasheet memory map , and a vector naming mismatch. Rather than referring to the two TPM modules as TPM1 and TPM2, as for other devices, the designations TPM and TPM2 are used within both documents.

 

Therefore the vector names that refer to TPM1 actually apply to the module designated as "TPM".

 

Regards,

Mac

Message Edited by bigmac on 2009-08-22 01:20 PM
0 Kudos
Reply