Fast PWM problem

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi

I've written a program for Fast PWM 8-bit for mega8515. The simulator shows that after reaching the value 0xFF it doesnt become 0. It instead starts decrementing and acts like a Phase Correct PWM 8-bit.

#include 

void main()
{
  TCCR1A = 1<<WGM10 | 1<<COM1A1;
  TCCR1B = 1<<WGM12;

  TCCR1B |= 1<<CS10;

  OCR1A = 0x30;

  
  DDRD = 0xFF;
  

  while(1);
}

What am I doing wrong?

Aakash

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The simulator may not handle all timer modes correctly.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Okay. Thanks