AnsweredAssumed Answered

Clock Initialization in MC9S08PT60

Question asked by Raghavendra T R on Mar 30, 2015

Hello Sir,

 

Currently, we are using Tower System TWR-S08PT60. In the default mode of clock operation(bus clock is derived from Internal reference clock), we have following questions/issues

 

  1. Is it necessary to give a delay before any peripheral initialization,which is performed after reset? If so, Kindly let us know the procedure
  2. We are trying to toggle a GPIO Pin( PTG0) with a certain delay for both Ton and Toff

        In the following program, it is observed that duty cycle is increasing for increasing values of x with x>=1000.Kindly let us the know the reason

        void delay_ms(unsigned int x)

        {

            unsigned int i,j;

            for(i=0;i<x;i++)

              asm

              {

                      NOP;

             }

        }

 

         void main()

           {

               PORT_PTGOE_PTGOE0=1;           // configuring Port G0 as output

               while(1)

               {

                  PORT_PTGD_PTGD0=0;            //Turns on LED

                  delay_ms(1000);

                  PORT_PTGD_PTGD0=1;            //Turns off LED

                 delay_ms(1000);

               }

           }

 

 

 

       Thanks & Regards,

        Raghavendra T R

Outcomes