Author Topic: Few questions related STM32 (blue pill), 16bit com LCD, USB type C.  (Read 1911 times)

0 Members and 1 Guest are viewing this topic.

Offline 3dgeo

  • Regular Contributor
  • *
  • Posts: 214
  • Country: au
Hello,

I want to build my own STM32F103C8T6 (blue pill MCU) breakout board, I've copied this schematic , but I want to use other oscillators, will there be any issues if I use these or these as 8Mhz and these as 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 driving this 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.
 

Offline krho

  • Regular Contributor
  • *
  • Posts: 213
  • Country: si
Re: Few questions related STM32 (blue pill), 16bit com LCD, USB type C.
« Reply #1 on: March 18, 2019, 05:39:33 am »
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.

You must bridge them on your PCB
 

Offline lucazader

  • Regular Contributor
  • *
  • Posts: 135
  • Country: nz
Re: Few questions related STM32 (blue pill), 16bit com LCD, USB type C.
« Reply #2 on: March 18, 2019, 06:27:44 pm »
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.
 

Offline Rickta59

  • Newbie
  • Posts: 4
Re: Few questions related STM32 (blue pill), 16bit com LCD, USB type C.
« Reply #3 on: March 18, 2019, 07:39:18 pm »

I want to build my own STM32F103C8T6 (blue pill MCU) breakout board, I've copied this schematic ,

That 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
 

Offline MT

  • Super Contributor
  • ***
  • Posts: 1275
  • Country: cn
Re: Few questions related STM32 (blue pill), 16bit com LCD, USB type C.
« Reply #4 on: March 18, 2019, 08:27:17 pm »
Hello,
I want to build my own STM32F103C8T6 (blue pill MCU) breakout board, I've copied this schematic , but I want to use other oscillators, will there be any issues if I use these or these as 8Mhz and these as 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 driving this 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.

I 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 .
 

Offline 3dgeo

  • Regular Contributor
  • *
  • Posts: 214
  • Country: au
Re: Few questions related STM32 (blue pill), 16bit com LCD, USB type C.
« Reply #5 on: March 19, 2019, 08:36:02 pm »
You must bridge them on your PCB

Good to clear this out, thank You.

That 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

Yes, 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...


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.

To 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.

I 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 .

I'm going with F103 due to Arduino IDE support and its cheap price (1USD).
 

Offline Rickta59

  • Newbie
  • Posts: 4
Re: Few questions related STM32 (blue pill), 16bit com LCD, USB type C.
« Reply #6 on: March 20, 2019, 12:50:34 am »
That 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

Yes, I knew about wrong value, tho thanks for reminding. But I'm not sure about pulling it up to 3.3V instead of 5V ...

See Speed Identification the image shows pulling up to 3v3
https://www.beyondlogic.org/usbnutshell/usb2.shtml

Page 120 shows pull-up going to 3v3
http://sdphca.ucsd.edu/lab_equip_manuals/usb_20.pdf
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 4225
  • Country: fr
Re: Few questions related STM32 (blue pill), 16bit com LCD, USB type C.
« Reply #7 on: March 20, 2019, 02:57:19 pm »
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.

You must bridge them on your PCB

Yes. 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.

 

Offline 3dgeo

  • Regular Contributor
  • *
  • Posts: 214
  • Country: au
Re: Few questions related STM32 (blue pill), 16bit com LCD, USB type C.
« Reply #8 on: March 20, 2019, 03:09:37 pm »
Yes. 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.

I 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?
 

Offline lucazader

  • Regular Contributor
  • *
  • Posts: 135
  • Country: nz
Re: Few questions related STM32 (blue pill), 16bit com LCD, USB type C.
« Reply #9 on: March 20, 2019, 06:58:05 pm »
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.0

The 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.
 

Offline 3dgeo

  • Regular Contributor
  • *
  • Posts: 214
  • Country: au
Re: Few questions related STM32 (blue pill), 16bit com LCD, USB type C.
« Reply #10 on: March 21, 2019, 12:43:53 am »
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.0

