Page 1 of 1

Custom STM32F103C8 SD Card Datalogger and USB Port

Posted: Thu Mar 19, 2020 3:29 pm
by jenspogo
Hey everybody,

i would like to design my own STM32F103 Board. There should be an micro SD Card reader on it and also an easy way to programm the board with USB.
For the SD Card It seems to be a really straight forward design if you use SPI and the 3.3V Level of the STM32. Is it that easy?! just connect to the SPI pins and then use the STM32SD lib from github in the Arduino IDE? (https://github.com/stm32duino/STM32SD)

I'm a little bit confused about the USB Port - is Vbus from the PC or does it has to be from the board? I do know need the power from the USB Port - just data.
And are there any recommended values for USB resistors?

greetings, Jens
SDCard an USB.PNG
SDCard an USB.PNG (28.14 KiB) Viewed 15407 times

Re: Custom STM32F103C8 SD Card Datalogger and USB Port

Posted: Thu Mar 19, 2020 4:38 pm
by fpiSTM
jenspogo wrote: Thu Mar 19, 2020 3:29 pm For the SD Card It seems to be a really straight forward design if you use SPI and the 3.3V Level of the STM32. Is it that easy?! just connect to the SPI pins and then use the STM32SD lib from github in the Arduino IDE? (https://github.com/stm32duino/STM32SD)
If you use SPI then you have to use the SD Arduino library. STM32SD is for SD card slot connected to SDIO or SDMMC peripherals of the STM32.

Re: Custom STM32F103C8 SD Card Datalogger and USB Port

Posted: Fri Mar 20, 2020 8:57 am
by stevestrong
You could eventually consider this F4 MCU board instead of bluepill, it is already equipped with SD card slot.
https://www.aliexpress.com/item/4000094075769.html
And the MCU is faster. ;)

Re: Custom STM32F103C8 SD Card Datalogger and USB Port

Posted: Fri Mar 20, 2020 1:07 pm
by jenspogo
Hey :) Thanks for your reply!

Do you also have any ideas about the USB question?

Re: Custom STM32F103C8 SD Card Datalogger and USB Port

Posted: Fri Mar 20, 2020 2:02 pm
by stevestrong
The STM chips have built-in USB ROM botloaders, also see viewtopic.php?p=1638#p1638.

Re: Custom STM32F103C8 SD Card Datalogger and USB Port

Posted: Sat Mar 21, 2020 11:37 am
by jenspogo
ok, that's good to know!
But what about the Layout? USB has a 5V Level and the STM is at 3.3V. So i do not knwo how to design the PCB of the USB connection correctly. Any ideas or examples?
greetings, Jens

EDIT: Ok, i was just to stupid to google. Found something!
https://www.mikrocontroller.net/wikifil ... 32_USB.png