Author Topic: 100kHz frequency PWM from Arduino  (Read 1864 times)

0 Members and 1 Guest are viewing this topic.

Offline radhikaTopic starter

  • Regular Contributor
  • *
  • Posts: 105
  • Country: in
100kHz frequency PWM from Arduino
« on: September 08, 2018, 12:15:18 pm »
Hello,
I am working on project and I need 100kHz from the Arduino. I have tried building code but I am not getting anything when I checked in proteus..
Here is the code,


void setup()
{
  pinMode (5, OUTPUT);
  pinMode(6, OUTPUT);
  TCCR0A = 0;
  TCCR0B = 0;
  TCCR0A = 0b01010011;
  TCCR0B = 0b00001010;//WGM02= 1(Pin 5 is disconnected)
  OCR0A = 9; //Control value of 100kHz, N = 8
}

void loop()
{
  analogWrite(6, 206)// 81% duty cycle;
}

I am using Proteus for checking output. As shown in the attached picture I an unable to get output at pin 6. Guide me for the circuit if I have attached to the wrong pin and the code.
PS: Apologies for the late reply.
https://postimg.cc/image/g84qnrsrr/
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf