hybridfree/eevblog-posts huggingface dataset:
Stepper Motor control with an Arduino and Quadrature Optical Encoder question - Page 1
Forum section: electronics / beginners

author: bkukuk62
author_rank: Newbie
timestamp: September 14, 2019, 09:58:43 pm
content: I am currently using the following code that rotates a Nema 17 Stepper motor with a Quadrature Optical Encoder.Is it possible to have another loop that is triggered by a button press to rotate the Stepper Motor clockwise at a certain speed for 10 full rotations or until another button is pressed to put it back in the original mode?Here is the code I am currently using.#include <Stepper.h>const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution for your motor// initialize the stepper library on pins 8 through 11:Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);int stepCount = 0; // number of steps the motor has takenvoid setup() {// nothing to do inside the setup}void loop() {// read the sensor value:int sensorReading = analogRead(A0);// map it to a range from 0 to 100:int motorSpeed = map(sensorReading, 0, 1023, 0, 100);// set the motor speed:if (motorSpeed > 0) {myStepper.setSpeed(motorSpeed);// step 1/100 of a revolution:myStepper.step(stepsPerRevolution / 100);}}

author: Blitzschnitzel
author_rank: Regular Contributor
timestamp: September 15, 2019, 04:57:23 am
content: Is analogRead(A0) a potentiometer?I am not absolutely sure what you want it to do but maybe something like this?if (buttonA == HIGH){while(ButtonB == LOW){Rotate 10 clockwise;}}In the right syntax off course.
Stepper motor controlling - Page 1
Forum section: electronics / beginners

author: levelone
author_rank: Newbie
timestamp: May 21, 2015, 07:05:56 pm
content: Hey, noob here with a question regarding stepper motors and a way to control a specific range of motion.To be a bit more specific, i want to have a rotary knob (potentiometer - encoder?) that makes all four stepper motors perform 6 full revolutions.I don't mind if the knob doesn't have a "min-max" (like a volume knob) setting, i just want it from end-to-end (i would like -if possible- for the knob to be max 1 revolution) to make all the motors perform 2160 degrees. Center would be a hypothetical zero, and from there 1080 degrees (3 full revolutions) to each end.I have been reading a lot about quadrature encoders and that this would be the way to go, but my knowledge limits me to go for the simplest solution.So, the question is, is there an "easy" way to do this?Thank you in advance!
Stepper motor inrush current - Page 1
Forum section: electronics / beginners

author: tony3d
author_rank: Frequent Contributor
timestamp: September 23, 2017, 01:41:05 pm
content: Just wondering if the current induced be manually pushing a 3d printer bed around, can damage the printers circuitry?

author: Karlo_Moharic
author_rank: Regular Contributor
timestamp: September 23, 2017, 03:16:23 pm
content: Unless you are pushing the bed with 10G of force , the answer is no. You will induce a couple of milivolts , maybe a volt at most.This is too small of a voltage to damage anything.

author: tony3d
author_rank: Frequent Contributor
timestamp: September 23, 2017, 04:46:18 pm
content: I can very easily spin the shaft of a small D.C. Motor, and generate over 3 volts. Moving a bed even rather slowly looks faster.

author: Karlo_Moharic
author_rank: Regular Contributor
timestamp: September 24, 2017, 08:46:43 pm
content: It would took several hundred volts for you to damage something , you have nothing to worry about.

author: Shock
author_rank: Super Contributor
timestamp: September 25, 2017, 11:46:57 am
content: Thou shalt measure, with thy min/max.

author: Raj
author_rank: Frequent Contributor
timestamp: September 25, 2017, 05:53:35 pm
content: unless you have a badly designed circuit,no.most motor drivers have diode protections built in.
Stepper Motor Power - Page 1
Forum section: electronics / beginners

author: BLangford11
author_rank: Newbie
timestamp: June 24, 2017, 09:05:12 pm
content: I'm currently doing a school project that will involve me using a couple of stepper motors and while doing my research I couldn't find anywhere that lists how to power them. My budget is fairly tight so I don't want to go out and buy the wrong thing that'll be expensive. Is there a specific power supply I need for a stepper motor? Do I have to buy a power supply for each motor or can I run both off of one?Thanks

author: Nusa
author_rank: Super Contributor
timestamp: June 24, 2017, 09:11:59 pm
content: The answer to what you need is going to depend on which stepper motors you buy and what kind of drivers you're using to run them.The driver solution will have an input for motor power.Once you figure that out, you should be able to use one supply for both motors.

author: danadak
author_rank: Super Contributor
timestamp: June 24, 2017, 10:37:22 pm
content: QuoteShould be able to use a single supply.Many issues, high currents in the drivers, L effects creating large transients, google drivingstepper motors, and PCB layout techniques. Latter to keep transients out of digital electronics.Regards, Dana.

author: Mechatrommer
author_rank: Super Contributor
timestamp: June 25, 2017, 10:46:50 am
content: http://lmgtfy.com/?q=how+to+power+stepper+motorhttp://www.ebay.com.my/itm/Newest-4A-TB6600-Single-Axis-Stepper-Motor-Driver-Controller-For-57BYG250H-Motor-/272649652873?hash=item3f7b2f8a89:g:xvAAAOSw~y9ZAYnzhttp://www.ebay.com.my/itm/A4988-Stepper-Motor-Driver-Module-StepStick-3D-Printer-Polulu-RAMPS-RepRap-/172229894670?hash=item2819b3a20e:g:6tEAAOSwOyJX4K7n
Stepper motor wiring - Page 1
Forum section: electronics / beginners

author: sairfan1
author_rank: Frequent Contributor
timestamp: September 11, 2025, 04:01:17 pm
content: Please refer to attached picture highlighted in yellow points on stepper motor.I want to connect stepper motor to driver board which has A1 A2 and B1 B2 ouput pointsI want to know which point from motor labeled A, C and B, D will connect to its relate connection on board at stated above.

