Connecting to USB while powering with battery: STM32F103C8 Blue Pill
Posted: Thu Oct 06, 2022 12:13 am
I have an STM32F103C8 Blue Pill board of which I am using every pin (so I have no pins to write to an SD card). I want the board to store some data from the ADC in RAM while being powered by NiMH battery (three or four cells in series). I then want to connect the board to my PC to retrieve the data from RAM over serial. My problem is how to power the board without causing a problem.
I was originally going to use a buck converter to take the voltage from the battery and give 3.3 V on the 3.3 V pin but I've heard that the ADC won't appreciate the oscillations coming from the buck converter so I think that maybe I should connect the battery to the 5 V pin instead, utilising the onboard 3.3 V regulator. A fully charged set of four NiMH in series have 5.8 V and I don't suppose my computer will appreciate it when I connect to upload my data. Conversely, I don't think the cells will like it if there are only three of them and they're connected to 5 V.
I think that the red area in the below image is the 5 V that comes from the USB. Perhaps I should break the track and bridge it through a diode? I couldn't find anyone discussing how they dealt with this problem on the forum.

I was originally going to use a buck converter to take the voltage from the battery and give 3.3 V on the 3.3 V pin but I've heard that the ADC won't appreciate the oscillations coming from the buck converter so I think that maybe I should connect the battery to the 5 V pin instead, utilising the onboard 3.3 V regulator. A fully charged set of four NiMH in series have 5.8 V and I don't suppose my computer will appreciate it when I connect to upload my data. Conversely, I don't think the cells will like it if there are only three of them and they're connected to 5 V.
I think that the red area in the below image is the 5 V that comes from the USB. Perhaps I should break the track and bridge it through a diode? I couldn't find anyone discussing how they dealt with this problem on the forum.
