
/*
     Title:      test.c
     Author:     Aaron Staves <stavesa@msoe.edu>
     Date:       12/14/04
     Description:
         This program will create a square wave on port 0,
         alternating at intervals of a counter set to 0xFF


/*

     INCLUDES
          reg_c51.h  -  used for SFR definitions
*/

#include "reg_c51.h"


/*
       MAIN
*/
void main(void)
{

     unsigned int counter;     //counter variable

     //endless loop
     while(1)
     {
          counter = 0xFF;      //resetting counter
		  
          //for 0xFF counts...
          while(counter > 0)
          {
               P0 = 0xFF;      //setting pins on port 0 high
               counter -= 1;   //decrementing counter
          }

          counter = 0xFF;      //resetting counter

          //for 0xFF countes...
          while(counter > 0)
          {
                P0 = 0x00;     //setting pins on port 0 low
                counter -= 1;  //decrementing counter
          }
     }
}

//END


