STspin32G4 support

I suppose the correct way to drive them is with one of these. I will just tie OE to 3.3V. Non-inverting 3.3 to 5V line driver. I like the X2SON5 package, although it is tiny.

Single supply translating buffer/line driver; 3-state (mouser.dk)

Hmm…SOT-353 package is actually possible to solder. 0.8mm x 0.8mm (X2SON5) is not.

Edit: Since I already ordered the TXU0101 1bit dual-supply level shifter for the FAN PWM I will go ahead and use that. Maybe there is a advantage to dual supply as well, it looks like it could be isolated. Unfortunately, now that I have decided to do this properly, and I will, the datasheet recommends small 0.1uF caps on the VCCA and VCCB input’s.

I think I will break out the Data-Out pin on the NEOPIXEL, this way the user can potentially connect a string of these LEDs, controlled by that one level shifter/trigger.

TXU0101 Single-Bit Fixed Direction Voltage-Level Translator with Schmitt-Trigger Inputs and 3-State Outputs datasheet

I have seen multiple ESP32 projects where they add a neopixel/digital led to the board, feed it 5v power through a diode so it becomes 4.3V and then 3.3v logic seems to work. The neopixel will shift the signal higher for output so it’s a commonly used strategy if you want to control a string of neopixels/digital leds to add one on the board with the diode trick, route it’s output to a header with ‘normal’ 5v power and use it as a poor mans level shifter and diagnostic led.

edit: found a hackaday post on this trick

I did see that hack/trick, Im ok using the Schmitt-Trigger even though it does ad a small cost.

Just finishing up the Panel. I thought it a good idea to use the “frame” to make a SWD POGO pin programmer adapter for the ST-Link 2x7pin 1.27mm pitch header/cabel. Yet another cost, but I had to order some stuff I forgot, and just as well get free shipping. I’m including the reset pin, since the SWCLK is in use as TIM8_CH2.

As I understand it, it is possible to set up the ST-Link to use the reset line, when connecting the target?

This way I have:

  1. GND
  2. RESET
  3. SWCLK (TIM8_CH2)
  4. SWDIO
  5. 3.3V

If you include RX/TX as well you can debug via the st-links built in serial 2 usb converter. The ST-Link 14 pin header allows for it…

May I ask why mess with the pogo pins? Why not just put the ARM-14 header right on the board?

There’s another hackaday post somewhere on the same topic where they compare different solutions to the problem… the sacrificial neopixel + Diode is certainly one of them, but if you have 5V tolerant pins the open drain solution needs only a single resistor, I don’t think it can be beat for cost… using a simple level shifter would need the shifter + 2 caps for decoupling, I don’t think it will cost more than Neopixel + Diode, and is somehow cleaner…

I broke out the SWO pin om the header. Part of the SPI interface, I think that is sufficient.

I like pogo-pins :rofl: there is no room for the 14 pin 1.27 pitch on the board itself. Maybe I should omit the reset, since the virgins IC will not use SWCLK as TIM8_Ch2, if then a re-flash is needed or it’s bricked then the Reset button can be used. Hmmm it’s not like I’m planning on flashing it w. Pogo pins all the time, just once.

@runger the reason for pogo pins is my experience from last where it was a pain, although possible, to flash without. Those small SMD pogo’s are not too expensive

Now the POGO´s are 4pin style, like its customary. 3.3V, DIO, CLK, GND in that order. SWO and NRST can be connected if needed for some reason, like debugging.

Ive included the RX/TX pins, although I am not entirely sure how to use them. Seeing they are on pins 13/14 on the 14pin 1.27mm pitch ST-link connector, it would be foolish not to integrate them I agree @runger

Are you doing in-line current sensing with two INA241s?

Right now I’m tuning parameters. Yes the board has in-line INA241 amplifiers. (1.1Mhz)

You’ve built almost exactly what my goal is to build as well, so I’ll have a lot of questions for you if that’s ok. Have you released a schematic? This way I won’t have to ask so many things :slight_smile:

As I told you already, you are more then welcome to join the Beta run. You may ask all you want, just create a new thread.

So I actually need Wi-Fi control so I’ll end up using an ESP32, which will then require me to use the DRV8412. But it’s for a 6A Nema 34 stepper motor and will use the same encoder and similar power stage components. So this board is more of a guide, but this is one of the few large stepper motor boards that I see in this forum so it’s very helpful

You do know the ESP32 has verry poor ADC right ? Take a look at the specs. With a ESP32 you should be able to use a HALL-type current amplifier. Happy making! Create a new thread.

@dfrenkel if you expect to use wireless while reading the ESP32 ADC I think you are in for a challenge. I think @Valentine has some insight into this ?

@dfrenkel

Talking wireless got me thinking. I have some nrf53 samples sitting on my desk. The question is if the SPIN32 buck can provide the needed current @runger. I’m tempted to make a small add on layer/stack. It’s a dual core M-33 just waiting to be unleashed. So one core for BLE another for user code. Combine that with the G4 and you have a tri-core setup ready for any e-bike :robot:

Ultra-low-power radio with great sensitivity
The nRF5340 SoC radio sets a new standard when it comes to combining advanced features and minimizing current. The 0 dBm TX current is 3.4 mA, while the RX current is only 2.7 mA, resulting in a reduction of 29% and 41% when comparing to the nRF52840 SoC. The RX sensitivity is -98 dBm, 3 dB better than nRF52840, meaning that the nRF5340 provides 3 dB better sensitivity, while using 41% less current.

@Karl_Makes_Music

Mesh

@Juan-Antonio_Soren_E , Regarding the ESP32 ADC, I came across this post from @runger in the discord channel, which is why I decided to stay with the ESP32:

"Look, the ADC is not very good on the ESP32, but I think it is good enough… perhaps @DavidG can comment on this, he has used it quite a bit. The many advantages of the ESP32 can outweigh this disadvantage, I think.

If you design the analog circuit to give a “loud and clear” signal in the 0V-3V range, you can probably do a lot to fix non-linearity in software, if you want…

But its undeniable that the ADCs on an STM32 are much better - but the chips cost more, don’t do WiFi or ESP-Now, and also, simply aren’t available right now :frowning_with_open_mouth:"

I think at worst I can add an external ADC to I2C module because I understand wireless control on the ESP32 (I like ESPUI) very well and having dual cores will be very very helpful for my Wi-Fi project without adding too much complexity

Yes, do not put eggs in the microwave.

sorry to revive this post but i started developing my own board and i saw this schematic and i got a doubt why do you use external LDOs ???

Yes, that is purely a choice. If you look through the datasheet, there are various ways to power it. It does have a internal LDO.

okay thank you and is that 5v LDO only for disabling the power from usb through ap2161?

I suppose it is for onboard 5v. Why ?

In reality it is a bit below 5v since it drops through that diode.