Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Rexxed posted:

Either will work fine (as long as you set the jumper on the latter to 3.3v). I've got a couple of $3 ebay USB adapters I use that work fine. The breakout has lines for CTS and DTR which I haven't used in arduino stuff but are serial control lines:
https://en.wikipedia.org/wiki/RS-232_RTS/CTS#Data_and_control_signals

For just programming microcontrollers it shouldn't matter. The only real difference is the breakout will work with 5v devices as well, but you have to provide your own cable and jumper wires to hook it up to the microcontroller.

Thanks! I think DTR/CTS are used to trigger device reset after reprogramming, or something?

Adbot
ADBOT LOVES YOU

Splode
Jun 18, 2013

put some clothes on you little freak

Dominoes posted:

Got another pair of questions re STM32 board design:

Ordered this ST-Link/SWM board to flash things.

# 1: What's your fav technique for being able to flash the board, but not cluttering it up? Through-holes you can put non-solder headers through temporarily?

At my work we use the TC2050 programming header for this

Rexxed
May 1, 2010

Dis is amazing!
I gotta try dis!

Subjunctive posted:

Thanks! I think DTR/CTS are used to trigger device reset after reprogramming, or something?

Oh yeah, DTR is used for reset.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
Careful with that. It's actually RTS and DTR that are used with ESP programming, and not everything breaks those out.

Additionally most devices use a special signaling method with them that require a couple BJTs to do the thing.

You can get around that with a different programming method, but most things don't do that by default

Gromit
Aug 15, 2000

I am an oppressed White Male, Asian women wont serve me! Save me Campbell Newman!!!!!!!
It's not like I expect anyone to look at this and see the problem, but I'm hoping you might be able to suggest things to try for someone who is a true amateur with a soldering iron and multimeter.
Here's the PCB from a cheap and nasty wine fridge that uses a peltier:



It has stopped cooling, and the leds on the front just flash rapidly, and the segmented temp display flickers gibberish. I'm assuming that the electronics are very simple, seeing as it just checks the temp and turns the peltier and 12V fan on or off as needed to match the set temp.

Any ideas where I could start looking? I've taken the board out and nothing looks burned and none of the solder joints on the rear look flaky. I'm thinking I could unplug all the fans/peltier and check what voltage the board is supplying to them. If it isn't 12V then I could trace that back to find where the issue may be? I suppose I'd have to check all the components in that chain though. If the voltages are good then because the leds are going weird maybe the chip/logic stuff is dead?

I'm assuming that most the board is power supply, and the few chips there are handling the temp control? I could trace where the lines to the leds are coming from and see if that's a part I can test or replace? I think I might be out of my depth, though, if it isn't an obvious burned-out part.

poeticoddity
Jan 14, 2007
"How nice - to feel nothing and still get full credit for being alive." - Kurt Vonnegut Jr. - Slaughterhouse Five
The electrolytic capacitor on that board labeled C9 is tilted at an angle.
Normally, I'd ignore that, since it's often done intentionally to reduce the standoff height of components so you can use a tighter enclosure.
In this case, all of the other electrolytic capacitors are 90 degrees to the board and several of them are bigger (specifically taller) caps.

So I'll ask the dumb question: Is there any visible damage to that cap on the underside or to its connections?
Once in a blue moon I've run into caps that got handled too roughly and a lead came out or dislodged a cold-soldered joint.

Also, there's one IC in a socket. Is that firmly seated?

mobby_6kl
Aug 9, 2009

by Fluffdaddy

Subjunctive posted:

I’m looking for a USB serial adapter to attach to the programming pins (UART?) of an ESP device. It wants 3.3V/GND/TX/RX per https://esphome.io/cookbook/h801.html — is this cable what I want? I’m pretty sure I want TTL serial, but I’m not sure about the FTDI references. Should I get a breakout like this instead? (Whatever I get I’ll get in both 3.3 and 5 variants I think, since it seems like there’s lots of stuff on both sides of that divide.)
I use this one now, it does have a 5/3v jumper: https://www.aliexpress.com/item/32831329095.html?spm=a2g0s.9042311.0.0.27424c4dZp9UpY
But in an emergency I also used an older 5V arduino programmer and the ESP survived just fine.



