F405 & F411 versions of the BluePill

What are you developing?
victor_pv
Posts: 1681
Joined: Mon Apr 27, 2015 12:12 pm

Re: F405 & F411 versions of the BluePill

Post by victor_pv » Wed Oct 18, 2017 4:15 pm

lkcl wrote:
Wed Oct 18, 2017 4:09 pm
http://wiki.stm32duino.com/index.php?title=Blue_Pill pinout's towards the bottom.

i did the analysis a couple days ago: for pin-compatibility / interoperability with pre-existing bluepill shields there is no other option but to use this particular pin as GPIO.

right at the beginning of the thread (somewhere on page 3 or 4) i asked roger if pin-compatibility was strictly necessary: he said it was because there is a huge range of pre-existing bluepill shields and it would be pain (costly) to force people to make more to yet another non-interoperable shield standard.
Ahh I missed that, it makes sense.

So the way I placed the resistor should provide the protection needed without affecting much if usb is not plugged (the open ended trace in that case may work as bit as an antenna right? but shouldn't be bad for digital signals)

lkcl
Posts: 121
Joined: Thu Sep 28, 2017 5:48 am

Re: F405 & F411 versions of the BluePill

Post by lkcl » Wed Oct 18, 2017 4:39 pm

victor_pv wrote:
Wed Oct 18, 2017 4:15 pm
lkcl wrote:
Wed Oct 18, 2017 4:09 pm
http://wiki.stm32duino.com/index.php?title=Blue_Pill pinout's towards the bottom.

i did the analysis a couple days ago: for pin-compatibility / interoperability with pre-existing bluepill shields there is no other option but to use this particular pin as GPIO.

right at the beginning of the thread (somewhere on page 3 or 4) i asked roger if pin-compatibility was strictly necessary: he said it was because there is a huge range of pre-existing bluepill shields and it would be pain (costly) to force people to make more to yet another non-interoperable shield standard.
Ahh I missed that, it makes sense.
yehyeh - if this was a from-scratch design it wouldn't matter: just arbitrarily pick the easiest (nearest) set of pins and be done in a few days. racemaster's extremely careful routing has been to get exact pin-compatibility. i'm amazed he's managed it... on such a tiny 2-layer board.

as you've probably seen from the stl47o (and if you've ever looked at the arduino due routing and compared it to the 2560 r3 reference design) it really is absolute hell creating interoperable boards once there's an existing standard. melts the sanest brain. i did 2 days @ appx 14 hours straight to do the first revision stl47o routing: threw it out and did the whole lot over, four days later, and it still looks bad.
So the way I placed the resistor should provide the protection needed without affecting much if usb is not plugged (the open ended trace in that case may work as bit as an antenna right? but shouldn't be bad for digital signals)
yyep. and even the USB DM and DP pins are routed to external headers (on the original bluepill so that's what has to be copied...) plays havoc with the diff-pair design rules but at 12mbits/sec that's not going to matter so much. if this is intended to be operated at 480mbits/sec they'd better be damn short traces.

User avatar
RogerClark
Posts: 7178
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: F405 & F411 versions of the BluePill

Post by RogerClark » Wed Oct 18, 2017 8:42 pm

Victor,

I had the same thought about the 1k resistor not being between the MCU and the PCB though hole pin, but being next to the USB connector.

I did not comsider that it this is an unterminated stub.
But would still be an unterminated stub, even if it didnt have the resistor

In real world use, PA9 and PA10 would often be used for Serial, which is normally run at slow speeds, in which case I doubt a short unterminated stub would have a noticable impact.

Balance that with loosing the USB OTG functionality, my vote would be to have the feature and use a series resistor

racemaniac
Posts: 555
Joined: Sat Nov 07, 2015 9:09 am

Re: F405 & F411 versions of the BluePill

Post by racemaniac » Thu Oct 19, 2017 7:25 am

RogerClark wrote:
Wed Oct 18, 2017 8:42 pm
Victor,

I had the same thought about the 1k resistor not being between the MCU and the PCB though hole pin, but being next to the USB connector.

I did not comsider that it this is an unterminated stub.
But would still be an unterminated stub, even if it didnt have the resistor

In real world use, PA9 and PA10 would often be used for Serial, which is normally run at slow speeds, in which case I doubt a short unterminated stub would have a noticable impact.

Balance that with loosing the USB OTG functionality, my vote would be to have the feature and use a series resistor
I think we were all thinking the same :). and indeed, an unterminated stub won't make much of a difference in this case. I'm glad that what we're making here is for relatively low speeds, making all these complicated issues not much of a worry XD.

zmemw16
Posts: 1449
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: F405 & F411 versions of the BluePill

Post by zmemw16 » Thu Oct 19, 2017 10:19 am

the 'other' make a board using a L471?? seems to have hit a pothole in the road, however the suggested work around mentions otg. viewtopic.php?f=9&t=2630
:idea:
compare / crib how they propose to handle the otg interface ?
srp

racemaniac
Posts: 555
Joined: Sat Nov 07, 2015 9:09 am

Re: F405 & F411 versions of the BluePill

Post by racemaniac » Thu Oct 19, 2017 12:02 pm

Would the schematic of the usb then be like this?
usb.png
usb.png (13.46 KiB) Viewed 66 times
if i'm following correctly:
- a p-channel mosfet to bring power from the USB VBUS to the main 5V (picked the one seen in the schematic as it's small, p-channel, and can handle enough current, and has very low VGS, and can be found on aliexpress)
- the SY6280 for the reverse direction would it be needed, supply 5V to the usb and with limited current (set the current limit to 680mA, i think standard usb is 500mA, with a bit of headroom?)
- tied the enable of the SY6280 to an unused pin (PC9), would be stupid to use a broken out pin for it.
- now all i'm wondering is: should i tie VBUS to PA9 (VBUS sense of the stm32f4) via a big resistor (100k?) to the VBUS? (so the vbus sense can actually work? and it'll only act as a slight pullup on the serial connection?). or do we assume we'll never put powered usb devices onto it (but then the mosfet would also be unneeded as i think it's kind of a protection in case both usb & 5v are driven?)

