Few questions related STM32 (blue pill), 16bit com LCD, USB type C. - Page 1
Forum section: electronics / general

author: 3dgeo
author_rank: Frequent Contributor
timestamp: March 17, 2019, 08:14:18 pm
content: Hello,I want to build my own STM32F103C8T6 (blue pill MCU) breakout board, I've copiedthis schematic, but I want to use other oscillators, will there be any issues if I usetheseortheseas 8Mhz andtheseas a 32.768K?Also – there are 4* 0.1 uF caps (I assume each should be close to each VVC in pin of STM32 IC, bus is it really necessary to use 4? In blue pill they aren't close to VCC pins, and I'm not planing to drive something heavy with MCU (logic levels only).Will there by any issues drivingthis LCD(16 bit parallel com) with STM32? I assume regular I/O MCU pins is fine for this?I'm not familiar with 16/8 bit parallel communication, this will be a learning experience, so please share if there is anything I should know now.My goal is to show moving gifs on LCD and hope to achieve at least 20FPS, is it even possible with this configuration?Last one – I'm using USB type-C port, is it OK to bridge D1+ to D2+ and D1- to D2- on the PCB? I assume those lines should be bridged in cable itself if it goes to regular type-A plug on the other end, but in my cheap cable from Ali they aren't, so that cable works only plugged at one way.Thank You in advance.

author: krho
author_rank: Regular Contributor
timestamp: March 18, 2019, 05:39:33 am
content: Quote from: 3dgeo on March 17, 2019, 08:14:18 pmYou must bridge them on your PCB

author: lucazader
author_rank: Regular Contributor
timestamp: March 18, 2019, 06:27:44 pm
content: Yea bridging the two DP and the two DM connections will work.Also make sure to put a pull down resistor of 5.1kohm on one of the CC lines.It should work fine without this if you use a normal USB-A to USB-C cable, however if the board is used with a USB-C to USB-C cable the host might fail to detect a device is plugged in.For the vcc caps, youll probably find the board will work fine in most cases if these arent close to the pins, but it will ensure more stable operation if they are present and close to the vcc pins.Also when changing the crystals, they may have different load capacitance from the original design, so you might need to change the loading capacitors.

author: Rickta59
author_rank: Newbie
timestamp: March 18, 2019, 07:39:18 pm
content: Quote from: 3dgeo on March 17, 2019, 08:14:18 pmThat schematic has the wrong value for the USB pull up value. It should be 1k5 and it should be pulled up to 3v3 not the 5v.site:st.com

author: MT
author_rank: Super Contributor
timestamp: March 18, 2019, 08:27:17 pm
content: Quote from: 3dgeo on March 17, 2019, 08:14:18 pmI would not use F103 as learning platform because ST changed the GPIO access mux and other things in every other devices. I would use F3xx .

author: 3dgeo
author_rank: Frequent Contributor
timestamp: March 19, 2019, 08:36:02 pm
content: Quote from: krho on March 18, 2019, 05:39:33 amGood to clear this out, thank You.Quote from: Rickta59 on March 18, 2019, 07:39:18 pmYes, I knew about wrong value, tho thanks for reminding. But I'm not sure about pulling it up to 3.3V instead of 5V – MCUs USB data pins are 5V tolerant and if I pull it to 3.3V all 3.3V rail will get 5V when USB host will provide 5V to that line and I don't think 3v3 rail will like that...Quote from: lucazader on March 18, 2019, 06:27:44 pmTo my knowledge right value is 1.5K. What comes to caps – on next PCB revision I'll add pads for 4 caps and try with and without them tho I don't think it will make any different.What comes to crystals – their capacitance is 20pf (same as originals), tho 8MHz one will have frequency tolerance ±10ppm instead of ±20ppm.Quote from: MT on March 18, 2019, 08:27:17 pmI'm going with F103 due to Arduino IDE support and its cheap price (1USD).

author: Rickta59
author_rank: Newbie
timestamp: March 20, 2019, 12:50:34 am
content: Quote from: 3dgeo on March 19, 2019, 08:36:02 pmSee Speed Identification the image shows pulling up to 3v3https://www.beyondlogic.org/usbnutshell/usb2.shtmlPage 120 shows pull-up going to 3v3http://sdphca.ucsd.edu/lab_equip_manuals/usb_20.pdf

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 20, 2019, 02:57:19 pm
content: Quote from: krho on March 18, 2019, 05:39:33 amYes. Note that given they are mirrored and the tight space, routing them bridged is not always trivial if you don't want to screw up the differential signaling. Probably doesn't matter much for full-speed only, but for high-speed, this is something to be careful about.Another thing to consider is correctly configuring CC1 and CC2 pins if you want to be really USB-C compliant, as this configures the role of the USB connection. For an USB device, put 5k1 pull-down resistors on both.

author: 3dgeo
author_rank: Frequent Contributor
timestamp: March 20, 2019, 03:09:37 pm
content: Quote from: SiliconWizard on March 20, 2019, 02:57:19 pmI can maintain equal trace length even if I bridge USB data pins, thats not a problem. I don't need to be USB-C compliant, I just want to use type C connector and I don't have 5K1 resistors in my BOM, so if I can't use 10K I have to discard them, tho I will make place for them on a PCB, so thanks for that.Rickta59 – I still don't think it's a good idea to pull up to 3.3v, can anyone else confirm or deny this?