karoshi posted:

I'm currently (trying) to build an i2s phased array on a breadboard. The bit clock is a pain (1MHZ up to 4 MHZ) and gets horrible munched between the generator and the MEMS microphones and the USB adapter. Make sure your clock and WS/FRAME/LR line is as clean as possible. I still can't get it to work. Breadboards might not be that great for >1MHz signals, specially since the clocks come from another device over 15cm antennascables, and the USB adapter uses the same antennascable length.
Everything's on a beadboard with short jump wires, but yeah this might be an issue.

Forseti posted:

Yeah 1MHz is about the limit for a breadboard according to rule of thumb. Dave from EEVBlog talks about it (in typically long winded fashion) in this video:

https://www.youtube.com/watch?v=6GIscUsnlM0

The gist is that a breadboard has a really high stray capacitance compared to, say, a PCB which in turn limits your circuits ability to change fast enough to keep up with faster signals. This is compounded by the fact that it's probably also covered in little antennas from the hookup wires which pick up lots of noise.

Working with signals is very difficult without a good oscilloscope (meaning at least the Rigol/Siglent level) and they're unfortunately not exactly inexpensive.

Sometimes you might find someone getting rid of an older analog oscilloscope for pennies on the dollar on craigslist or something. These are actually really great I think for understanding what's going on in the circuit because you sort of get to see a raw picture of what's going on and are a great thing to play with for your own education. Unfortunately they're not NEARLY as useful as a modern digital storage oscilloscope (especially for digital signals) because you can't pause the picture and zoom in. This is one of the reasons for test signals like the good ol' SMPTE color bars which produces a repeating signal that you can see more easily on an analog scope.

I managed to get myself an Agilent 54622d for ~$150 and I really love it but I had to save a search on eBay and keep an eye out for like 6 months to get it. However, it's also about 20 years old and I had to replace a battery inside that allows it to actually save its settings/calibration and there's a good chance I'll need to replace things like capacitors before too long. It's also massive compared to a modern scope like the Rigol and it has a loud fan, but I used an older HP scope at my first job and love the interface.