author: Nominal Animal
author_rank: Super Contributor
timestamp: September 11, 2025, 04:49:35 pm
content: Quote from: sairfan1 on September 11, 2025, 04:01:17 pmThe driver board A1 and A2 control one coil, and B1 and B2 another coil. Therefore, you connect A to A1, C to A2, B to B1, and D to B2.
stepper motor - Page 1
Forum section: electronics / beginners

author: abdullahseba
author_rank: Frequent Contributor
timestamp: March 25, 2014, 03:23:15 pm
content: can you connect a 3v stepper motor to 5 volts

author: michaelym
author_rank: Regular Contributor
timestamp: March 25, 2014, 08:40:13 pm
content: Generally when a motor is "rated" for a certain voltage it just means that the specs for torque, etc. in the datasheet were measured at that voltage.I believe it shouldn't be a problem.

author: hlavac
author_rank: Frequent Contributor
timestamp: March 25, 2014, 08:49:51 pm
content: Its not like the voltage rating of the stepper motor means the isolation on the coils breaks down at that voltage or something, it is related to the power rating of the motor (you can put as much DC current thru the motor that develops 3V across the internal resistance and it should barely not burn).In fact higher voltages are commonly used to get the current in the coils going faster - they are inductors right? - for high speed operation, as long as you don't exceed the power rating and back off on the voltage to 3V / limit the current when the max rated current is reached it will be perfectly fine.Normally you think in terms of current not voltage when driving stepper motors...

author: hlavac
author_rank: Frequent Contributor
timestamp: March 25, 2014, 08:55:53 pm
content: As for the 5V, yes but not permanentlyYou will need to do for example some PWM to keep in the allowed power rating. Duty cycle of 3/5 or 60% will do it for you...
Stepping out from Arduino : Start on January 20 with Keil IDE and Ti Launchpad  - Page 1
Forum section: electronics / beginners

author: JacquesBBB
author_rank: Frequent Contributor
timestamp: January 19, 2016, 05:38:14 pm
content: Very often, there are message asking for a way to go beyond the Arduino programming.Tomorrow (January 20 ) is starting the excellent MOOC from Austin UniversityEmbedded Systems - Shape The Worldhttps://www.edx.org/course/embedded-systems-shape-world-utaustinx-ut-6-03x#!This is a series of lectures about microcontroller programming in C, using a professional environment (Keil)with the TM4C123 Tiva C launchpad Texas Instrument developing card as target. You need to buy this card to do the labs (about 13$).Everything else is free, apart from a small amount of standard electronics parts.The course lasts for 16 weeks. At the end, you should know how to program the registers of a IC, do in circuit debugging using professional tools, and program a state machine for a robot.The very nice thing is the possibility to have your programs and hardware evaluated online through the keil IDE. This is excellent for isolatedpeople. The forum of the course is also a good place to progress.If you have nothing in your drawers, you can eventually get a full kit.http://edx-org-utaustinx.s3.amazonaws.com/UT601x/index.htmlDisclaimer : I have absolutely no interest either in EdX, Austin University, Keil, Ti, but followed most of it last year and found that it was the best combination of lectures/labs I encountered on the Web for self educating.
Stereo volume control with a single pot - Page 1
Forum section: electronics / beginners

author: IO390
author_rank: Regular Contributor
timestamp: October 11, 2014, 09:28:00 pm
content: I'm rebuilding my amp, and out of interest I began to wonder if there's any practical (analogue) way of attenuating two separate signals using a single pot.I played with a few circuits that just attenuated the signal using a transistor as the bottom half of a voltage divider, but it didn't really work. So yeah, can anyone think of anything?

author: grumpydoc
author_rank: Super Contributor
timestamp: October 11, 2014, 10:30:53 pm
content: You could just use a single pot as a voltage divider, then drive the control voltage of a pair of VCAs, or perhaps digital pots but I can't quite see the advantage.

author: Richard Crowley
author_rank: Super Contributor
timestamp: October 11, 2014, 10:55:29 pm
content: Quote from: IO390 on October 11, 2014, 09:28:00 pmClearly you can't DIRECTLY attenuate two different signals with a single pot. So you must use the pot to control two (or more) separate voltage-controlled amplifiers or attenuators.QuoteWhat does "didn't really work" mean exactly? That leaves us with far more questions than it purports to answer. Do you mean you couldn't get the attenuation range you need (which is also not revealed here)? Or do you mean the performance (IM distortion, noise ratio, or whatever) didn't meet your requirements (also not revealed)?In any case attempting to use a single pot (especially if it is the original log-taper pot) to control stereo signals will be far more extrordinarily challenging to do than simply replacing the single-section pot with a dual ("stereo") pot. Is there some overwhelming reason why you can't simply replace the pot?
sthetoscope digital - electret condenser mic (ecm) - Page 1
Forum section: electronics / beginners

author: ramdani_febrian
author_rank: Newbie
timestamp: December 12, 2016, 02:55:58 pm
content: i make sthetoscope digital using ecm,can't capture heart sound but can capture sound outside the sthetoscope.note : if i using stetoscope without ecm,ecm is replace with my ear, i can hear the heart sound,what is wrong with my stetoscope??

author: NottheDan
author_rank: Frequent Contributor
timestamp: December 12, 2016, 04:45:55 pm
content: Are you using a sound chamber or are you trying to pick up the sound directly?

