sheetanshkaushik

TIMERS AND PROCESSOR EXPERT

Discussion created by sheetanshkaushik on Dec 13, 2012
Latest reply on Dec 17, 2012 by sheetanshkaushik

HI!

 

I am using MC9S08AW60A with DEMO9S08AW60E Board. I have studied about the timers given with the MCU. I wish to know how exactly to Implement timers by code as i have tried using PROCESSOR EXPERT but no effect. I have uploaded a pic of the PE settings that i had implemented. I have also uploaded the pdf of the chip and the Board.

 

The idea of the code is to sequentially blink the LED's without using a "Delay Function", rather by modifying the TIMER functionality.

 

the code is as follows( very basic, works if i use a delay function):

------------CODE BEGINS------------

PTFDD = 0xFF;

 

for (i=1;i<=8;i++)

  {

    if (i==8) i = 1;      

    if (i==1) PTFD = 0x01;   

    if (i==2) PTFD = 0x02;   

    if (i==3) PTFD = 0x04;   

    if (i==4) PTFD = 0x08;   

    if (i==5) PTFD = 0x10;   

    if (i==6) PTFD = 0x20;   

    if (i==7) PTFD = 0x40;

  }

----------CODE ENDS-----------------

 

for the sake of clarity, in the PE1 pic, the black dots mean 1 and white dots mean 0. And yes, i am using virtual PC. before this the codes i tried to excecute, worked perfectly fine.

 

Concurrently, According to the architecture, the TPM are on PORTF pins, as are the LED's does this affect the outocme. I guess No, but i just want to confirm. Does it?

then, if i have initialized with PE, does it mean i should also mannually code the same??

 

Thanks in advance!

 

 

 

 

 

 

 

 

 

 

Outcomes