author: lucazader
author_rank: Regular Contributor
timestamp: March 20, 2019, 06:58:05 pm
content: Also consider using a USB 2.0 type-c connector. Usually these have 16 pins in total rather than the full 24.They keep the USB 2.0, CC, SBU, VBUS and GND pins. but drop the SS lines.They are usually much easier to route and solder by hand if needed.I have started using them in products as they are much easier to work with and usually very cheap.Something like this i found on taobao.https://item.taobao.com/item.htm?id=560766008671&ali_refid=a3_430008_1006:1109877118:N:type-c%E5%85%AC%E5%A4%B4:402af3b4d684efe1e9e348e06adaa341&ali_trackid=1_402af3b4d684efe1e9e348e06adaa341&spm=a230r.1.0.0The 6 pin ones you also might find, likely wont be suitable, they only seem to have VBUS, GND and the CC lines, so are only really for chargers etc.

author: 3dgeo
author_rank: Frequent Contributor
timestamp: March 21, 2019, 12:43:53 am
content: Quote from: lucazader on March 20, 2019, 06:58:05 pmYes, I'm already using these connectors.

author: agehall
author_rank: Frequent Contributor
timestamp: March 21, 2019, 06:48:09 am
content: Quote from: 3dgeo on March 19, 2019, 08:36:02 pmThis is the worst reason you could possibly have. The words I would use to describe that IDE are not words I like to use in public due to the graphic nature. I would highly suggest that you look into using something like Visual Studio Code with PlatformIO instead. As far as I can tell, there is 0 downside to this setup (you can still use libraries for Arduino if you insist).

author: 3dgeo
author_rank: Frequent Contributor
timestamp: March 21, 2019, 02:47:34 pm
content: Quote from: agehall on March 21, 2019, 06:48:09 amNo one is asking you to describeDespite a fact that you missed the point of what I meant your comment is out of topic anyway.

author: Rickta59
author_rank: Newbie
timestamp: March 21, 2019, 04:19:59 pm
content: Quote from: 3dgeo on March 20, 2019, 03:09:37 pmAll I know is that I looked at this a while back and someone complained about their Bluepill not enumerating. When they replaced the 4k7 resistor with a 1k5 and it still didn't work, he traced the pull up to 5v. I suggested they pull it up to 3v3. After he did that it started working.http://www.stm32duino.com/viewtopic.php?f=28&t=117&p=7053#p7059I would think ST Microelectronics knows what they are doing. The STLINK devices use an STM32F103CB, here is a snapshot of the schematic where they use a 1k5 pull up to 3V3.

author: eliocor
author_rank: Unknown
timestamp: March 21, 2019, 10:50:23 pm
content: for schematic suggestions, take a look to the Maple Mini board:https://wiki.stm32duino.com/index.php?title=Maple_Miniit is very similar to a blue pill: but I mostly prefer the Maple Mini one!

author: 3dgeo
author_rank: Frequent Contributor
timestamp: March 22, 2019, 01:40:13 am
content: Quote from: Rickta59 on March 21, 2019, 04:19:59 pmOK, I'll trust you, 3v3 it isThanks.Quote from: eliocor on March 21, 2019, 10:50:23 pmThanks, USB part doesn't seems to be simplerTho I only see one crystal (8MHz), would be nice if I could skip 32K crystal as well, do you know what it is used for? Also I prefer simpler boot0 part, I really need to work on that part and redesign it to be more convenient for volume manufacturing...Another thing – can I use SWDIO (PA13) and SWCLK (PA14) as a regular inputs (they work just fine as inputs)? As I understand those pins used for programing via proprietary hardware? I'm planing to make a special TX/RX programing header, so I'm not going to use that port. I have 3 more I/O pins, but for easier PCB routing and 5v tolerance I would like to use those pins.

author: lucazader
author_rank: Regular Contributor
timestamp: March 22, 2019, 02:33:07 am
content: The 32khz crystal is used for the rtc. So mainly for sleep modes etc.The F103 does have a 40khz internal RC oscillator to run the RTC when no external crystal is present. However it is pretty inaccurate from when i have used it.For SWDIO and SWDCLK, yes you can use them as general IO pins. just like any other pin. But they dont seem to have any peripherals (like uart or spi) mux'ed to them.one thing to keep in mind. If you use them as an IO in your program, then you will likely be un-able to debug your program using a hardware debugger(eg st-link), and it can often be harder to connect a hardware debugger to load a program to flash.When designing a PCB i usually make a debug header with the SWD, SWCK, SWO pins as well as a debug uart. but that just what i like to have when developing and debugging code.

author: 3dgeo
author_rank: Frequent Contributor
timestamp: March 22, 2019, 07:09:29 am
content: Quote from: lucazader on March 22, 2019, 02:33:07 amAt this point I don't see why I would need to debug using hardware, even if I will – I can use those pins, I just exclude them from the code.What comes to RTC crystal – this MCU task will be to calculate animation and drive RGB LED, sleep mode will not be used so I can skip 32K crystal?

author: profdc9
author_rank: Frequent Contributor
timestamp: March 23, 2019, 04:38:42 am
content: I have bluepill-like boards for STM32F1 and STM32F4 I made in Kicadhttps://github.com/profdc9/STM32althttps://github.com/profdc9/STM32F4ThruPillYou could look at those and perhaps use them as a starting point to develop your own board. They can be easily assembled using readily available through-hole components except for the processor.

author: 3dgeo
author_rank: Frequent Contributor
timestamp: March 23, 2019, 03:32:29 pm
content: Quote from: profdc9 on March 23, 2019, 04:38:42 amThank you for sharing your design, I'll take a look, tho I will be using only SMD parts.