The 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.

Yes, I'm already using these connectors.
 

Offline agehall

  • Frequent Contributor
  • **
  • Posts: 258
  • Country: se
Re: Few questions related STM32 (blue pill), 16bit com LCD, USB type C.
« Reply #11 on: March 21, 2019, 06:48:09 am »
I'm going with F103 due to Arduino IDE support and its cheap price (1USD).

This 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).
 

Offline 3dgeo

  • Regular Contributor
  • *
  • Posts: 214
  • Country: au
Re: Few questions related STM32 (blue pill), 16bit com LCD, USB type C.
« Reply #12 on: March 21, 2019, 02:47:34 pm »
This 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).

No one is asking you to describe  ;) Despite a fact that you missed the point of what I meant your comment is out of topic anyway.
 

Offline Rickta59

  • Newbie
  • Posts: 4
Re: Few questions related STM32 (blue pill), 16bit com LCD, USB type C.
« Reply #13 on: March 21, 2019, 04:19:59 pm »
Rickta59 – I still don't think it's a good idea to pull up to 3.3v, can anyone else confirm or deny this?
All 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#p7059

I 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.
« Last Edit: March 21, 2019, 04:31:22 pm by Rickta59 »
 
The following users thanked this post: 3dgeo

Offline eliocor

  • Supporter
  • ****
  • Posts: 391
  • Country: it
    • rhodiatoce
Re: Few questions related STM32 (blue pill), 16bit com LCD, USB type C.
« Reply #14 on: March 21, 2019, 10:50:23 pm »
for schematic suggestions, take a look to the Maple Mini board:
https://wiki.stm32duino.com/index.php?title=Maple_Mini
it is very similar to a blue pill: but I mostly prefer the Maple Mini one!
 
The following users thanked this post: 3dgeo

Offline 3dgeo

  • Regular Contributor
  • *
  • Posts: 214
  • Country: au
Re: Few questions related STM32 (blue pill), 16bit com LCD, USB type C.
« Reply #15 on: March 22, 2019, 01:40:13 am »
I 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.

OK, I'll trust you, 3v3 it is  ;D Thanks.


for schematic suggestions, take a look to the Maple Mini board:
https://wiki.stm32duino.com/index.php?title=Maple_Mini
it is very similar to a blue pill: but I mostly prefer the Maple Mini one!

Thanks, USB part doesn't seems to be simpler  ??? Tho 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.
 

Offline lucazader

  • Regular Contributor
  • *
  • Posts: 135
  • Country: nz
Re: Few questions related STM32 (blue pill), 16bit com LCD, USB type C.
« Reply #16 on: March 22, 2019, 02:33:07 am »
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.
 
The following users thanked this post: 3dgeo

Offline 3dgeo

  • Regular Contributor
  • *
  • Posts: 214
  • Country: au
Re: Few questions related STM32 (blue pill), 16bit com LCD, USB type C.
« Reply #17 on: March 22, 2019, 07:09:29 am »
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.

At 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?
 

Offline profdc9

  • Regular Contributor
  • *
  • Posts: 73
  • Country: us
Re: Few questions related STM32 (blue pill), 16bit com LCD, USB type C.
« Reply #18 on: March 23, 2019, 04:38:42 am »
I have bluepill-like boards for STM32F1 and STM32F4 I made in Kicad

https://github.com/profdc9/STM32alt
https://github.com/profdc9/STM32F4ThruPill

You 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.
 

Offline 3dgeo

  • Regular Contributor
  • *
  • Posts: 214
  • Country: au
Re: Few questions related STM32 (blue pill), 16bit com LCD, USB type C.
« Reply #19 on: March 23, 2019, 03:32:29 pm »
I have bluepill-like boards for STM32F1 and STM32F4 I made in Kicad

https://github.com/profdc9/STM32alt
https://github.com/profdc9/STM32F4ThruPill

You 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.

Thank you for sharing your design, I'll take a look, tho I will be using only SMD parts.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf