Use PWM out with an 10 k ohm/4.7uF RC LPF on the output of the PWM pin to convert the arduino PWM to true analog which the LTC6992 requires in order to output PWM up to 1 Mhz.
OP is asking for PWM IC only because he could not get the desired output with arduino pwm, despite saying he tried all options, which apparently there are options he did not try yet.
I don't think the code you posted in Reply#8 is going to be much help to the OP, being as it doesn't compile. If you are going to post code for newbies it make more sense to post working code and not "snippets" of code that are not going to compile and probably just frustrate the OP. I would suggest
posting an actual working , sketch that will compile. If the OP knew how to use what you posted, he would wouldn't be posting because as you yourself pointed out, the reason he was posting is that he doesn't know how to write the code your "snippet" (that doesn't compile) represents.
Ok , I tried but I must have missed something. It still doesn't compile.
void setup() {
// put your setup code here, to run once:
DDRB |= _BV(PE1);
PORTE &= ~(_BV(PE1);
TCCR1A=TCCR1B=0;
TCCR1A |= _BV(WGM11) | _BV(COM1A1);
TCCR1B |= _BV(WGM33) | _BV(CS31);
ICR1=200;
OCR1A=0; //set this to duty cycle
}
void loop() {
// put your main code here, to run repeatedly:
}
I changed the DDRE to DDRB. (is that right ?)
I found this sketch online:
I got it from a Youtube video. It does 10 kHz PWM.
#include <PWM.h>
int32_t frequency = 10000; // frequency (in Hz)
int sensorValue =0;
void setup()
{
// put your setup code here, to run once:
InitTimersSafe();
bool success = SetPinFrequencySafe(9, frequency);
if(success) {
pinMode(13,OUTPUT);
digitalWrite(13,HIGH);
}
}
void loop()
{
// put your main code here, to run repeatedly:
int sensorValue = analogRead(A0);
pwmWrite(9,sensorValue/4);
delay(30);
}
Oh, yeah, he used direct port manipulation. You can just lose the DDRx and PORTx lines, and call pinMode() on the pin to make it output. I see those and know what they do at a glance.
Use PWM out with an 10 k ohm/4.7uF RC LPF on the output of the PWM pin to convert the arduino PWM to true analog which the LTC6992 requires in order to output PWM up to 1 Mhz.