lkcl
Posts: 121
Joined: Thu Sep 28, 2017 5:48 am

Re: F405 & F411 versions of the BluePill

Post by lkcl » Thu Oct 19, 2017 2:56 pm

racemaniac wrote:
Thu Oct 19, 2017 12:02 pm
Would the schematic of the usb then be like this?
yep pretty much - i'd strongly suggest losing the 1.5k resistor as it's not in the reference schematic / appendix of the datasheet. in fact.... if you look at page 128 of DocID022152, en.DM00037051.pdf, you'll see that in Table 58 there's *already* pull-up resistor characteristics of typically 1.8k on PA12.

not to mention the fact that the pull-up resistor will interfere with cases where PA12 is used for alternative functions.

btw... are the 22R resistors reaaally necessary? i mean, these are incredibly short traces: yes they're normally used on longer traces, but honestly... i feel that they're just... in the way, here. the only reason to consider keeping them would be so people could remove them and cut off the USB connector. but.. if they really want to do that they can just... cut the tracks, just as easily.
if i'm following correctly:
- a p-channel mosfet to bring power from the USB VBUS to the main 5V (picked the one seen in the schematic as it's small, p-channel, and can handle enough current, and has very low VGS, and can be found on aliexpress)
i've got the arduino due ref design here... let me open it... they use a FDN340P if that helps.
- the SY6280 for the reverse direction would it be needed, supply 5V to the usb and with limited current (set the current limit to 680mA, i think standard usb is 500mA, with a bit of headroom?)
the datasheet says you use 6.8k times current. so that's a 1 *amp* current limit. you want half that, so you want a 3.4k resistor - make sure it's marked as 1% - 3.4k/1%

it's a bit of an unusual value, which will make buying awkward, but hey, omelettes, eggs...
- tied the enable of the SY6280 to an unused pin (PC9), would be stupid to use a broken out pin for it.
is there any spare pin that can be used? actually you'll need two. one as an input on a resistor-divider like those two references i sent yesterday, and that will be used to DETECT the power coming in. then the other pin will be used to CONTROL power.

the reason for making it that quotes complex quotes is because sometimes you *really want* incoming power yet to have USB Host. yes, really. you get yourself one of those "USB OTG Host Power" 3-way splitters - they're a bitch to find the right ones btw, many of them don't connect the power properly - and you can plug in a USB Charger to power *BOTH* the device *AND* the down-stream USB client devices.

- now all i'm wondering is: should i tie VBUS to PA9 (VBUS sense of the stm32f4) via a big resistor (100k?) to the VBUS? (so the vbus sense can actually work? and it'll only act as a slight pullup on the serial connection?). or do we assume we'll never put powered usb devices onto it (but then the mosfet would also be unneeded as i think it's kind of a protection in case both usb & 5v are driven?)
it's best to assume that people will want to use all three possible power configurations: standard USB Host with external power, 3-way-power-splitter-OTG-Host "Charge" mode (power splits to both board *and* client device(s) and the board's OTG is put into HOST mode), and standard OTG "client".

to do that you need full software-control over the power as well as the ability to detect (on an IRQ-capable pin) when the board has incoming OTG Power.

so... two spare pins needed: one on a divider bridge like in those circuits, then the SY6280's EN pin wired to an output.... oh! yes, you've already got that :) PC9 and a 100k resistor, yay! perfect. just the resistor-divider bridge is missing.

on the arduino reference designs they use an op-amp to compare 3.3v with the resistor-divider, which automatically and ALWAYS switches on/off the VBUS 5V power. personally i don't like that idea as it prohibits the use of 3-way OTG-Powered-Host cables.

lkcl
Posts: 121
Joined: Thu Sep 28, 2017 5:48 am

Re: F405 & F411 versions of the BluePill

Post by lkcl » Thu Oct 19, 2017 3:12 pm

ok so this one, ringed in red. USB0-VBUSDET needs to go to a spare pin as an input. i can just about make out that those are 47k and 100k resistors in the badly-taken screenshot i made, ho hum :)

hmmm.... ok i'm just staring atthe reference design.... they *already* use PA9 as the "VBUS power detect" line. so... doesn't look like a resistor-divider bridge is needed.
Untitled1 (1).jpg
Untitled1 (1).jpg (33.21 KiB) Viewed 48 times

lkcl
Posts: 121
Joined: Thu Sep 28, 2017 5:48 am

Re: F405 & F411 versions of the BluePill

Post by lkcl » Thu Oct 19, 2017 3:13 pm

zmemw16 wrote:
Thu Oct 19, 2017 10:19 am
the 'other' make a board using a L471?? seems to have hit a pothole in the road, however the suggested work around mentions otg. viewtopic.php?f=9&t=2630
:idea:
compare / crib how they propose to handle the otg interface ?
srp
yehh that's me :)

racemaniac
Posts: 555
Joined: Sat Nov 07, 2015 9:09 am

Re: F405 & F411 versions of the BluePill

Post by racemaniac » Thu Oct 19, 2017 3:28 pm

lkcl wrote:
Thu Oct 19, 2017 2:56 pm
racemaniac wrote:
Thu Oct 19, 2017 12:02 pm
Would the schematic of the usb then be like this?
yep pretty much - i'd strongly suggest losing the 1.5k resistor as it's not in the reference schematic / appendix of the datasheet. in fact.... if you look at page 128 of DocID022152, en.DM00037051.pdf, you'll see that in Table 58 there's *already* pull-up resistor characteristics of typically 1.8k on PA12.

not to mention the fact that the pull-up resistor will interfere with cases where PA12 is used for alternative functions.

btw... are the 22R resistors reaaally necessary? i mean, these are incredibly short traces: yes they're normally used on longer traces, but honestly... i feel that they're just... in the way, here. the only reason to consider keeping them would be so people could remove them and cut off the USB connector. but.. if they really want to do that they can just... cut the tracks, just as easily.
if i'm following correctly:
- a p-channel mosfet to bring power from the USB VBUS to the main 5V (picked the one seen in the schematic as it's small, p-channel, and can handle enough current, and has very low VGS, and can be found on aliexpress)
i've got the arduino due ref design here... let me open it... they use a FDN340P if that helps.
- the SY6280 for the reverse direction would it be needed, supply 5V to the usb and with limited current (set the current limit to 680mA, i think standard usb is 500mA, with a bit of headroom?)
the datasheet says you use 6.8k times current. so that's a 1 *amp* current limit. you want half that, so you want a 3.4k resistor - make sure it's marked as 1% - 3.4k/1%

it's a bit of an unusual value, which will make buying awkward, but hey, omelettes, eggs...
- tied the enable of the SY6280 to an unused pin (PC9), would be stupid to use a broken out pin for it.
is there any spare pin that can be used? actually you'll need two. one as an input on a resistor-divider like those two references i sent yesterday, and that will be used to DETECT the power coming in. then the other pin will be used to CONTROL power.

the reason for making it that quotes complex quotes is because sometimes you *really want* incoming power yet to have USB Host. yes, really. you get yourself one of those "USB OTG Host Power" 3-way splitters - they're a bitch to find the right ones btw, many of them don't connect the power properly - and you can plug in a USB Charger to power *BOTH* the device *AND* the down-stream USB client devices.

- now all i'm wondering is: should i tie VBUS to PA9 (VBUS sense of the stm32f4) via a big resistor (100k?) to the VBUS? (so the vbus sense can actually work? and it'll only act as a slight pullup on the serial connection?). or do we assume we'll never put powered usb devices onto it (but then the mosfet would also be unneeded as i think it's kind of a protection in case both usb & 5v are driven?)
it's best to assume that people will want to use all three possible power configurations: standard USB Host with external power, 3-way-power-splitter-OTG-Host "Charge" mode (power splits to both board *and* client device(s) and the board's OTG is put into HOST mode), and standard OTG "client".

to do that you need full software-control over the power as well as the ability to detect (on an IRQ-capable pin) when the board has incoming OTG Power.

so... two spare pins needed: one on a divider bridge like in those circuits, then the SY6280's EN pin wired to an output.... oh! yes, you've already got that :) PC9 and a 100k resistor, yay! perfect. just the resistor-divider bridge is missing.

on the arduino reference designs they use an op-amp to compare 3.3v with the resistor-divider, which automatically and ALWAYS switches on/off the VBUS 5V power. personally i don't like that idea as it prohibits the use of 3-way OTG-Powered-Host cables.
@22R & 1k5 resistors: not sure for the 22r, but i see something like that used in most cases, the 1k5 is not needed for the F4, but if we leave it in, the board is also compatible with an F1 which does need it (to drop in an F1, you then need that resistor, and have to bridge the 2 VCAP capacitors with a 0R resistor)...
@mosfet: the one i chose is slightly worse in specs (bit higher on resistance), but also a bit smaller, all in all very very similar :).
@sy6280 resistor, the formula is A=6800/Rset (ohm) . so for 0.5A it's 13.6K :). i thought a bit extra would be nice, but i've seen schematics going for a value close to 13.6k
@divider bridge: do i bring it to for example PC8, or to the dedicated pin for it on the stm32f4 (PA9). It will then basically result in a weak pullup on the TX of the serial line we wish to not compromise, not sure how well u(s)art can cope with that.
otherwise i can do it to pc8 and then we have to manage it ourselves, not have the peripheral do it for us. (or do it via a jumper... but we're already running short on space >_<)

Post Reply