Another useful tool for understanding what may be going on is playing around in MATLAB (or if you're a cheap bastard like me, GNU Octave) and making simulations. However this is probably only useful if you're already comfortable in these programs or willing to learn. Still, I'm glad to have taken the time to learn because I use Octave all the time now for various things.
I haven't really considered that the breadboard might be the issue. That guy has it working with pretty much an identical setup : https://www.youtube.com/watch?v=m8LwPNXqK9o but certainly, a slightly dodgier board or wires could make the difference I suppose.

I don't have a scope but only a logic analyzer, but the data looked... ok? I'm pretty clueless though so :shrug:


I've used Matlab and Octave before, that's not an issue, the problem is I know nothing about analog signals lol.

Forseti
May 26, 2001
To the lovenasium!
I don't know that it is working in the video though? I mean he shows a square wave that isn't square half the time and it's "working" because it changes when he blows on it which is pretty much random noise to begin with.

I haven't really played a ton with i2s myself but it looks like it doesn't have any error detection and different impedance between various lines can cause issues:

wiki posted:

The I²S connection was not intended to be used via cables, and most integrated circuits will not have the correct impedance for coaxial cables. As the impedance adaptation error, associate with the different line length, can cause difference of propagation delay between the clocks line and data line, this can result in synchronization problem between the SCK, WS and data signals, mainly at high sampling frequency and bitrate. As the I²S doesn't have any error detection mechanism, this can cause important decoding error.

What was the original goal? Just to read the ESP32's internal ADC and output that value on the i2s bus? I think it might be best to start simple, so like maybe hook a potentiometer up to the ADC input and see if you get the i2s interface sending the same value over and over first, then go from there.

syntaxrigger
Jul 7, 2011

Actually you owe me 6! But who's countin?

I have been on the fence for a few years about becoming a filthy electronics hobbyist. It was my original major in college and I love the idea of robot pets, arms, and drones.

In the past when I have looked into this, from the outside looking in, it seems super expensive. Like every new project starts at a $100+ and often exceeding this.

Am I missing anything to getting started? Is there a trick to experimenting and fooling around with robots on the cheap? The only thing I have going for me is I know how to write poo poo code in a few languages.

The sort of direction I would like to head towards for projects is kind of a cross between Adam Savage and James Bruton. Storytelling with robotic sculptures if that makes sense.

Anyways I know this is a dumb post but I'd appreciate any guidance.

Dominoes
Sep 20, 2007

inspiration?

Be more specific. Default answers are buy a microcontroller or SBC, and try to make it interact with the environment via lights, actuators, buttons, sensors relays etc.

You can find modules for this sort of thing on Amazon, Adafruit, Sparkfun etc.

Forseti
May 26, 2001
To the lovenasium!
Pololu has some cool stuff too: https://www.pololu.com/category/240/ti-robotics-system-learning-kit-max-ti-rslk-max-parts-and-accessories

Robots are in general not particularly cheap though, they simply have a ton of parts and things like motors are pretty expensive as electronics components go. A lot of the IC manufacturers make kits to convince you to buy their stuff. The TI one is the one I could remember off the top of my head but I'm pretty sure I've seen similar things from other manufacturers.

Goldmine Electronics has some cheaper robot kits but they're probably not nearly as easy to learn from: https://www.goldmine-elec-products.com/products.asp?dept=1340

Lego Technic is cool but again tend to be fairly expensive.

Stack Machine
Mar 6, 2016

I can see through time!
Fun Shoe

Gromit posted:

It has stopped cooling, and the leds on the front just flash rapidly, and the segmented temp display flickers gibberish. I'm assuming that the electronics are very simple, seeing as it just checks the temp and turns the peltier and 12V fan on or off as needed to match the set temp.

One piece of advice that has proven true time again for me is the 0th commandment: thou shalt check thine power supply. Your ICs will all have datasheets that will tell you which pins are supplies. You can check their DC values and AC values with a multimeter. Probing on that board while it's running is it's own :can: though. Find a way to probe it without touching it while it's plugged in if you can or use an isolation transformer if by some chance you have one. If the DC value is reasonable and the AC value is 0 your power supply is OK and you're in for suffering. If the AC value is high start checking caps. If the DC value is 0 something in the supply is dead.

"But it powers up" you say. There is likely more than one supply voltage on this board. It's possible only one has failed.

syntaxrigger
Jul 7, 2011

Actually you owe me 6! But who's countin?

Dominoes posted:

inspiration?

Be more specific. Default answers are buy a microcontroller or SBC, and try to make it interact with the environment via lights, actuators, buttons, sensors relays etc.

You can find modules for this sort of thing on Amazon, Adafruit, Sparkfun etc.

Simone Gerts is certainly an inspiration, but she is a budding has been( her latest vid) and I am a never was. I didn't grow up with a lot of money and so I am afraid to spend it so $2-300 for a project every few weeks feels like a lot.

I know myself well enough to know that I learn best through having a project. The trick is not to pick something so ambitious that I run into a billion problems and get overwhelmed while still being neat enough to finish. So I have seen some books and projects online but the components are usually around $30 to $40 a pop for a project. Or $60 to $80 for a robot arm kit. Even more for something already assembled. That feels like a lot to learn one of the million lessons I will probably need to try out my dumb ideas.

An Example,
My latest dumb idea I had with a friend was 2 robot arms that would detect the color of an array of lights and play a board game. The lights correspond to moves and also tells who is watching what move is being executed. To my layman's thinking that is 2 robot arms, an Arduino of some kind to control them, a raspberry pi to run the server, some sort of sensor detection for the arms(to see the lights).

But maybe I just need to explore one robot arm and do stupid things with it before I try to do anything ambitious. I was just curious how others managed the expense of electronic components and if there was something I was missing about keeping the cost down.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
Your question / goals are really too vague to answer in a meaningful way.


I spent an afternoon building a junk bin remote control car the other day.


Tools:

Soldering iron, $80 (but I've owned it for a decade)
Glue gun, $20 (but came in a pack of other tools I got for free)


Materials:

An ESP32 dev board, $7
2 x geared DC motors with wheels, $11 (actually I might have laser cut the wheels myself a year or two ago)
1 x castor, $2
1 x dual motor driver breakout, $2
1 x four AA battery pack and batteries, $5
assorted wire, essentially free
cardboard, literally free

Hot glue it all together, and you have a completed project.

It's not pretty, intentionally so, but it drives around over WiFi. It was not expensive, but I also had literally everything I needed kicking around, from extras from old projects.




And then on the other hand, I have a CNC gantry I'm building, and each of the three stepper motors would cost $40, so that one could get quite expensive. I managed to scavenge them from an old 3D printer that was being thrown out, though, so they didn't cost me that.


edit: To go into more details about your project:


If you've been doing this for any length of time, you'll already have a raspberry pi and an arduino-alike kicking around, so those costs won't matter. You'll repurpose them after this project is done, too. Robot arms are expensive, even crappy hobbyist ones, so that's not a great starting project maybe. Light sensor modules are less than $10 probably.

ante fucked around with this message at 18:22 on May 24, 2020

Forseti
May 26, 2001
To the lovenasium!
It's really difficult to minimize costs as a beginner and completely on your own, it's pretty easy to buy a bunch of inexpensive parts that are difficult to actually use or just turn out to not be the parts you really needed for your application because it can be difficult to interpret the specifications.

Maybe there's a maker space near you that might have some parts to experiment with and some people who can provide advice?

There might also be some classes at a community college or something although I guess that's probably not a thing these days unless it's online.

A 3D printer is basically a robotic arm if you happen to be interested in those as well. You could look at some of the open source designs and try to understand how they work as a starting point perhaps, there'll be a lot of resources online because of the popularity. Something like the Simpson is probably the closest to your idea of a robotic arm: https://reprap.org/wiki/Simpson

Edit: Actually, thinking of 3D printers reminded me that you come across robot designs constantly on thingiverse. A single robot arm is definitely considerably simpler than a 3D printer and some of the ones you can find on there are well documented. Such as this one: https://www.thingiverse.com/thing:1454048. While you might not want to build that one in particular you can at least see how they're put together.

Forseti fucked around with this message at 18:30 on May 24, 2020

Dominoes
Sep 20, 2007

syntaxrigger posted:

Simone Gerts is certainly an inspiration, but she is a budding has been( her latest vid) and I am a never was.
Yikes. I'll always adore her earlier videos, but the later ones, as you allude to, are more meta. I remember laughing uncontrollably at the first few lovely robot ones. Ah well.


Why can't you be? We pigeon hole ourselves too much. Our identites guards themselves. It appears to be an evolutionarily-inserted resistance that can be overcome. The potential's not vertical. Be.

Dominoes fucked around with this message at 18:37 on May 24, 2020

shovelbum
Oct 21, 2010

Fun Shoe

syntaxrigger posted:

Simone Gerts is certainly an inspiration, but she is a budding has been( her latest vid) and I am a never was. I didn't grow up with a lot of money and so I am afraid to spend it so $2-300 for a project every few weeks feels like a lot.

This is an important thing to note but there's a lot of money behind the big social media stars, often from very early on in their careers. Anyone can upload but the people going viral in a positive way are generally essentially professional productions. Some social media literally only promotes visibly rich people to keep you feeling this way lmao.

https://theintercept.com/2020/03/16/tiktok-app-moderators-users-discrimination/

syntaxrigger
Jul 7, 2011

Actually you owe me 6! But who's countin?

I appreciate the advice. Thank you. My main takeaway is that I seem to be ignorant of the workflow of how an electronics idea goes from idea to something you would show another person. So is there anything I can consume that would give me an idea of a sort of workflow? I assume the tried and true process is to just fail at stuff until you stop failing so much.

I am trying to stay away from any sort of thoughts about money making, video or otherwise, because that just kills it for me. The two youtubers I mentioned were more of a conceptional path not a literal steps to make money path. My main goal is to create based on ideas that resonate with me to express myself and share them with others. Not in a 'content creator' way in more of "person in my house let me show you this dumb thing" way, or shitposting on these here forums.

ante posted:

If you've been doing this for any length of time, you'll already have a raspberry pi and an arduino-alike kicking around, so those costs won't matter. You'll repurpose them after this project is done, too....
I get somewhat confused by this. So say you made an RC car that you liked and were attached to. Then you wanted to make a table that curses at you when you place something on it. Wouldn't you want to make the table without sacrificing any past projects. I get some projects are just for learning so who cares, but my perspective of 'poo poo seems expensive' is from the point of view that eventually I will make a thing and want it to keep being that thing so I will need to buy more parts to make any sort of new thing. Admittedly now that I am re-reading this that is probably further down the line than I think it is.

The rest of your post was helpful. I didn't realize you could use such small motors. I think I don't know how to make the sort of design decisions for prototyping/building stuff that does or roughly does what I want it to do and when I do research I only see these kits or components that seem expensive. Also I don't think I have a good understanding of the workflow, something I am sure thrashing about would probably go some distance to solving. Also I am probably using the term 'robots' loosely but I don't really have a better one for electronics + dumb idea. Also I like your cardboard car :)


shovelbum posted:

This is an important thing to note but there's a lot of money behind the big social media stars, often from very early on in their careers. Anyone can upload but the people going viral in a positive way are generally essentially professional productions. Some social media literally only promotes visibly rich people to keep you feeling this way lmao.

https://theintercept.com/2020/03/16/tiktok-app-moderators-users-discrimination/

This is a good point. While I DO know this it is helpful to be reminded and I should remind myself more often. Thanks

syntaxrigger
Jul 7, 2011

Actually you owe me 6! But who's countin?

Dominoes posted:

Yikes. I'll always adore her earlier videos, but the later ones, as you allude to, are more meta. I remember laughing uncontrollably at the first few lovely robot ones. Ah well.


Why can't you be? We pigeon hole ourselves too much. Our identites guards themselves. It appears to be an evolutionarily-inserted resistance that can be overcome. The potential's not vertical. Be.

I am not sure where the Yikes comes from or where the rest of this comes from. I don't want to be a 'content creator' I already have a job I don't like

Dominoes
Sep 20, 2007

Find your splinter.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

You've become an inscrutable koan generator.

Sagebrush
Feb 26, 2012

It sounds like you are genuinely a total beginner with very little knowledge of electronics (not a judgment at all, just trying to be accurate). I think you would be well served by picking up a soldering iron (and accessories), a multimeter, a couple of Velleman kits and an Arduino starter set and just following the directions for a while. Build yourself a line-following robot and learn the name of all the components and what they do and how to make basic circuits first. Once you have a sense of what's possible, you can start making decisions about building your own designs.

syntaxrigger
Jul 7, 2011

Actually you owe me 6! But who's countin?

Dominoes posted:

Find your splinter.

Lol oh man if only.

syntaxrigger
Jul 7, 2011

Actually you owe me 6! But who's countin?

Sagebrush posted:

It sounds like you are genuinely a total beginner with very little knowledge of electronics (not a judgment at all, just trying to be accurate). I think you would be well served by picking up a soldering iron (and accessories), a multimeter, a couple of Velleman kits and an Arduino starter set and just following the directions for a while. Build yourself a line-following robot and learn the name of all the components and what they do and how to make basic circuits first. Once you have a sense of what's possible, you can start making decisions about building your own designs.

That is accurate. I can write lovely code that is good enough for people to pay me but beyond that I know nothing of the process of electronics and probably have a romantic sci-fi notion of what "building robots" really is. I have no tools which I forgot to mention, and contributes to my sticker shock, especially since I am not sure if I'd even stick with it.

The maker space near by seems high at 30 bucks a month but I guess if I was diligent at making the most of my subscription I'd find out quickly if I wanted to stick with it and not have the tool buy in. This would also be post pandemic which who knows if maker spaces even survive that.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS

syntaxrigger posted:

I get somewhat confused by this. So say you made an RC car that you liked and were attached to. Then you wanted to make a table that curses at you when you place something on it. Wouldn't you want to make the table without sacrificing any past projects. I get some projects are just for learning so who cares, but my perspective of 'poo poo seems expensive' is from the point of view that eventually I will make a thing and want it to keep being that thing so I will need to buy more parts to make any sort of new thing. Admittedly now that I am re-reading this that is probably further down the line than I think it is.

In terms of "Arduinos", I guess repurposing isn't really necessary. Doing a rough estimate, I probably own 15 or 20 dev boards that could run Arduino. Of them, a handful cost less than $5, most of them cost less than $15, a bunch were free, and I think two were in the $30 range.

I also have at least three Raspberry Pis, and at least 5 other similar single board computers. So, I would always have something available to throw into a project, forever. But I find that after I've gotten the endorphin hit of the completed project, and show it to a few people, I lose interest and take it apart. Additionally, most things you think you need a RasPi for, are you sure you do? The Wi-Fi enabled microcontrollers can send / receive data to The Cloud (wherever it's located), and a lot of those same microcontrollers are surprisingly powerful, too.


That still sounds like I've dumped a lot of money into materials. I guess counting all that up works out to several hundred dollars, but I've been accumulated for a decade. How much money have you spent on toilet paper, in that time, for example?

Dominoes
Sep 20, 2007

Thermopyle posted:

You've become an inscrutable koan generator.
I've learned from a venerable teacher.

Syntax - Buy this. Once it arrives, make the LEDs blink. Google things until they do. Make them blink faster if it's brighter in the room. If you get stuck, post here.

Once you're done with that, you need to look out for your own safety. Turtles dry out if the humidity gets too low! Like a salted slug. If relative humidity drops to below 30%, turn on a yellow light. If it goes below 20%, turn on a red LED, sound an alarm, and wrap yourself in damp toilet paper until help arrives.

Oh, and make sure you can disable the warning with a button once you get the all-clear.

Dominoes fucked around with this message at 23:10 on May 24, 2020

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
Changing topic completely:


All those youtube stars of old seem absolutely miserable now.


When your entire livelihood lives and dies by "The Algorithm", you're not even building projects you want to do anymore. You're just a content-generating slave. With no other marketable skills, to boot.

Most of them seem to be in a tailspin now, it's depressing to see.

syntaxrigger
Jul 7, 2011

Actually you owe me 6! But who's countin?