author: Audioguru
author_rank: Super Contributor
timestamp: December 12, 2016, 07:38:53 pm
content: I corrected an analog electronic stethoscope project. As a sound chamber (stethoscope head) for its electret microphone I used a plastic lid from a jar of peanut butter:"Fasten the microphone to the stethoscope head with a rubber isolating sleeve or use a short piece of rubber tubing on its nipple. A thick jar lid can be used as a stethoscope head. The microphone must be spaced away from the skin but the stethoscope head must be pressed to the skin, sealing the microphone from background noises and avoiding acoustical feedback with your headphones.The microphone/stethoscope head must not be moved while listening to heartbeats to avoid friction noises.Protect your hearing. Keep the microphone away from your headphones to avoid acoustical feedback."
Sticker Printer on Thermal printer - Page 1
Forum section: electronics / beginners

author: Vindhyachal.takniki
author_rank: Frequent Contributor
timestamp: March 31, 2018, 05:58:11 am
content: 1. I am using Atmega2560 & em205 thermal printer.https://hacktronics.co.in/thermal-printer/aps-em205-compatible-58mm-thermal-printer-with-rs232-and-tll-interfaceBeen able to print correctly text & bar-codes on thermal paper.2. Apart from that regualr thermla paper, there also sticker roll that comes like in this link :https://drive.google.com/open?id=1HWolIvnxBKlPsA-qL0ONkOavmunGPmAV3. It has small slots to identify start & end point of sticker. I cn print on it, but text gets also printed outside the sticker. is ther any way I can identify start & end point of sticker, so that I can print on sticker only.

author: PartialDischarge
author_rank: Super Contributor
timestamp: March 31, 2018, 06:16:37 am
content: Normally printers do have a led and photodetector to detect the end of a label, and it is a duty of the printer to align the roll so that data gets printed in the correct position. Don't know about that printer you are using though
sticky posts on projects - Page 1
Forum section: electronics / beginners

author: thickpeter
author_rank: Newbie
timestamp: November 06, 2018, 06:28:17 am
content: Been here a week now in the search area.I cant seem to find a list of beginneers projects or build alongs that are saved or sticky posted for others to follow.Is there such a place or do all projects just go into the forums loose?

author: Zero999
author_rank: Super Contributor
timestamp: November 06, 2018, 08:54:20 am
content: Yes, projects go into the forum loose. I think it would be a good idea to sticky some of the higher quality ones, but someone will need to decide which project is worth it and which isn't.

author: thickpeter
author_rank: Newbie
timestamp: November 06, 2018, 11:44:07 am
content: yes, when i joined i was expecting to see a load of novice projects that were stickied to allow the other newbies easy access, i spent most of the time here searching for stuff. lol

author: thickpeter
author_rank: Newbie
timestamp: November 06, 2018, 11:44:55 am
content: i cant see any links from videos to posts either, or is that just me too?

author: Zero999
author_rank: Super Contributor
timestamp: November 06, 2018, 12:11:44 pm
content: What sort of project do you want to build?

author: Mechatrommer
author_rank: Super Contributor
timestamp: November 06, 2018, 07:24:24 pm
content: http://lmgtfy.com/?q=beginner+electronic+project+list

author: thickpeter
author_rank: Newbie
timestamp: November 07, 2018, 07:56:39 pm
content: it was a beginners question, sarcasm was not required,thanks all the same
Stiebel Etron DHM 6 poor water output temperature - Page 1
Forum section: electronics / beginners

author: SFitzgerald
author_rank: Newbie
timestamp: May 15, 2017, 10:22:44 pm
content: Can anyone give me some advice with the compact Stiebel Etron DHM 6 (mini water heater) which has outputtting poor water temperature. There appears to be no external or internal adjustment pot. I have also just the replaced the heater same fault...... . Help please.

author: Seekonk
author_rank: Super Contributor
timestamp: May 15, 2017, 10:55:17 pm
content: Search forum for Stiebel, this has been talked about here before.
Stm32 desoldering gun - Page 1
Forum section: electronics / beginners

author: Beastman2008
author_rank: Newbie
timestamp: September 15, 2023, 06:58:01 am
content: I was just wondering if anyone has used one of those t12 stm32 controllers with a vacuum pump to make a desoldering solder sucker gun does anyone know if it will work i was thinking these to mane partshttps://www.aliexpress.us/item/2255800058409553.html?spm=a2g0o.detail.1000023.7.5ef10VTT0VTTqE&gatewayAdapt=glo2usa4itemAdaptAndhttps://www.aliexpress.us/item/3256802194508944.htmlAny help would be greatly appreciated

author: Beastman2008
author_rank: Newbie
timestamp: September 19, 2023, 03:50:03 am
content: This is my first post on here and I can't even get a half a** option great blog you got looks like everyone's stuck up and just to good

author: DavidAlfa
author_rank: Super Contributor
timestamp: September 19, 2023, 04:02:21 am
content: If you didn't get answer then it's because nobody tried, simple as that.Who knows the heater used in these guns. 240V? 24V? Temperature sensor output?Would need at least a custom firmware running on the said boards and some hardware mods.You still need the vacuum pump, the enclosure...in the end it's just better to get the real thing.

author: liaifat85
author_rank: Regular Contributor
timestamp: September 19, 2023, 08:11:14 am
content: Sorry. I used neither. I have found a review on KSGER All In One Digital High-End Rework Station STM32/T12.

author: Beastman2008
author_rank: Newbie
timestamp: October 08, 2023, 06:02:00 am
content: Thank you something is better than nothing

author: tooki
author_rank: Super Contributor
timestamp: October 08, 2023, 03:07:34 pm
content: Quote from: Beastman2008 on September 19, 2023, 03:50:03 amOr maybe just the answer to your question (“has anyone used one of these”) was “no, nobody has”. Sheesh. That attitude is a way to ensure nobody helps you, even if they could. (Would you help someone if you saw they had accused everyone of being “stuck up and to  good”??)

author: dmulligan
author_rank: Regular Contributor
timestamp: October 08, 2023, 04:23:12 pm
content: I can't speak to the desoldering guns but the Ksger soldering stations are pretty good and some of the alternate "stm32" based ones are reported to be crap. I thought I was buying a stm32 based one and ended up getting an Intel MCU based soldering station. Part of my goal was to use the open source firmware available. Oh! That firmware is by David Alfa!

author: luudee
author_rank: Frequent Contributor
timestamp: October 08, 2023, 04:34:47 pm
content: Quote from: Beastman2008 on September 19, 2023, 03:50:03 amWow ! You are the rudest person I know ! I will add you to my block list on your request !No help for you moron ...
stm32 gpio speed  - Page 1
Forum section: electronics / beginners

author: alireza7
author_rank: Regular Contributor
timestamp: July 28, 2018, 05:06:00 pm
content: hiwhat does the GPIO_Speed setting do?GPIO_Speed_2MHz /*!< Low speed */GPIO_Speed_25MHz /*!< Medium speed */GPIO_Speed_50MHz /*!< Fast speed */GPIO_Speed_100MHzdoes it change the gpio pin slew rate? or it changes propagation time of gpio pin?

author: Muxr
author_rank: Super Contributor
timestamp: July 28, 2018, 05:13:14 pm
content: My understanding is, it does improve the slew rate at the expense of power use and noise being generated by the circuit.So unless you really need it for a specific reason it's best to use the slower speed.

author: alireza7
author_rank: Regular Contributor
timestamp: July 28, 2018, 05:20:43 pm
content: Quote from: Muxr on July 28, 2018, 05:13:14 pmbut it's some how odd to me.how can a digital gate change its slew rate during operation time??

author: Muxr
author_rank: Super Contributor
timestamp: July 28, 2018, 05:26:22 pm
content: Quote from: alireza7 on July 28, 2018, 05:20:43 pmNot only can it change the slew rate it can completely change the mode of operation from using push-pull to open-drain, as well as the configuration of built in pull-ups and pull-downs.The integrated circuit (STM32) can have this capability. I don't know the exact implementation details on how they accomplish it but I don't think it's that hard to believe that its capable of doing it.Perhaps ask in the Microcontroller's section. Maybe someone knows the answer.

author: ataradov
author_rank: Super Contributor
timestamp: July 28, 2018, 05:37:37 pm
content: I'm just guessing here, but when you select slow or fast mode on Microchip SAM MCUs there is an observable change in the pin series resistance. My best guess is that the idea here is to have an RC filter formed by that variable resistor and the line capacitance.Again, just guessing and would be interested to know the details myself.My observation method may not be perfect either. All I did is set the pin as an output driven to 0 and measure the resistance from the pin to ground using a multimeter. Since there is only two settings in SAM MCUs, the results are hard to interpret. May be you can do the same measurement on the STM32?

author: ogden
author_rank: Super Contributor
timestamp: July 28, 2018, 05:47:11 pm
content: Quote from: alireza7 on July 28, 2018, 05:20:43 pmFPGA's offer even more trickery with I/O's. If you wanna know how they possibly do it -read patentsMost likelythis is how they do it

author: Simon
author_rank: Unknown
timestamp: July 28, 2018, 06:16:04 pm
content: Please don't double post, it is highly disrespectful to people helping you that are not aware of the other thread:https://www.eevblog.com/forum/microcontrollers/stm32-gpio-speed-128753/msg1707167/#msg1707167
STM32 how to power 32kHz oscillator via VBAT pin (max 4.0V) if battery has 4.2V? - Page 1
Forum section: electronics / beginners

author: dusan
author_rank: Regular Contributor
timestamp: November 13, 2024, 10:11:22 am
content: I'm using lithium battery which has maximal voltage 4.2V but VBAT input pin in STM32G030 has maximum 4V. What should I do?

author: squadchannel
author_rank: Frequent Contributor
timestamp: November 13, 2024, 10:23:31 am
content: VBAT probably for coin cells.A low Iq LDO would be a good choice.VBAT has an input lower limit is 1.55V, so an LDO capable of outputting around 1.6V will sustain it for a long time.Lithium has a lower limit of 2.4V, so design with caution.TPS7A02 is loooooow Iq: 25nA.

author: xvr
author_rank: Frequent Contributor
timestamp: November 13, 2024, 11:36:59 am
content: Quote from: dusan on November 13, 2024, 10:11:22 amConnect diode in series with battery

author: squadchannel
author_rank: Frequent Contributor
timestamp: November 13, 2024, 11:39:50 am
content: damn, I forgot that trick.

author: langwadt
author_rank: Super Contributor
timestamp: November 13, 2024, 12:57:14 pm
content: Quote from: xvr on November 13, 2024, 11:36:59 amwould need a string of several diodes, 4V is the abs max and shouldn't happen in normal operation and the forward voltage of a diode at the uA Vbat consumption might only be few 100 mV

author: RoGeorge
author_rank: Super Contributor
timestamp: November 13, 2024, 02:52:31 pm
content: Quote from: dusan on November 13, 2024, 10:11:22 amIf it's a one off, for personal use, I'll take the risk and just use the 4.2V Li-ion as it is. I have a few consumer goods that were made for 3V CR2032 coins, or for 2x1.5V alkalines, and I'm using them with Li-ion for a few years now. None has failed so far.Another method, in case it's for your personal use only, do not charge the battery to the max 4.2V. Charge the battery to 4V max, or even less. There is not much energy anyway between 4 and 4.2V in a recheargeable. You can observe that if you search online for discharging Li-ion batteries charts. The voltage drops pretty fast to less than 4V. Most of the energy is around the 3.7V +/-0.2V or so.If it's for production, or for somebody else's use, then add a small LDO or a voltage reference. The one I've used once was REF3033, has about 50uA quiescent current, and it's rock solid, can deliver up to 25mA. The minimum voltage drop on it is ridiculously small, only 1mV.
STM32, I2S, and setup in CubeIDE (or, how the hell does I2S_CKIN work) - Page 1
Forum section: electronics / beginners

