Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 4928

Pausing PWM, Pin goes High.

$
0
0
Hi everyone!
When I use this code the PWM seems to hover around 2.25 volts. I wanted to use this code to Pulse an IR LED but there is an issue. During the Time the PWM is turned off with the CS00 Prescaler, It seems to work sometimes then other times spike the voltage to the full load of around 5V.
Anyone experience this before?

Code (Text):
  1.  
  2.  
  3. int main(void)
  4. {
  5.     DDRB |= (1<<PB0); //Set pin PB0 as output
  6.     TCNT0 = 0;
  7.     TCCR0A=0;
  8.     TCCR0B=0;
  9.     TCCR0A |=(1<<COM0A0); //Timer0 in toggle...
Pausing PWM, Pin goes High.

Viewing all articles
Browse latest Browse all 4928

Trending Articles