Dominoes posted:

I've learned from a venerable teacher.

Syntax - Buy this. Once it arrives, make the LEDs blink. Google things until they do. Make them blink faster if it's brighter in the room. If you get stuck, post here.

Once you're done with that, you need to look out for your own safety. Turtles dry out if the humidity gets too low! Like a salted slug. If relative humidity drops to below 30%, turn on a yellow light. If it goes below 20%, turn on a red LED, sound an alarm, and wrap yourself in damp toilet paper until help arrives.

Oh, and make sure you can disable the warning with a button once you get the all-clear.

Thanks for the recommendation !

Cojawfee
May 31, 2006
I think the US is dumb for not using Celsius
The workflow is whatever you want it to be. Look at what other people have done for similar projects and just see where it goes and try things until it works. If it works and meets your requirements and doesn't burn your house down, you did it right.

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS
The output of some of those youtube people is insane, too. Remember that it's usually a fulltime job for them, and they'll also outsource any kind of video editing or anything else they can do.


That 25 second montage of them laying out a PCB probably took three days, but they don't show that 'cause it's boring.

shovelbum
Oct 21, 2010

Fun Shoe
Right now I've been on an extended vacation during a pandemic where I can't really go do anything, working on my hobbies A Lot, and I have been messing around with one mechanical assembly for several weeks. Getting something right to where you want it around your house is a lot different from getting something thrown together for a ten minute video.

