replace stm08 with arduino (PWM)

over and over again, stupid questions from a beginner :slight_smile: :slight_smile: :slight_smile:

because of an error, the mpu power supply that I used was damaged, and I intend to replace it with Arduino Pro Mini 16MHz.
the power supply that i use is using stm08 MPU and mp2307 as voltage regulator which works at 340khz frequency (according to what i read on the datasheet).

my question is:

# does mp2307 really use 340khz frequency?
# if yes, can atmega 328 be able to issue such a large frequency?
# because according to my knowledge as a beginner, Is not that atmega 328 only issued a maximum frequency of 62khz?

I have tried to make a circuit using Arduino Pro Mini as a substitute for STM08, removing all components in the red box, input PWM connected from the green point but the output voltage looks unstable, down and up erratically, because I believe the frequency for the mp3207 drive does not match the frequency produced by Arduino.

the code that I made to generate pwm using arduino

void setup()
{
TCCR0B = TCCR0B & B11111000 | B00000010;// for PWM frequency of 62500.00 Hz
pinMode(5, OUTPUT);
}
 
void loop()
{
 analogWrite(5,88); 
}

THANK YOU

MP2307.pdf (697 KB)

does mp2307 really use 340khz frequency?

Yes

if yes, can atmega 328 be able to issue such a large frequency?

Yes. Change the pre scaler value in the timer you want to use.

I have tried to make a circuit using Arduino Pro Mini as a substitute for STM08,

Bad idea, switched mode power supplies are complex systems and are not very suitable for emulating with a CPU. It is hard enough to get the layout correct with a dedicated chip without making it more complex than it need be.

I really appreciate your attention, now i am looking for information about building 340khz frequency.

THANK YOU