Previous Thread: >>2973477Here we discuss microcontrollers (MCUs), single board computers (SBCs), and their accessories, such as Atmel mega and tiny AVRs (Arduinos), PICs, ARM boards such as blue/black pill STM32, ESP8266/32s, RP2040, Raspberry Pi, and others.For general electronics questions (power supplies, level shifting, motor driving, etc.) please ask /ohm/.>where can I find verified quality microcontrollers and other electronic sensors or partsdigikey.commouser.comarrow.comnewark.com>but that's too expensivealiexpress.com (many parts here are fake, particularly specific parts out of stock in the above sites)lcsc.com>I need a part that does X and Y, with Z specifications. How can I find it?use DigiKey's or Octopart's parametric part search. Then purchase from one of the sellers listed above.>how do I get started with microcontrollers, where should I start?There is no defined starting point, grab a book and start reading or buy an arduino off ebay/amazon and start messing around. There are a plethora of examples online to get started.>resources:https://github.com/kitspace/awesome-electronics>RISC-V microcontroller list:https://codeberg.org/20-100/Awesome_RISC-V/raw/branch/master/RISC-V_MCU_development_boards.pdf
>>2999663>Nucleo.pngWhy are they still insisting on the out of date Arduino headers?They could produce their boards cheaper by making them long bois, remove the Arduino headers and give us a a single row of pins.Easy to do for the 64 variant, the 144 one would be a challenge since they would exceed standard breadboards / perfboards. Possibly just put the spare ones at the end.
>>2999761Idk. The fact that Arduino anything has become a standard is nothing but a hindrance.>bootloaders>using any programming interface that doesn't also allow for debugging>paying for programming hardware on each dev-board>UART printf debugging>dumbed down and non-performant programming abstractions>fuses being an afterthoughtAnd somehow they managed to release a dev-board with a socketed microcontroller, while having a native USB microcontroller on that same board explicitly to act as a programmer, while still requiring a bootloader on the socketed microcontroller. What the fuck?
I get an idea for a project, do some research, pats, schematics, software, looks challenging but doable. *checks price for key part* shiiiiit way too expensive. I want a sensor module that detects a narrow range of SWIR, the whole camera is like $5k, but if I look to buy the sensor, connector, board I might be able to get it for less, but then I do not have the case required to attach the lens, and I would need to have the power and POE connectors, are they plug in or need to solder, then loading software. I keep running to this issue where I think of a fun project and then its way too complicated and complex. How to get past these types of roadblocks?
>>3000029Learn a better intuition for what components of a project are specialty hardware and are likely to be expensive. Optical components usually fall under that category, unless you’re lucky and can find a band-pass filter for your IR wavelength to strap across a common optical sensor. Or want to make rugate filters at home like Applied Science did, man that shit is fascinating.
>>3000034>like Applied ScienceI will look into it.When I check some websites for the parts and its "call for quote" I know that shit is too expensive. I dont want to pay it in case it does not work as I anticipate, or I am too lame to get it to the finish line, but id I can get it to work I am confident I can make some good money with it.
Is the CH32V003 still the top choice for a dirt cheap microcontroller, with decent hobbyist-tier support?People still say it's 10 cents, but I'm finding at least double the price in most places (for 2 to 3 digit quantities). I've seen passing mention of a few other chips in the years since but don't know if any have seen wide adoption.
>>3000054The minimalist we act dev boards are like $2.xx. i think you can grab the chips for about $.20-$.30 in 10 packs direct from wch.
How do I make my cousin's hello kitty toy piano into a functioning MIDI keyboard with the rp2040?
how hard is slapping power, a microcontroller (the chip itself) and routing only the necessary pins for the project? is it achievable without a master's?
>>3000759Depends on how many board revisions you’re willing to accept. Probably going to take a month or two, either of learning the principles of electronics sufficient for designing an MCU board, or of brute force trial and error. Post your prospective schematics and board layouts here for anyone with spare time to critique if you want, the general is slow enough now that everyone can ask a clanker their embedded programming questions.
>>3000813>now that everyone can ask a clanker their embedded programming questions.And just like that, my years of experience are nothing special anymore.
>>3000816Hey I’ve been googling my way through arduino projects this whole time anyhow. Now it’s just faster.I think there’s still a lot of room to use your discretion to write efficient code, minimising clock cycles and/or memory usage, where the AIs trained on pajeetcode need to be really coached into doing so. Max this out by going to assembly language, or just specialising in an obscure architecture or subdomain. Perhaps getting the most out of the Parallax Propellor, or learning a specific RTOS, or going for state machine bullshit. End-game is VDHL or whatever.
>>3000824>state machine bullshitCome again?They take a lot less machine instructions than their apparent verbosity makes it look. Reading through one is like a well organized user guide. I have rarely seen one in the "wild" except the ones I write whenever I can if things get complicated and breadthy with if elses.
>>3001034Never attempted them before, they just seeem like another more obscure type of embedded programming, another way to differentiate your experience from slopcode. If I understand, they’re meant to be robust programs that can never get into an invalid state, though Im unsure how that works alongside interrupts or multiple cores or DMA. Actually seems quite fascinating, probably a lot of pencil and paper to work out a flow chart.
>>3000824Claude can do verilog without trouble.
>>3001041-state machine-interrupts-using DMAI assume thoughtful orchestration would be key. At first glance I'd consider putting values of variables inside of a LIFO from within the interrupt. State change code may refer to this queue when thinking of the variable's value.I too have not done it yet.
What's this talk about state machines? I only did explicit state machines in verilog.
>>3001103The main difference is that in Verilog you're describing hardware registers and combinational logic instead of software running on a CPU.The key difference is that the state variable in Verilog is a flip-flop (hardware), not a variable in RAM. Every clock edge physically updates that register.The biggest mindset shift is that everything in the combinational logic exists simultaneously in hardware, while the state register changes only on the active clock edge. That distinction—combinational logic versus clocked state—is fundamental to FPGA and digital hardware design.
>>3001165Thanks ChatGPT.So what do they mean by making a state machine in software? Defining an enum with a lot of states and having a huge switch statement that gets run all the time?
>>3001166>a lot>hugeHopefully not.But can you ask a better question?The C Programming Language uses an FSM by the way in one of its lessons on writing C.
>>3001173>But can you ask a better question?My question is just what they mean by using a "state machine bullshit" as if it's some novel, unusual concept. State machines are a fundamental concept, but just look at the conversation above and how it's in the context of AI.>The C Programming Language uses an FSM by the way in one of its lessons on writing C.Which chapter?
>>3001174Ritchie makes you write a program where you must check if code has matching opening parenthesises and closing ones. He proposes an FSM for it. The calculator exercises after that may also use one but I don't remember, it's been 10 years since I read it. Maybe chapter 6 or after that.Computer Design and Digital Architecture is where I saw it first. Little story at the time I wasn't focused and when we went through this chapter I didn't really get the concept and I regret it a lot. I later had an epiphany rediscovering the FSM with Ritchie's book. In the former book the FSM was looking at bits bit-by-bit trying to detect a sequence of bits. States may have been starting, initial detection and continuing to detect. 2 states. If it started to recognize a pattern it stayed in the latter state, if it saw a bit that didn't finish the pattern, it went back into the initial state. Something like that. At the time, the concept of drawing it on the board or on paper was very important, as it should be. There was also no code involved in that class.
>>3001174>what they mean by using a "state machine bullshit" as if it's some novel, unusual concept.Probably an anon wanting to get comfy and read opinions without googling about key CS concepts coming from other knowledgeable anons. I've been guilty of that in the past, I'd be the lat one to blame them for it.
>>3001103>>3001195Yeah just things I've heard of and inferred were sub-fields of embedded programming. Seems like state machines are useful when you want a very well understood system with no unforseen edge conditions, like traffic lights. Implementing these in direct logic gates is obvious, but it seems reasonable to extrapolate the concept to ASM on a microcontroller, where the program counter contains blocks of your finite states, and advances to different states with gotos or whatever as needed. Or a switch statement I suppose, but I don't know enough about how those compile to know how robust they are against glitches or whatever. It's probably fine, the compiler has never failed me so far.>>3001174>in the context of AIAIs probably have a harder time writing types of code they've seen less examples of. They should also be less trusted in these cases, because there's less examples of them being used in these fields. Both a more elongated sigmoid curve, and a sigmoid curve we're further back on. My conjecture is that you specialise in such a field, you're less likely to be obsoleted by AIs.
>>3001175(Me)My bad the textbook was Digital Design and Computer Architecture, not Computer Design and Digital Architecture.
so since CSG got nuked:I want a head up display for a bicycle to handle navigation and maybe more. I want the phone to remain protected and save battery and the display to be readable in all weather. I started working on a lilygo display with esp and a companion app that gets turn instructions from notifications, pushes those to esp where a sprite is displayed accordingly.Now I saw one can get a 5" motorcycle specific android auto / carplay head unit for 30 bucks or so. It may be that a chink company 'Podofo' manufactures those ir they are really only resellers.I dig the hardware at that price. It's IP rated and should do the job. I dont want their firmware.So I checked on XDA and I didnt see anything conclusive.Does anyone know what kind of SoC and MCU is commonly in those things or specifically in this one and how hard or easy it will be to flash your own build or even something entirely different like linux?I dont want to and probably can't find an exploit that works, root the thing myself, unlock a locked bootloader, build DT and so on.But maybe there's a sure fire way or someone has been in there already? >12VI know its one of the downsides.
when will digikey start stocking the NRF54LM20Aplease don't say a year from now because i already started designing something with it
>>3001364I'm relatively sure btw that I'll find an allwinner with some 16 or 32 MB SPI flash and exposed UART or something. Probably a variant that comes with hw decoding and whatever they need.Not even sure if I am atill expecting an MCU to be on there, I had the idea because it's typical for car head units but it is because they can be hooked up to conteol various things.This unit tho: It reads tire pressure sensors, that's about it.
Can I transfer signals if I clamp copper wires on the end of a membrane keyboard?
>>3000689The hardest part is reverse engineering the toy keyboard, MIDI is just an UART with inverted logic or something like that, the messages themselves are note-on note-off bytes, now what internal signals mean what in the keyboard only god and the Chinese know
>>3001384Yes. It will likely fuck up the contacts though.
>>3001378can't you just email and ask them?
sorry if this is the wrong place but what's the cheapest possible sbc that can run linux, even if slowly/without a GUI?also what happened to /csg/? I'd be posting this there otherwise.
>>3001891I like your question because lately I've been wondering what benefits Linux brings.
>>3001891RPI zero perhaps? Very small but still SoC class and with shit tons of memory (compared to real micro controllers).
>>3001891ARM or RISC-V?You can get 8 dollar RISC-V SBCs like the pine64 Ox64, and some Milk-V boards are cheap but the documentation and community code examples might be lacking
>>3001913to be honest it's only useful for networking; anything else & you're better off with an RTOS.linux is also really heavy (compared to how weak microcontrollers are).>>3001914it's embarassing how an rpi zero's cheaper than something like a milk-v duo lol
>>3001916Anybody here use Yocto? I think it's to burn customized linux OSes onto sbcs.
>>3001924>burn OS onto SBCs
>>3001939Thank you Microsoft Word.Seems like you can have ~100MB image of only the packages that you want and you get to tell it what chip it is going to be run on.
>>3002038You still haven't convinced anyone you even read the most basic information about, let alone understood, what you eant to be talking about. I just cross compile and use buildroot on larger projects and slap the product on the hardware.Guess there's infinite ways to skin a cat and everyone has their preferences and reasons.But it's sort of advisable to understand things before talking about, let alone working with them. It's all a pretty simple topic. No excuses.
>>3002048My bad I guess. In a few job descriptions for "embedded Linux engineer" I saw Yocto mentioned, that's why I was wondering if it was niche or not. Personally I'm studying stm32. I have extensive experience with atmel 8-bit and making the switch right now after a hiatus of nearly 10 years.
>>3002191I probably work a certain way at home because it's what we have at work more often than I would like to admit. Buildroot is such a case.
Hello.I would like to play with Bluetooth 6, specifically to use its "channel sounding" mode.. What's the best microcontroller to get started with that?
>>2999763if youre so smart youd just be using 328p chips by yourself, chump>>2999761>out of date headerswhat are you a jew or something? oh no how dare they maintain compatibility with the biggest and most common ecosystem this general would be more alive if you guys werent such shitposters
>>3002296>tarduino enthusiasts
>>3002296>if youre so smart youd just be using 328p chips by yourself, chumpI am, but dev-boards are still useful, and I can still have an opinion on something even if I use an alternative.
Did Arduino kill off clone support while I was away??A few years ago, I bought a nano off a secondhand site. Got it working, and built some pretty neat projects with it. Now, 5 years later, I'm trying to use it with the 2.0 IDE and it's completely unrecognizeable. Did something change? Is there a workaround for this?? I downloaded the CH340 drivers and everything but it's still unable to upload code. What do??
>>3002331set it to old bootloader maybe
>>3002331Did you check the things runs a bootloader?
>>3002244Maybe some of the ESP32 micros? Maybe the C5? Seemed to be one of the most recent ones last time I checked. Disclaimer: I took a quick look at the datasheet and the 1000+ page reference manual, looks like a handful. Maybe some open-source code shows ways to play with bluetooth 6.
>>3002413(Me)Looked more, if you mean audio by "sounding", then ESP32 the original one, or ESP32 S3, both would do sound, but the C5 and C6 would not.
>>3002413The ESP32 framework (esp-idf) is mostly open source. You probably can't use things like bluetooth on ESP32 at all without the couple of closed source blobs the framework pulls in automatically.
Finished my envelope generator a week ago. It is based on the Attiny1604, it was a bad choice it just barely works due to doing floating math for the log curve to calculate voltage level for curve parts of the envelope. I did enjoy the challenge in optimization.
>>3002436And here is the back.(Away from PC I hate typing on my phone)
>>3002436Floats on an ATtiny? Use fixed-point Accums or use a logarithmic lookup table instead.It came out nice looking, but that’s the sort of circuit I’d prefer to make analog. Not that I’d know how to make an analog low-drift log-lin converter.
>>3002517>fixed-pointDamn didn't think of that. I will keep that in mind if need to overhaul the firmware down the line, thx. not enough flash for a LUT though.I initially planned for it to be completely analog, but I could not figure out how to get the extreme variation in timing constants for the curves for a single RC circuit (I refused to use a selector switch). It could be done with OTAs but it was going to be too complicated.The advantage of using a micro is you could reprogram it for different wave functions, and control styles (Linear or Log control range).I have extra PCBs I could also use these as digital LFOs with exponential CV input.
>>3002436Wait, isnt the appeal behind shit like that doing it analog?
>>3002539NTA, but analog log-exp converters take a bit of thermal matching/coupling/compensation wizardry to pull off right. It's not super hard, I've made one, but it definitely takes a bit of extra reading
>>3002413Bluetooth channel sounding is a specific feature they added to the bluetooth 6 spec that allows you to tell the distance between two bluetooth devices. I want to play with it because it's fun new tech, but can't find any opensource implementations of it.I guess it's too new. Oh well.
>>3002547>a bit of thermal matchingA tale as old as digital electronics. The limiting factor for analog electronics is how well manufacturing can match two transistors. Turns out with digital we just have to add bits.>>3002630What's the underlying physical principle? Does the standard require a response to a probe with a precise and fixed delay so the round trip can be measured? Attenuation wont work as it depends on everything else besides distance.
>>3002634AFAIK It's uses a combination of time of flight and constructive/destructive wave interference.
>>3002437Hey anon, I have the same model of panavise.In case you're struggling with setting the x axis get some matching nylon washers that way you can continuously adjust it.
>>3002634Can’t you just buy sufficiently matched transistors in a single package? Maybe even the darlingtons in a ULN2003.
>>2999663Do car ECUs from the 90s fit in this thread's subject?
>>3002771So far as the digital design and architecture goes, but the actual programming and configuration is probably outside the scope of this thread.
>>3002771>>3002812I will have to CAN this post
>>3002685Yes you can those are being offered.I was merely making a general observation regarding the limits of analog design. Many IC designs contain incredibly well matched and thermally couples transistors, like for long tailed pairs. And still the matching puts a limit on the precision we can reach with analog circuitry.Or to put it the other way round: With dogital design you can at least always add a bit if you need higher precision, there is no technological or manufacturing problem associated with 'one more bit'.>DarlingtonsDarlingtons suck. There is hardly ever a sensible reason to make use of darlingtons today. I'd suspect ULN2003 aren't even particularly well matched, that's not the design intent and I suspect little to no consideration is given to that. I'd go for something like BCV61 but better avoid it alltogether.
>>3002651I see, thanks. So I guess they need to be better than 10 cm or so with the ToF and the result will be more like 5cm or below, else the interference thing would be redundant.
>>3002685You can, but the voltage divider at the input also needs a PTC thermistor (or equivalent NTC resistor network) so the -3300ppm/C of the Vbe junction gets compensated by a +3300ppm/C thermistor network. Then both the matched transistors and thermistor need to be physicaly coupled together so they're the same temp.Look up the VCO for a classic synth, like the TB-303, for a good example. Synths have to cover 4-5 octaves, which is a pretty big range.
Ordered 2 esp32 C6 dev kits (4MB ram).Feelsgoodman
>>3003047>4MB ramObscene. Is it just psram?
Can someone help me parse what this datasheet means by:>To open the relay, the ON pin must be driven to a logic high state. To close the relay, the ON pin must be driven to a logic low state.Does that mean if you driven ON to high the relay will be "open" in that electricity will flow, or does it mean it wlil be "open" in that the switch is open, electricity will not flow?I think (and am hoping) it's the first one.
If you could get one and only one free dev board worth any amount less than $50, what would you get?Imagine you have a coupon or something, but it can only be a single board. No duplicates.
>>3003054This means, for an ideal relay: Open: No current flows to the load.Closed: The relay becomes transparent and the load is directly connected to the source (or the terminals are connected).In your specific case, assuming TTL:0V - 0.8V: The internal contacts do not make contact, there is no continuity between the terminals.2V - 5V: The internal contacts meet and make contact, ideally the terminals will appear to be directly connected.
>>3003051Nevermind, 4MB flash, 512kB sram
>>3003054>>3003071This is unironically the worst part of the hydraulic analogy. That an open switch is the opposite of an open valve.
>>3003076The worst bit for me is I'm actually using this relay to ultimately open a hydraulic valve.All the valves in the chain need to stop flow if any of the prior ones fail.Electricity -> Air -> WaterNormally "Open" (or is it???) -> Normally Closed > Normally Closed.Reading the datasheet and gleaning what I can from how they use the words "on", "open", and "activated" in relation to the resistance, and some guides online that use this relay, I infer that when they said "open" in the datasheet, they actually meant the switch is closed and electricity is flowing.
Bouta blink an LED on the blue pill. Gonna do it bare metal with Windows command line tools and make a private github repo for it so it's more organized to jump from laptop to laptop and also Windows/Linux. Hopefully i remember my avr fundamentals to jump into the stm32 way of things. Hoping to do spi after that and draw things on my tft color screen through spi. Wanna also set up my toolchain with Linux but scared of the roadblocks doing so.Thoughts?
>>3003796meds.
>>3003797Is it that nerve-racking?
>>2999663Retarded lurker here... I do not have the funds yet to get into at least starting to make stuff with these microcontroller deals... how do I explain to my boomer parent who WAS an Electrical Engineer who worked for SONY way back compact disks released, that getting a proper workstation and work on this will further my cyber security degree route.... I can only think of how these could further my understanding of hardware and software security... I just do not know how to explain it so I am not getting chastized for seeking out knowledge.... other than saying hey the chinese are able to get into your net and finances through your unsecured printed btw
>>3003803We arw teaversing an era where we must work hard for low pay. Our managers do not care for quality, only speed, accomplishment of task and shotty quality.Show you can get thongs done to enter the favors of your dad. Suppress your perfectionism. Things will get better maybe, as reason shows its face again after at least 2 years of fast-result-oriented brute work. School would be a crutch right now. AI is a thread but all generations know it so this can be a grounding factor. Also your post was vague.
>>3003806Yes I am vague because the things I want to make wont sell, they are for me, though I know if I learn the skill to repair smaller and smaller items, I do not see how... even with a "global third party network of repair centers within colpanies" should it nmot just be chinese slave labor or nigerian or wtv the fuck, I don't see how supply side will overdo the eventual repair side.. less and less people know how to repair items and have grown a disdain to it, and I just do not get it...
>>3003803> I do not have the funds yet to get into at least starting to make stuff with these microcontroller dealsDev boards are like $5. Microcontroller programming is cheap. Then use a $5 multimeter, maybe a $10 USB logic analyser.
>>3003803>Getting a proper workstation will...The /diy/ disease: Collect tools and materials first and perhaps even last. Not skills.Some of the best EE and CS I know hardly ever touched or touch hardware before they know exactly what they will do. That's a habit from when they learned. Back then they all learned to crunch logic, design systems, do math, even write asm on paper.And you can do all that. For free. No hardware need it, it's likely you'll become distracted even and wont learn methods but imitation instead. Three blinky sketches on arduino in and kids still don't know anything.
>>3003859>>3003864I meant for a whole hot air station, and everything, I only have one old soldering iron. My current idea to start learning about reverse engineering and beyond base level programming knowledge is make a bluetooth keyboard and program it from an old keyboard i have, rather than just go for piecing together a reddit teir cyberdeck, right now the extent of what I know about servers, desktops, laptops, appliances, is simply REPLACE THE WHOLE THING IF BROKE(the board at most). Fuck trying to fix anything... I could say that this sentiment has been crushing me into avoiding learning about how BASE level motherboards works, like yeah theory teaches how to read the motherboard, but I have zero experience in fixing boards, and everyone says doing that is a waste of time..... which I do not understand....
>>3003869Is your intention to learn reverse engineering and/or hardware hacking? Or is that just a means to the end of designing better embedded hardware? If the latter, I think you're putting the cart before the horse.
>>3003879both, I intend to get an old keyboard, slap a sneed controller to it, and then use it for pen testing, though before I begin anything I want to see that I can make a board, that can connect to things, and not be as hugee as this 5" thick phablet with a shitty membrane silicone keyboard because I absolutely abhor thar keyboard. So far what I know is, I need to figure out which pin from which key leads to what on a tiny ribbon cable, to then find a way to attach it to a microcontroller, with likely having an expansion board so that it can have a battery, and then put it in the thinnest vs durable 3 printed case, with maybe a display, though again not as big and chunky as this, and without any of the useless extra flavor "cyberpunk" colored plastic and ridgeshttps://youtu.be/bvV9h5kAPXw?is=gIxHsJauL9ZmSPkn
>>3003883here is the keyboard they "designed":https://www.yankodesign.com/2024/08/23/diy-modular-cyberdeck-could-be-the-futuristic-computer-you-can-get-soon/amp/
>>3003883>make a boardconnect boards together***
Getting an Arduino Uno might be a better experience than fantasizing over cyberdecks.
>>3003934not going for a cyber deck though. I will just make a stupid tiny bluetooth keyboard with a sneed xiao or wtv, if it turns into a cybercrapper cool, but all that can easily be out done with a laptop or a pc, no need for shit gadgets unless somehow there is a special sensor that can do fuck all and fuck about like something out of spy kids lol