Dominoes
Sep 20, 2007

Please, for the love of god, commit the Three Laws to heart before proceeding on any of these projects. I recommend reciting them in your head while brushing your teeth. Once you're through each law thrice, you can rinse.

shovelbum
Oct 21, 2010

Fun Shoe
One thing I will say is I never got in to the more mechanical side of the electronics hobby until I got a 3d printer. Need a gear? Print a gear. Need a little robot arm piece? Print one. $0.60 RC car motor I saw somewhere? Print a mount and put it to work. Enclosures? Print. They were lovely and overhyped 5 years ago or whatever but the modern ones are pretty mature and can really expand your horizons on the cheap in a small space and let you deal with a lot more random cheapo parts because you can mate them together easily.

Stack Machine
Mar 6, 2016

I can see through time!
Fun Shoe
Re the cost of an electronics hobby, electronic components and assemblies for low power are very inexpensive and projects including them usually have a huge chunk of engineering effort but a tiny chunk of overall unit cost wrapped up in the electronics.

There are electrical and electromechanical things that are not electronic * (motors, solenoids, speakers, switches, etc.) and these can get pricey fast, but the electronics themselves are usually the cheapest part of a project, unless you're using high-end FPGAs, RF power amplifiers or something else exotic. An electronics hobby can be quite cheap but it's adjacent to a lot of expensive things. It's certainly not the electronics that make drones, robots, CNC machines, or whatever else expensive to build. These things are expensive even without the control boards. There are a ton of purely electronic projects to do, i.e. projects where the components are just semiconductor products and the few passive components required to make them function, but they're severely limited in scope by the fact that they can only interact with the physical world by sending signals down a wire, producing light, or changing a pattern on a display.

