Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/19/09 02:36
Read: times


 
#162561 - This works fine for what I need....hope it helps someone
Responding to: ???'s previous message
Toggles my 936 EXT1 pin


//
// Generates a number of pulses on EXT1 P1.4
//
signal void EXT1_Toggle (unsigned int pulses)  {
  float frequency;           // pulse frequency in Hz
   
  //frequency = 11;         // 11Hz
  //frequency = 22;         // 22Hz
  //frequency = 33;         // 33Hz
    frequency = 44;         // 44Hz
  //frequency = 55;         // 55Hz
  //frequency = 66;         // 66Hz
  //frequency = 77;         // 77Hz
  //frequency = 88;         // 88Hz
  //frequency = 99;         // 99Hz 

  while (pulses)  {
    PORT1 |=  (0x10);     // set   pin 1.4
    swatch (0.5 / frequency);	
    PORT1 &= ~(0x10);     // reset pin 1.4
    swatch (0.5 / frequency);	
	pulses--;
  }
}

EXT1_Toggle (30000);      // 100 Pulses at debugger startup

define button "EXT1 30000 Pulses", "EXT1_Toggle (30000)"

 



List of 7 messages in thread
TopicAuthorDate
Simulate External Oscillator in Keil?            01/01/70 00:00      
   A Signal Function?            01/01/70 00:00      
      That works, some issues            01/01/70 00:00      
         Signal functions are not 'C' functions!            01/01/70 00:00      
            that was my first train of thought....but            01/01/70 00:00      
               It doesn't work like that            01/01/70 00:00      
                  This works fine for what I need....hope it helps someone            01/01/70 00:00      

Back to Subject List