author: Mr Green
author_rank: Newbie
timestamp: January 02, 2023, 01:26:27 pm
content: Hi,Currently putting together a project using an STM32 processor connected to a codec, simple stereo in stereo out. Details on how to properly setup the I2S interconnects however, have eluded me. Surprisingly, every tutorial just tells you the basics and then unceremoniously ends, leaving me a bit confused when it comes to the finer details. On that note if there is some document explaining every peripheral option and their settings in CubeIDE I'd love to see it!Getting to the point, I'm using two independent I2S lines (one out, one in) at 48KHz to connect to an ADAU1701 codec. The codec will have its own 12.288 MHZ oscillator and so will be the master for both lines. My question is then:if the STM32 is only an I2S slave, does the master clock input I2S_CKIN matter at all? Is thereanysituation where this would have an effect?My intuition tells me no, but the "real audio frequency" in the I2S setting panel is still displayed and updated when you change the clock source, even in slave mode.I would assume that since the STM32 is not generating any clocks for the I2S itself, then having a master clock connected wouldn't change anything. The STM32 and codec will also be the only I2S devices, so it's not like there needs to be synchronisation over multiple ICs. Of course as with any audio topic my searches just led to some vague mentions of clock jitter and zero documentation...As a bonus question, how does the "master clock out" setting work when you have I2S_CKIN enabled as the source? If you set 12.288 MHz as the input and enable 48KHz I2S it has no problems and 0% error, but if you enable the master clock output CubeIDE tells you that 12.288MHz is now far too low and you need 43.008MHz+ (3.5x) instead. What exactly is happening here? I assumed the master clock output would be 256 x fs, but it's asking for 896 x fs? Is it dividing it before output? This isn't relevant for my current project but if my next one involves the STM32 being master for I2S then I'm clueless.Thanks in advance.

author: danieljfarrell
author_rank: Contributor
timestamp: April 30, 2024, 09:43:04 pm
content: Bump. This is a well posed question. I have exactly the same question regarding how things should be configured in CubeIDE.

author: DavidAlfa
author_rank: Super Contributor
timestamp: April 30, 2024, 10:22:57 pm
content: Have you RTFM or just asking?
STM32 Jitter PLL - Page 1
Forum section: electronics / beginners

author: Curby
author_rank: Contributor
timestamp: February 07, 2018, 06:12:08 pm
content: Hi there,I'm using a STM32F413VGT6, 8MHz crystal and creating a 72/96MHz clock with it (PLL). It works, but I have a significant jitter on it. Using the MCO_2 to take a look at it with the oscilloscope I can see the attached picture.What can I do to reduce the jitter? Creating a 400kHz frequency with a timer gives me 400kHz +- 5kHz - not useful! Where does it come from?Thanks!

author: fourtytwo42
author_rank: Super Contributor
timestamp: February 07, 2018, 06:21:29 pm
content: If the clock is wandering around like that the most likely cause is the PLL is not locked and is hunting. Carefully check the spec and ensure the PLL is operating within it's lock range and also most devices have a PLL lock flag somewhere you can check.

author: Twoflower
author_rank: Frequent Contributor
timestamp: February 07, 2018, 06:22:13 pm
content: That's probably not Jitter but an aliasing effect of your scope. With digital scopes you might look out for some effects like that.

author: Curby
author_rank: Contributor
timestamp: February 07, 2018, 06:28:50 pm
content: Ok, here another screenshot. Creating a 420kHz frequency with a hardware-timer (output compare) jitters like this. It drifts from about 418-422kHz.I don't think this is good enough and practically i need a better signal.I'm using 8MHz-> /4 -> *72 -> / 2 = 72MHz PLL.

author: ataradov
author_rank: Super Contributor
timestamp: February 07, 2018, 06:51:50 pm
content: Again, this looks like a scope artifact. Find another way to check the frequency.Expand time base so you have one period on the screen and set infinite persistence mode and see if you can see significant variations in the period.Scope frequency counter is an indication tool, not an actual measurement tool.

author: Yansi
author_rank: Super Contributor
timestamp: February 07, 2018, 07:05:44 pm
content: And please don't forget that STM32 chips support spread spectrum (frequency modulation) for EMI suppression
STM32 JTAG - Page 1
Forum section: electronics / beginners

author: roogadget
author_rank: Contributor
timestamp: September 19, 2018, 11:42:29 am
content: I am working on a design that uses an STM32 F0 and I want to have a JTAG connection for debugging.Is it possible to use JTAG with the STM32 F0 series?I have seen some projects where this is possible however there is nothing on the reference manual.

author: Jeroen3
author_rank: Super Contributor
timestamp: September 19, 2018, 11:54:17 am
content: According to RM0091 the STM32F0 only has Serial Wire (SWD) for debug.Quote from: Chapter 32The F0 does support JTAG, but only for testing I believe.

author: roogadget
author_rank: Contributor
timestamp: September 19, 2018, 11:58:54 am
content: I'll jump onto the STM32 F1 series. Thanks!

author: Jeroen3
author_rank: Super Contributor
timestamp: September 19, 2018, 01:26:40 pm
content: Do you want to daisy-chain and debug?
STM32 Naming Table - Page 1
Forum section: electronics / beginners

author: Bob Moore
author_rank: Newbie
timestamp: April 01, 2020, 03:39:11 am
content: A couple of months ago I wrote an article about STM32 vs PIC 32 and I included a naming convention table, just because I was curious about knowing what all of those numbers meanDo you guys feel it makes sense? this is the original posthttps://titoma.com/blog/stm32-pic32-manufacturingin case you wanna see it there