* I don't know if the distinction between "electrical" and "electronic" has been covered recently in this thread, but semiconductors or vacuum tubes are "electronic" and basically everything else powered by electricity is "electrical". ICs in particular are mass produced and tiny and thus cheap as hell despite their complexity.

Dominoes
Sep 20, 2007

Btw, do y'all have any recommendations for how to read and write small amounts of data using an STM32? Ie reading and writing a handful of numbers to a config "file" during program operation. Am I looking for Flash memory? DMA? SRAM? I can probably find an appropriate HAL lib once I know where to start.

Dominoes fucked around with this message at 00:28 on May 25, 2020

Forseti
May 26, 2001
To the lovenasium!

Dominoes posted:

Btw, do y'all have any recommendations for how to read and write small amounts of data using an STM32? Ie reading and writing a handful of numbers to a config "file" during program operation. Am I looking for Flash memory? DMA? SRAM? I can probably find an appropriate HAL lib once I know where to start.

Get an SPI flash like the Winbond W25 series that's in just about everything. I got 50 of these last time I ordered from LCSC: https://lcsc.com/product-detail/FLASH_Winbond-Elec-W25Q64JVSSIQ_C83140.html

Beware that LCSC is actually more expensive for the larger sizes than Mouser is. But for the 8MB size like that one that's super common in Chinese eBay specials, they're like half the price.

Alternatively an SD card can also be interfaced with via SPI.

Spatial
Nov 15, 2007

Dominoes posted:

Btw, do y'all have any recommendations for how to read and write small amounts of data using an STM32? Ie reading and writing a handful of numbers to a config "file" during program operation. Am I looking for Flash memory? DMA? SRAM? I can probably find an appropriate HAL lib once I know where to start.
For nonvolatile memory NOR SPI flash is your basic goto. If it's extremely infrequent access you can probably use the flash memory in the actual chip but there are a lot of caveats there.

Also, earlier you were wondering about the SWO pin on the SWD debug interface. This is normally used as a low-overhead debug console output that prints directly in an IDE window. It's nice to have.

Dominoes
Sep 20, 2007

Much appreciated!

Looks like I can use This HAL lib and This $0.85 memory chip. (As you pointed out, it looks like you can get them for ~.30 - .40 on Digikey, including in those scary packages with hidden pads!). I'd assumed I could use on-chip memory, but if this is easier: sure, why not.

Given I'm using another SPI hardware piece on the board, Is is OK to put this on the same SPI device, or do I need to use a diff/dedicated one?

Appreciate the SWO tip. I'll see if I can figure out how to connect it; if this is a pain, I'll skip it.

Looks like I'll have to actually learn to write/read direct to memory here; something I've dodged thus far. Ie I can't just write

code:
{
    setting1: 0,
    setting2: 2,
    setting3: 0.123
}
to file

Dominoes fucked around with this message at 01:14 on May 25, 2020

Foxfire_
Nov 8, 2010

Dominoes posted:

Btw, do y'all have any recommendations for how to read and write small amounts of data using an STM32? Ie reading and writing a handful of numbers to a config "file" during program operation. Am I looking for Flash memory? DMA? SRAM? I can probably find an appropriate HAL lib once I know where to start.

Depends on what you want to do.

Types of storage:
- SRAM: Very fast. Won't hold values without power
- DRAM: Fast. Only holds values for small times even with power. Used with a controller that is constantly rereading and refreshing data. (This is the kind that is the main memory on a PC)
- EEPROM: Slow. Doesn't need power. Limited number of writes.
- NOR flash: Slow reads, very slow writes. Doesn't need power.
- NAND flash: Like NOR flash, but all reads/writes/erases happen on enormous blocks instead of bytes. Also needs ECC because bit errors are normal and frequent.
- Battery Backed RAM: Take a SRAM and a battery, add some circuitry to switch the power source to the battery when main power goes away. Holds values as long as battery lasts
- nvRAM: Take a SRAM, some flash, and a capacitor, add some circuitry to copy flash->SRAM on powerup and SRAM->flash on loss of main power using capacitor power.
- MRAM/FERAM/ReRAM: Various fancy technologies for fast byte-addressable memories that don't need power to hold values. Typically looks like a SRAM, but the values magically don't go away.

Things you are maybe confused about?
- DMA = Direct Memory Access = a peripheral is reading/writing to memory directly without going through the CPU. Like an ADC could be independently saving samples into a RAM buffer for the CPU to look at later instead of the CPU having to read each sample as it happens. Not directly related to nonvolatile storage.

Things you already have inside the microcontroller (probably, I am going off of what's in a STM32F7 because that's what I use at work):
- A section of RAM that can be powered from an external battery. If you supply battery and turn it in, it will appear as a region of memory that holds its values across power cycles. It is as fast as other RAM, it is not big, and goes away when the battery does. A reasonable sized coin cell can run this for a few years. Look in the power controller section of the reference manual.
- A whole bunch of NOR flash memory. This is what is holding the program code its running from. You can also read and write data to here at runtime. Look in the embedded flash controller section of the reference manual

Ways to attach an external storage chip on a STM32:
- I2C/SPI: Access it as a generic serial device. This is slow and only the CPU will be able to access it (no DMA), but that's fine for lots of stuff
- Flexible Memory Controller: This can interface to a bunch of different memory types. You configure it with timings, bus widths, what enables should go, etc... and it implements read/writes to some address range as external memory accesses.
- QuadSPI controller: Similar to the generic SPI controllers, but supports multiple data bits per clock and map address ranges into SPI acceses.

Foxfire_ fucked around with this message at 01:15 on May 25, 2020

Adbot
ADBOT LOVES YOU

ante
Apr 9, 2005

SUNSHINE AND RAINBOWS

Stack Machine posted:

Re the cost of an electronics hobby, electronic components and assemblies for low power are very inexpensive and projects including them usually have a huge chunk of engineering effort but a tiny chunk of overall unit cost wrapped up in the electronics.

There are electrical and electromechanical things that are not electronic * (motors, solenoids, speakers, switches, etc.) and these can get pricey fast, but the electronics themselves are usually the cheapest part of a project, unless you're using high-end FPGAs, RF power amplifiers or something else exotic. An electronics hobby can be quite cheap but it's adjacent to a lot of expensive things. It's certainly not the electronics that make drones, robots, CNC machines, or whatever else expensive to build. These things are expensive even without the control boards. There are a ton of purely electronic projects to do, i.e. projects where the components are just semiconductor products and the few passive components required to make them function, but they're severely limited in scope by the fact that they can only interact with the physical world by sending signals down a wire, producing light, or changing a pattern on a display.

* I don't know if the distinction between "electrical" and "electronic" has been covered recently in this thread, but semiconductors or vacuum tubes are "electronic" and basically everything else powered by electricity is "electrical". ICs in particular are mass produced and tiny and thus cheap as hell despite their complexity.

Where do you live, out of curiousity?


That's a distinction that I have vaguely heard from people in other countries, but doesn't exist in Canada as far as I can tell.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply