I want to use this schematic for sending PWM signals from an STM32F0 Arm microcontroller to an ATtiny85. I want to convert the PWM signal to a proper analog voltage, so that the ATtiny analogRead() function can detect a proper ADC value from 0-1023 and assert the voltage and perform a particular action based on the analog voltage detected. So,
IO1 in the schematic is directly connected to one of the STM32F0 PWM pins, and the
CONTROL pin in the schematic is directly connected to an analog pin of the ATtiny85.
NOTE: Both the STM32F0 and ATtiny85 are running on 3.3V supply, thus operating at 3.3V logic level.
- Is this a proper method to do PWM to analog voltage conversion?
- Is there any way to improve the output accuracy of the STM32 and the detection accuracy of the ATtiny85 in this circuit design?
- Are the resistor and capacitor values are good enough for this use case? And what specific SMD parts could be used for this application? Like the type of capacitor, the voltage and capacitance rating, resistor type and sizes etc.
There's a little bit of caveat that I forgot to mention. The STM32F0 controller in question has pre-flashed firmware which only allows me to pull-up or pull-down or generate a PWM signal through the IO pins available. If I hack into the firmware, apparently it voids the FCC and CE certifications and warranty of the product. So, the API is pretty limited.