author: ataradov
author_rank: Super Contributor
timestamp: April 01, 2020, 03:55:25 am
content: That lacks STM32G series.
STM32 nucleo board pwm and timer channel - Page 1
Forum section: electronics / beginners

author: Zeeyuu
author_rank: Newbie
timestamp: October 08, 2023, 03:45:21 am
content: Here are the stm32f401re schematics and pinouts. I want to see the timer in channel 1 and use that timer to cooperate in the PWM channel. There are no timers other than channels 1 to 4. However, I only see pwm channel on channels from 5 to 9. How can I use the timer in a different channel to set the algorithm of the PWM waveform?

author: ozcar
author_rank: Frequent Contributor
timestamp: October 08, 2023, 05:48:22 am
content: Channels are associated with timers. I don’t think it makes sense to talk about, say “channel 1” without mentioning a particular timer. Some of the timers have four channels, and some have only two, so where are you seeing mention of channel numbers greater than 4?The datasheet has a pin function table, where you can look and see, for example, GPIO pin PA2 has “Alternate Functions” including TIM2_CH3, TIM5_CH3, and TIM9_CH1 (timers and channel numbers on those timers). You can get the same information by creating yourself a project using STM32CubeMX, and then just click on the pins in the Pin View, and that will show all the alternate functions.

author: nathankwan
author_rank: Contributor
timestamp: October 18, 2023, 02:59:32 am
content: I must say I have no idea what he wants to do...Almost all timers(except for basic timers) on STM32 has PWM capability, but like ozcar said, each timer can manage up to 4 PWM output channels. If it's more than 4 channels you want, simply select more timers, and configure them to be of identical mode, frequency and output-compare values, that will gave you the total channels you want.But keep in mind, different timers might be on different AHB/APB buses, and the bus frequency as well as timer clock multipliers are different. You need to take those into consideration.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: October 18, 2023, 08:08:47 am
content: Neither the picture nor the pinout diagram is very useful in this regard. Those STM32 processors can have many PWM outputs. You can read the datasheet, application notes or search the internet for ideas on how to configure them.

author: DavidAlfa
author_rank: Super Contributor
timestamp: October 18, 2023, 02:05:49 pm
content: Each pin can be assigned to plenty of functions depending on the alternate configuration, check the stm32 reference manual.If you're using stm32cubeide, just open CubeMX (Double-click the .ioc file), clicking on any stm32 pin will show what it can do.
STM32 USB together with USBLC6 - Page 1
Forum section: electronics / beginners

author: Curby
author_rank: Contributor
timestamp: January 08, 2018, 08:52:15 pm
content: Hello,I have a question about the USB of an STM32 device. The Controller I want to use is the STM32F413VGT6.I don't want to use the 5V provided by the USB host and I only want to run it as a USB device using a USB B Connector.Are the following steps correct?I connect GND of the Connector with GND of my Board.I connect the Shield of the Connector with (1M || 4.5nF) to GND of my Board.I connect D- and D+ the following way: Dx -> USBLC6 -> 22ohm -> STM32The VUSB from the Connector is only connected with the USBLC6 VBUS inputMy µC is running at 3.3V. Will there be any problems with the 5V USB data lines?Thank your for any advices!

author: Signal32
author_rank: Frequent Contributor
timestamp: January 08, 2018, 10:25:09 pm
content: 1 & 3 are the correct approach.Not sure about 2 & 4.But there will be no issue with the 3.3V / 5V voltage mismatch. USB is actually 3.3V or lower, the 5V is there only to provide power to devices on the bus, with no relation to the actual USB protocol itself.

author: mbless
author_rank: Regular Contributor
timestamp: January 09, 2018, 01:41:00 am
content: Take a look at theNucleo data sheetfor this processor. Figure 18 shows how the usb is connected. USB 5v is tied to PA9, USB_FS_USB, with a 10k resistor.
STM32+epaper, weird signal - Page 1
Forum section: electronics / beginners

author: Moriambar
author_rank: Unknown
timestamp: May 18, 2024, 08:52:44 am
content: Hi there,around 4 years ago I started experimenting with the bluepill and some 4.2 inch epaper displays. Everything was fine and dandy so I decided to design my own circuit.Well long story short I postponed the project up until today, I soldered my stuff, programmed the stm32 and connected the module.Result: nothing.I probed the board and either with the module connected or disconnected both busy and rst lines were ~1V, which I think is kinda low.The project is powered by 3.3V via linear psu.What am I doing wrong?Here's the code (I use the arduino ide)Code:#include <GxEPD2_BW.h> // including both doesn't use more code or ram#include <GxEPD2_3C.h> // including both doesn't use more code or ram#include <Fonts/FreeMonoBold24pt7b.h>#include <Fonts/FreeMonoBold18pt7b.h>#include <Fonts/FreeMonoBold12pt7b.h>// select the display class and display driver class in the following file (new style):#include "GxEPD2_display_selection_new_style.h"void setup(){display.init();// comment out next line to have no or minimal Adafruit_GFX codedisplay.setTextColor(GxEPD_BLACK);display.firstPage();do{display.fillScreen(GxEPD_WHITE);display.println();display.println();display.setFont(&FreeMonoBold18pt7b);// comment out next line to have no or minimal Adafruit_GFX codedisplay.print(" CIAO");display.println("Oggi e` il 18");//display.print("Hello World!");}while (display.nextPage());}void loop() {};this gets uploaded fine.Attached the schematic for my project. Currently only the RTCC and the stm32 are installed, but I'm not using them (see code), since I wanted just to see whether the display worked.Thanks for any help.

author: temperance
author_rank: Super Contributor
timestamp: May 18, 2024, 09:08:55 am
content: QuoteHow did you probe the board? With an oscilloscope?

author: Moriambar
author_rank: Unknown
timestamp: May 18, 2024, 09:50:34 am
content: Quote from: temperance on May 18, 2024, 09:08:55 amyes, sorry for not having specified it before. the ground lead was on the" -"input fromthe PSU

author: temperance
author_rank: Super Contributor
timestamp: May 18, 2024, 10:20:35 am
content: Looking at the display data sheet: busy is, as expected, an output and RST is an input.The busy line and the SPI interface will not do anything as long as the RST line is not properly driven. I would would start by investigating if the output to drive the RTS line is configured as an output an set to the correct level. But that will probably be difficult to probe because RST is probably driven only 1 time when the code starts. Debugging such things is easier if you change the software a bit to toggle the line contentiously.

author: Moriambar
author_rank: Unknown
timestamp: May 18, 2024, 12:39:18 pm
content: sorry guys.As usual the problem was between the chair and the keyboard. I uploaded the wrong sketch. Now all is fine and dandy
STM32F 5V to open drain pin - Page 1
Forum section: electronics / beginners

author: Vindhyachal.takniki
author_rank: Frequent Contributor
timestamp: April 23, 2015, 12:59:22 pm
content: 1. I am using stm32f205.2. MCU is powered by 3.3V.3. Another ic pin is driven by 5V logic or (Vih = 0.7*VDD = 3.5V)4. Can I set pin of STM32F2 as open drain & connect 5V by pull up to it.5. Datasheet of MCU says that they are not true open drain pins.

author: mrflibble
author_rank: Super Contributor
timestamp: April 23, 2015, 01:11:30 pm
content: The pins marked as 5 Volt tolerant (FT) should be able to act as an open drain connected to a 5 Volt rail. As long as you use an external pullup (as opposed to the internal weak pullup), and keep the current limited you should be fine.
STm32F205RBt6 as USB Host, interfacing code for pen drive - Page 1
Forum section: electronics / beginners

author: Vindhyachal.takniki
author_rank: Frequent Contributor
timestamp: December 07, 2017, 05:18:43 am
content: 1. Need to interface pen drive with stm32f205rbt6 for logging data in text file in pen drive.2. Generated code from stm32cube & link for total code is here:https://drive.google.com/open?id=1oJSXOmWXzn_xduLmcJWXdiNxtMTpdmtP3. Made changes in fatfs.c file generated as below.4. Problem is code always struk in if(FR_OK != res) & return disk_error always. What error I am doing.5. is there any example code for STM32F2 using pen drive for storage purpose to see exactly where changes are to be made.Code:#include "fatfs.h"uint8_t retUSBH; /* Return value for USBH */char USBHPath; /* USBH logical drive path */FATFS USBHFatFS; /* File system object for USBH logical drive */FIL USBHFile; /* File object for USBH */FRESULT res;/* USER CODE BEGIN Variables *//* USER CODE END Variables */void MX_FATFS_Init(void){/*## FatFS: Link the USBH driver ###########################*/retUSBH = FATFS_LinkDriver(&USBH_Driver, USBHPath);/* USER CODE BEGIN Init *//* additional user code for init *//* USER CODE END Init */res = f_mount(&USBHFatFS , USBHPath ,0U);if(FR_OK != res){while(1);}res = f_setlabel("DATA DISK");if(FR_OK != res){while(1);}res = f_open(&USBHFile, "/_SERIAL.txt", FA_OPEN_ALWAYS);if(FR_OK != res){while(1);}}/*** @brief Gets Time from RTC* @param None* @retval Time in DWORD*/DWORD get_fattime(void){/* USER CODE BEGIN get_fattime */return 0;/* USER CODE END get_fattime */}
STM32F407 update PWM duty cycle after complete PWM period only - Page 1
Forum section: electronics / beginners

author: Vindhyachal.takniki
author_rank: Frequent Contributor
timestamp: May 18, 2020, 02:56:15 pm
content: I have made a code for PWM for STM32F407. It is working fine for generating PWM.1. Currently what happens is I have made a PWM period of 5seconds in total.2. Suppose in code I call TIM_SetCompare2(TIM9 , 32767), now outout will be 2.5 seconds on & 2.5 seconds off.where 32767 is 50% duty cycle, & 65535 is 100% duty cycle.3. Now suppose on time of 2.5seconds is running & I suddenly change TIM_SetCompare2(TIM9 , 10000), it will now be roughly 15% on and 15% off.This happens even if previous 2.5 duty cycle was running4. I want that next compare value updates only after completion of first compare match cycle.5. I have no way to sync both, because compare value is coming from a another setup at random stage, & when a new compare value comes, I have to set a display to user, and it should run for that compare cycle only, not to get updated by new compare cycle.6. How to do it?Code:void initialize_pwm(void){uint16_t Channel2Pulse = 0U;GPIO_InitTypeDef GPIO_InitStructure;TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;TIM_OCInitTypeDef TIM_OCInitStructure;/* GPIOA Configuration: Channel 2 as alternate function push-pull */RCC_AHB1PeriphClockCmd( RCC_AHB1Periph_GPIOA , ENABLE);GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3;GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP ;GPIO_Init(GPIOA, &GPIO_InitStructure);GPIO_PinAFConfig(GPIOA, GPIO_PinSource3, GPIO_AF_TIM9);/* TIM9 clock enable */RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM9 , ENABLE);/* Time Base configuration */TIM_TimeBaseStructure.TIM_Prescaler = 12816U;TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;TIM_TimeBaseStructure.TIM_Period = 65535;//PWM_PERIOD_VALUE;TIM_TimeBaseStructure.TIM_ClockDivision = 0;TIM_TimeBaseStructure.TIM_RepetitionCounter = 0;TIM_TimeBaseInit(TIM9, &TIM_TimeBaseStructure);/* Channel 2 Configuration in PWM mode */TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM2;TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;TIM_OCInitStructure.TIM_OutputNState = TIM_OutputNState_Disable;TIM_OCInitStructure.TIM_Pulse = Channel2Pulse;TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_Low;TIM_OCInitStructure.TIM_OCNPolarity = TIM_OCNPolarity_High;TIM_OCInitStructure.TIM_OCIdleState = TIM_OCIdleState_Reset;TIM_OCInitStructure.TIM_OCNIdleState = TIM_OCIdleState_Reset;TIM_OC2Init(TIM9, &TIM_OCInitStructure);/* TIM9 counter enable */TIM_Cmd(TIM9, ENABLE);/* TIM9 Main Output Enable */TIM_CtrlPWMOutputs(TIM9, ENABLE);TIM_SetCompare2(TIM9 , 32767);} /* function ends here */
STM32F411 ADS7056 and how to make them friends - Page 1
Forum section: electronics / beginners

author: bobAk
author_rank: Contributor
timestamp: December 19, 2020, 12:33:22 pm
content: Hello. For this ADC, the documentation say 18 spi clocks. STM32F411 has 8- and 16-bit data frames. How to do it correctly?Checked the recive data in two 8-bit packets.Code:SPI1->DR = 0x00;while(!(SPI1->SR & SPI_SR_BSY));r1 = SPI1->DR;SPI1->DR = 0x00;while(!(SPI1->SR & SPI_SR_BSY));r2 = SPI1->DR;Works, returns valid data.How correct is this? Or are there any problems that I don't notice?I am a beginner with mcu.Best regards, Boris.

author: Siwastaja
author_rank: Super Contributor
timestamp: December 19, 2020, 01:02:54 pm
content: Beware of ancient and too simplistic MCU SPI peripherals that do not support proper set of arbitrary datagram sizes.Alternatively, beware of weird SPI slave devices requiring transaction lengths not multiple of 8.SPI datagram lengths not multiples of 8 are surprisingly common. On MCU side, you would like to see at least 4..16 bit options with 1 bit increments. FIFO mode is a big plus. Working nCS-controlled-by-peripheral is even bigger plus, but STM32 always fails this anyway.The only way left is to bit-bang, or choose a suitable microcontroller, or choose a suitable ADC (quite frankly, I wouldn't put all the blame to the ST; it's a stupid idea to require 18 clock cycles knowing half of the world's microcontrollers are unable to do it.).More modern devices in STM32 family support 9-bit datagrams so you can create 18-bit datagram by writing two 9-bit words in succession.If the slave happens to work with illegal transfer length (16 or 24 bits) by accident, then you are lucky.

author: bobAk
author_rank: Contributor
timestamp: December 19, 2020, 03:01:36 pm
content: Thanks for the answer. So I thought correctly. We'll have to lower the resolution and use the ADS7886SB.Best regards, Boris.
STM32G0 Series power supply - Page 1
Forum section: electronics / beginners

author: LordyVader
author_rank: Newbie
timestamp: January 29, 2021, 02:03:47 pm
content: Hello everyone,I'm working on a project and have one dilemma with data from the datasheet.I have issue understanding how to implement this 1x100nF + 1x4.7uF into my design. I figure out it is for decoupling filtering with ceramic capacitors. Here is my schematics so maybe can someone tell me if this is all I need or have to add something more.And addition question, what should I do with unused pins on MCU, just leave them not connected?Datasheet I'm referring to is:https://eu.mouser.com/datasheet/2/389/stm32g081cb-1600850.pdfThanks in advance for all the help, I'm a mechanical engineer who has to do some electrical engineer job so don't be hard on me if these are the basics.

author: Manul
author_rank: Super Contributor
timestamp: January 29, 2021, 03:58:45 pm
content: According to the datasheet you should add 100nF capacitor in parallel with 4.7uF. Physically it needs to be very close to MCU. As short connection to VDD and VSS as possible, especially the 100nF one.If unused pins are port pins (GPIO), then I recommend to leave them unconnected and set them up as inputs with pullup in software. Or outputs and drive low/high. If the pin is specific function pin - consult the datasheet, maybe it needs external pull-up, pull-down, etc.

author: pigrew
author_rank: Frequent Contributor
timestamp: January 29, 2021, 04:34:58 pm
content: From what I've seen, ST recommends a 100 nF decoupling cap for each VDD pin. The 100 nF should be as close as possible to each pair of VDD and VSS pins. The larger bulk capacitor can be further away. See section 5.4 of the below linked app note for suggested routing.ST mentions what to do with unused pins in their "getting started with hardware development" app notes.AN5096states that for the STM32G0 you should have all pins either externally pulled up or down, or internally pulled up or down, or set to be an output. Other MCU models have slightly different constraints (like suggesting to externally tie oscillator pins high or low).The purpose forcing outputs high or low is to reduce the power consumption of the IC. Pins are always internally connected to the input of an inverter (CMOS nMOS and pMOS pair). These inverters can leak high currents (shoot-through) if the input voltage is around (Vdd/2), hurting power consumption. Forcing a digital I/O pin to be high or low is always a good idea for all MCU. Don't let them float. (analog I/O pins are designed differently, as analog values are expected to be in between GND and Vdd).In practice, I generally leave the unused pins not connected on the PCB and use software to enable a pull-down. This lets me use them for unplanned purposes if the need arises.(Read the rest of the app note, too. You'll probably want to connect the nRST pin to a decoupling cap. Also, add a pull-down resistor on PA14-boot0 to set a default boot mode.)

author: LordyVader
author_rank: Newbie
timestamp: January 29, 2021, 04:52:38 pm
content: @Manul and @pigrew thank you very much. Your answers are very helpful.