/mcg/ - Microcontroller General: Motorola Edition

Previous thread:>>2759901

Here 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 parts
digikey.com
mouser.com
arrow.com
newark.com

>but that's too expensive
aliexpress.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<wbr>-electronics

>RISC-V microcontroller list:
https://codeberg.org/20-100/Awesome<wbr>_RISC-V/raw/branch/master/RISC-V_MC<wbr>U_development_boards.pdf

How powerful is Csound? Could I use it to make a low-grade version of a live musician's kit? Record and loop input, adjustable digital effects pedals, putting together a patch, etc. Is there something else I should investigate that can do that better? I can do all of that at a computer in a DAW, of course, but I want something more portable to dabble with without shelling out several hundred bucks. And I'd like the project to get back into all of this - the programming, the signal engineering, the electronics. I'd probably design and build (make my twist on others' work) some analog pedals as well.

>>2774431
just buy a mega2560 and make a digital synth, go from there

its obvious youre clueless

>>2774431
Audio is harder than it seems and needs way more than an Arduino in terms of resources if you want to do something, look at the history of DAWs in personal computers to get an idea of how much you can accomplish with each level of processing power, you are not more capable than the companies that made them so that is pretty much the limit for each device.

>>2774431
>>2775277
>>2775317
Yeah you'll probably be needing something with the specs of an ESP32 at the very minimum. It's barely able to do a live FFT. Anything less involved than an FFT should be fine with such a chip. You may be able to do some simple Z-transform live audio effects with an 8-bit AVR, but those don't come with I2S hardware so it wouldn't be a good idea.

>>2775331
>ESP32 at the very minimum. It's barely able to do a live FFT.
No, mega328 can do FFT just fine, and while also driving an OLED to boot, its actually way overpowered as far as basic DSP goes.

Honestly you mentioning I2S at all makes me think you're a bot or someone with ulterior motives because that makes NO sense in this context.

>>2775331
kek no
>>2775777
This nigga is correct. Did this with PIC microcontrollers I was working with over a decade ago, a Mega328 is far more than capable. There are several competing Arduino libraries for this shit, hell here's a great resource:
>3 implementations of the FFT for Arduino AVR platforms!
https://github.com/Klafyvel/AVR-FFT<wbr>

>>2775777
>mega328 can do FFT just fine
With what kind of sample size and rate though? For starters, AVRs are incompatible with conventional 16-bit I2S ADCs/DACs, because they don't have I2S, and they're not 16-bit. Secondly, if you want a decent STFT, you'll want to make at least 3 overlapping windows, each at least 1/20Hz long in order to capture the lowest frequencies. More windows than that if you want better temporal resolution. Even one window is 16*44100/20 = 35280 bits, or 4410 bytes. A 328p has 2kB of RAM, so it's a non-starter. To actually fit it you'd need to crunch down on the bit rate, so go ahead if you want it to sound like shit, plus you'll be getting artefacts if you have just one concurrent sample. Being only 16MHz while juggling 44100kS/s at 16-bit without DMA also feels like it might be a stretch, but I haven't done the math on that one.

Yeah you could probably do an FFT on a 16-bit MCU with DMA and 8 or 16kB of RAM, especially if it has DSP instructions, but that kind of MCU would probably cost more than an ESP32 anyhow.

>>2775780
>https://github.com/Klafyvel/AVR-FF<wbr>T
>30ms for 256 16 bit samples
Ah, seems this man has done the math for me, seems as if the sample rate is off by a few orders of magnitude. Keep in mind we're talking about the context of live audio. That would be fine for a pulse oximeter.

>>2775794
It was provided as a reference. Check out one of the numerous other FFT libraries for Arduino.

>>2775794
It’s been decades since I’ve done audio FFTs, but, yeah, 2kB seems unreasonably tiny.
Plus usually you need to do other things with it, filter, scale, and/or reverse FFT and there’s just no way I think.
We used to code our FFTs in assembly, on PC class processors and it still wasn’t real time. For audio, even MIDI can cause delays that can be annoying, and that was designed as fit-for-audio purposes.
t. minimalist

Is it fine to power my MCU with a buck converter? What about if I’m doing analogue measurements, how would you reduce the switching noise to the ADC? Linear regulators are only really good at 120Hz ripple rejection, should I put a capacitance multiplier before an LDO?

What if I made the measurements synchronously with the SMPS cycles?

>>2777014
It’s fine.
Put some more .1μF ‘104’ decoupling capacitors and whatnot in there if you’re worried. You should have a big bag of them.

I accidentally ordered these kind of "independent" stripboards that have no bridged connections instead of the railed kind. What is the purpose of these? They seem way harder to work with.
https://www.aliexpress.us/item/3256<wbr>805882522448.html
vs
https://www.aliexpress.us/item/2255<wbr>801061083792.html

>>2777053
They are harder to work with. Some people blob solder across the holes, but it's tedious and looks like shit. Others blob solder across uninsulated solid core wire that they lay across the holes, which is quick enough and works ok. I run insulated wires on the top of the board along with the components, and have the stripped end enter a hole adjacent to the component leg, and fold over to touch the component leg directly where it's soldered. Looks kinda funny but works. Some would solder that wire to the adjacent hole itself and blob across the two, which is just the worst of both worlds.

That said, I much prefer the kind with connections like a solderless breadboard. I've recently taken to using strip/vero board, which I think I might like even more than breadboard style. But I'm not sure if they make strip board for FR4, I've only ever seen it on FR2. FR4 is usually double sided, which would make cutting the unwanted connections twice as tedious. A quick search shows some aliexpress guys selling it, but I buy mine locally.

>>2777055
Thanks. I guess it should be possible to do everything I wanted to do with insulated wire but will just require more forethought than I was expecting for a stripboard project.
> Others blob solder across uninsulated solid core wire that they lay across the holes, which is quick enough and works ok.
yeah I was expecting to have rails like on breadboard so this should work.

I'll have to put some more forethought than I was expecting into my component placement but I guess it's not the end of the world.

>>2777191
>>2777193

ah yes, cold soldering ftw.

>>2777194
"talk" kek. i guess five year olds need to start somewhere.

Does a MCU board with HDMI output exist?<br>The "best" I find it Pi Zero, which is more like a full SoC usually running Linux.

>>2777411
Not that I've seen. Greyscale composite video is pretty easy to output from an MCU, Ben Heck even did so from an ATtiny10. I think CNLoHr did colour composite video through the interesting hardware of an ESP8266. I'm fairly sure colour VGA is pretty doable, it should be the same as greyscale composite, multiplied by three, plus sync signals that you're generating internally anyhow. I've heard that you can bit-bang DVI-D with an overclocked RP2040, not sure if it uses up both cores or if there's room to run another program. You can use a passive adapter from DVI-D to HDMI, so it would probably work for what you're looking at, but I'd double check the display's compatibility with whatever resolution you're able to compute. I think DisplayPort will be more difficult than DVI-D.

That said, it is possible to run bare-metal ARM code on a raspberry pi, without linux. But the architecture isn't brilliant for doing so. There's a bootloader that uses the GPU or something, idk they were talking about it last thread.

>>2777209
>cold soldering
t. guy who doesn't have a clue

>>2777194
when you change from using a drill to cut the tracks in a hole, to using a knife to cut the tracks between two holes (cut twice at an angle to make a V groove) you can make some really dense (for dip) layouts. god i used to really enjoy refactoring vero layouts. pcb routing just doesn't have the same satisfaction.

>>2777414
HDMI on a bare-metal Pi would probably be a pain because there's a good chance it'll only be accessible from the GPU and doesn't have any docs.
But what I actually care about is that I don't need to rely on a SD card. All the SBCs that target the Pi's market boot from SD card, except some expensive ones which have an eMMC on the board.

>>2777435
>it'll only be accessible from the GPU and doesn't have any docs
>SD card
Both are problems with bare metal Pi. I'd probably want to run a stripped-down linux distro instead, maybe an existing RTOS if they make those with video output.

There is some strange crossover with SBCs and MCU dev-boards that might be more up your alley, but I'm not sure if they have video output capability. Like the BouffaloLab BL808. The Ox64 dev-board doesn't have any video ports on it, there's a small chance that the USB-C can do video output but I doubt it. It has an SD card slot, but I think you can just program its flash memory using JTAG instead. At least a more powerful MCU with more cores like this would be better suited to bit-banging digital video than an overclocked RP2040.
Have you looked into HDMI or DVI-D codec ASIC? Looking at ali I'm just seeing FPGA HDMIboards instead, for $13. FPGA programming HDMI sounds like a pain.

What do you want it for anyhow?

>>2777459
I want to output something to an existing low-resolution HDMI screen. If I could design my own PCB I'd just skip HDMI and connect the LCD directly to an ARM MCU, but unfortunately this option is out. The simplest option would be grabbing one of the unused RPIs from my electronics trash bin, but I hate the general fragility of it, both in hardware and software.
>FPGA HDMIboards
This could be fun depending on the FPGA and IP involved.

>>2777463
Or just buy a Composite-to-HDMI converter

>>2777463
> low resolution
First thing to do is check the display PCB for an unpopulated VGA connector.
HDMI is just shit to deal with in every dimension.

>>2777465
Isn't RGB over VGA much easier to generate?

VGA-to-HDMI converters are also cheaper.

>>2777486
If you're doing colour, yes. If you're doing greyscale, composite is easier since it's 3 times less channels. Though I guess you can just put greyscale composite across all three channels of VGA and use some extra pins for the sync signals. If the adaptors are cheaper and you're not stretched for I/O pins, definitely go VGA.

Looking for some advice, but not sure if it would be better to start my own thread. Figure I'll start here and let you guys flame me if I'm being dumb.

I have this sensor at work that was purchased and we would like to use it. It connects over a serial port. There is software that can be downloaded, but it only runs on Windows. Our Cyber division said fuck you and won't let us install the software. Probably cause it is made by chinks.

I tested the software on a PC not controlled by my organization. The software doesn't seem to send/configure anything on the sensor, it just displays the output, configures the baud rate, etc. I'm wondering if it is feasible (in a minimal amount of time) to write my own software to capture the output? The manufacturer's software dumps out lines sensor data in ascii when in capture mode. Is it feasible to think they are just sending new line terminated ascii data over the serial port?

I loaded the exe into Ghidra but not having much luck hunting down anything related to the serial port comms. It doesn't help that I am unfamiliar with low level Windows code.

Any suggestions are appreciated.

>>2777539
Just capture the serial output. Can you capture the serial communication? Did you check the datasheet? Did you check whether it's simply sending data on its own to the serial output?
Sounds trivial.

>>2777547
Yes, I should be able to capture the serial comm. I just haven't done something like this before and haven't started actually working on it yet, just thinking. Capturing the serial comms is what I planned on doing first, but wasn't sure if I could easily get some clues from the exe by knowing what DLL's to concentrate on. I'm worried it is dumping binary data over serial in a fixed format. I probably won't have the hours to try and decipher it.

I don't have any datasheets, this is a commercial item, not a simple sensor I can buy off an electronics shop. I guess if I really had the time I could crack it open and see whats going on in there.

Hopefully with this info it still sounds trivial.

>>2777550
If it's just a passive sensor (no parameter setting or calibration or whatever needed) I'd expect it to be simple enough. But how is the sensor supposed to be used? Do they provide a protocol library or what?

>>2777539
>I'm wondering if it is feasible (in a minimal amount of time) to write my own software to capture the output?
Absolutely, even if there is strange formatting. You could do it in 20 lines of python, or do it in a shell script, or whatever suits you. I'd start off by seeing if you can snoop the serial lines purely via software to find out what data the manufacturer's software sends and receives. If you don't need to send anything, then it would be a simple matter of plugging it in and opening the serial port in bash or python or the arduino ide or whatever.
>Is it feasible to think they are just sending new line terminated ascii data over the serial port
Very much so, a lot of RS232 peripherals use very barebones data formats. But only one way to find out.

>>2777550
>binary data over serial in a fixed format
Maybe, but a hex editor and a comparison of the raw serial data to the original software's dumped data should give you some clues.

What is the absolute cheapest thing I can run armbian on? The Orange Pi Zero 2W is nice but I don't need HDMI and it looks like there's no radioless version for less cost.

>>2777784
You can Linux run on almost anything as long as you have enough memory. For specific distros such as armbian look at their list of supported hardware.

>>2777784
the Ox64 can run linux if you're careful.

>>2777956
> ox64
I hate linux.
I hate RISC-V, and RISC in general.
I hate the pinecil.
I hate chinese made stuff.

However, I looked through through the Ox64 docs because I never heard of it, and all their other stuff, and what they’re doing over there is pretty cool.

its been a long time since i touched my arduino and now its covered in dust. how best to clean it?

>>2778196
dry compressed air
ipa + toothbrush if there's anything that compressed air won't get

I'm trying to learn about TPM and potentially use it in some designs, the problem I have is that the microcontrollers I'm used to can't disable their SWD interface, cryptographically verifying the firmware just to make it completely exposed and vulnerable through SWD is retarded, so what are some cheap microcontrollers with security features?

>>2778196
if its a nano you can just swish it around in your mouth, my unos I take with me into the shower

>>2777594
thanks for the response and direction my dude. hoping to be able to concentrate on it during the next week or two.

so I've planned to buy a couple of raspberry zero 2's for projects, but do they have thermal issues? especially when used in 24/7 operations, i.e. as a Pi-Hole unit?<br>just wondering if it's overkill as I'm working on a case design that includes a 3007 fan to cool it

I ordered a Raspberry Pi 5 and a NVME PCIe HAT. Apparently it comes with several limitations:
> max 1A/5V
> issues with Phison controllers (most WD SSDs)
> issues with Polaris controllers
> experimental PCIe 3.0 support
Link to the HAT I bought:
> https://wiki.geekworm.com/X1001

This rules out like half the products on the market. Any of you drive a Raspberry Pi 5 with a NVME?

>>2779233
>it's another RPI consists of half-assed hardware that would fail on the real market but "hobbyists" buy it as if it was gold coated poop episode

>>2779251
You'll have to sacrifice some reliability for compatibility. It's an all purpose single-board computer that's meant for tinkering, prototyping and hobby projects. I'm not going to run critical infrastructure on it. My main purpose is something small that I can put in my backpack. I will install a VoIP/Radio-Simulator on it for work and probably jellyfin so I can use it as mediaserver. I was aware of most issues before I bought it. I give you, 100$ is overpriced for what it is, though the reason people buy it instead of the chink clones is compatibility with a huge variety of third-party hardware and software. Good luck achieving that with some niche product.

>>2779271
Is there a reason to use SSDs for a media server, other than noise? I'd have thought HDDs would be more than fast enough, cheaper per GB, and will last more write cycles.

>have potentiometer tied to ADC channel A
>have current sense amplifier tied to ADC channel B
>at low pot voltages the current limit isn't detected at all, at high pot voltages it triggers even at zero current
>pot voltage is measured as being too high when current is high
>removing pot voltage measurement calls and only measuring current works flawlessly regardless of pot voltage
time for another game of "spot the firmware bug that causes crosstalk", fuck me

pic is my isr and start of the loop. putting the conditional checks in the isr has the same result, it just runs a lot slower. chip is an attiny13.

>>2774325

Since there is no /ohm/ thread I'll ask here. I'm using a servo as a spindle motor that's driven by one of these Chinese AASD driver and I'm trying to control the driver with a pulse controller SMC01 and I'm a little hesitant with the wiring. here's a screenshot of the AASD db25 port used to for inputing commands

>>2779582

and here is the pulse controller

I would try this:

>DC+ Pin 9
>DC- Pin 10
>Dir+ Pin 4
>Pul+ Pin 3
>EN maybe pin6? or maybe pin2?
>GND Pin5 and Pin14

what do you guys think?

>>2779582
There is an ohm thread, it was just made too early and by a phoneposting zoomer who fucked up the title: >>2777077

>>2779588
For the enable signal, it would be pin 2, but it needs to be pulled to ground to turn the servo on. So depending on the relative polarities of the enable signal on either end, you may need to add a transistor to pull it down.
Pin 6 is just a pulse output, not an input.

Pin 10 being 0V feels kinda ambiguous, since it has an unlabelled switch to the 0V of the PSU. Lower down the same pin is described as "Community port", so maybe COM refers to communication instead of common, but the connection does look like a 0V here. I'd look for a different pin description or wiring diagram.

Further down pin 1 is grounded, but that looks to be for the digital signals directly out of the AASD driver.

im looking at how to control the arduino and the website keeps telling me to install their IDE but i dont want their IDE. what are my options?

>>2779699
...install the ide also dont get into ardunio in 2024. Go Pico or ESP32

How do you go about radio controlling a microcontroller? Like if you want to turn one into a rc car and another into its controller? Google is being surprisingly unhelpful. Is there a good module that I can get on aliexpress or something

>>2779566
Wait, the current signal is always above 2.5V, so I could add a resistor in series with the high leg of the pot, making it always below 2.5V, and just decide which thing I've measured based off whether it's above or below 0x80. Might make the pot a bit further away.

>>2779699
Either way you need to install something to serve as the programming software. I'd recommend AVRdude + AVR-GCC + text editor of your choice, but there's also:
>VScode + PlatformIO
>Atmel Studio (windows only)
>MPlab X
>Arduino command line interface
>Arduino web interface

PlatformIO works for other brands of microcontroller too, the others are mainly for Atmel AVRs.

>>2779711
>Pico or ESP32
>not based Risc-V

>>2779713
I'd just buy a 433 MHz receiver and transmitter pair. If that proves insufficient, there are more standard methods of RC car control, for which you might want to inquire on /rcg/. Those guys make their own quadcopters all the time, there's probably some making RC cars too.

>>2779718
i have vscode already so i'll try out platformio

>>2779711
i have the arduino sitting around >>2778196

>>2779566
Holy shit that forest of 01001001110101010010101 magic numbers makes my eyes bleed. Use fucking constants for flag bits.
>inb4 #define ONE 0b00000001

I am not sure if this is proper thread to ask about FPGAs but I have no idea where to ask this kind of question. I have noticed that some telegram schizos recently started posting memes about those really powerfull FPGA boards that you can buy online. Is there something special about them? Are those like usefull for some kind of rebel purposes apart from crypto mining?

I want to get into python programming for cyber security work in the future. Should I get an electronics kit to learn it faster?

>>2780714
Can you send a link to that listing, uh for science?

>>2780752

just google the words on screen, dummy

>ThreadX
>associated X libraries
Why is everything associated with Microsoft such a piece of shit?

>>2782069
Company run by a bunch of indian MBA and marketing grads from a diploma mill.
What could go wrong?

>>2782189
ThreadX is somewhat ok, except for the awful style. But the other libs seem to cause more work than they help.

>>2774325
hello everybody

can you guys confirm for me that usb/serial to uart is the only way of connecting a raspberry pi 3 to a laptop for the purposes of baremetal programming? i don't want to constantly fuck around shifting the sd card, and i am guessing that ethernet and usb won't work without an operating system. actually i am not sure the pi3 has usb in. i dunno, lol!

thanks for your help.

>>2778242
microsoft had a line of 'secure' azure sphere microcontrollers. you could look into them if you haven't already.

>buy myself a nice custom soldered board (esp32 base) to avoid the hassle of countless hours of connecting pins and configuring shit
>Install library in arduino ide, select board, shit works like a charm, 20min setup time to start coooding
>"This is cool, but this ide is kinda shit"
>Discover platformIO, literally just a vscode plugin with a basic config file
>thisisperfect.jpg
>Spend 3 hours trying out old projects using platformIO for my board, none work
>Find out that the second the hardware is changed or customized in a new iteration, deviating from super generic esp32, any regular platformio config goes to shit, making it basically unusable
>You would have to spend countless hours making a custom board definition or meticulously copying it over from the Arduino ide boards

REEEEEEEEEEEEEEE
Guess I'll have to keep using Arduino IDE.

>>2782540
You can use the arduino plugin for vscode.

>>2782563
Ist it any good?
For me it was more about the kino package management of platformio and being able to code normal cpp stuff instead of this .ino shit

>>2782540
>>2782563
>>2782565
Nvm
Just got it to work with platformIO lmfao. Shit documentation made me waste 2 hours only to find out that you had to use CUSTOM_BOARDV2 instead of CUSTOM_BOARD as a build flag keeeek

Pre-made MCU board with LCD that offers at least a 5 inch screen?

It looks like in pico/rp2040 you need a bit of delay to access value of goio inputs after setting gpio functions. I have a button matrix and I am enabling rows one by one and then reading columns to scan it.

Normally both rows and columns are input pull high. To read a row, I set row pin to output low and then read the gpio state to get button states for that row. And then reset row back to pull high. But it looks like I need a bit of delay (in useconds range) after setting row to output low and before reading gpio register

I didn't see anything in documentation about this

>>2782601
Maybe some debounce shit going on? Some delay is inevitable, but microseconds would be too much.

>>2782602
Sorry, maybe it is not in us, I didn't check how low it needs. I just put a 10 us delay and it worked

if im getting into stm mcus from avr is it worth trying their cubeIDE or do i just go straight to bare metal programming?

>>2782673
stcube is Arduino tier, in a bad way
I first found out about it ~10 years ago, and immediately realized that it was trash because it wanted to generate custom C files from guifag IDE configurations. You're fucked if you want to use svn or git or whatever for source code control.

>>2782673
I always do bare metal programming. Especially for something that is going to be put into production.
I use IDEs for messing around though. Sometimes, you’ll disassemble code generated from a C compiler to see what does with it (i.e. write it for you) but you always have to look at it to make sure the compiler didn’t do so something stupid or inefficient (like not using obvious single instructions or addressing modes available on your microprocessor, or filling up the execution units and cache lines with multiple operations when one will do, or putting unnecessary things on the stack that don’t need to be saved, etc.)
Otherwise, you don’t really know what you’re doing. As some other anon mentioned, some of those generic library functions are hilarious. If it can’t be done efficiently as a macro at compile time, don’t do it.

>>2782888
bare metal means no OS
freertos is an OS

>>2782888
> freertos = bare metal?
No, freertos = fluffy.

Firstly, almost nobody needs the “real time” aspect of it. It’s also talored to the class of μC that is between real microcontrollers (8051, 68HC11, MSP430, PIC, etc.) and “PC Class” SoCs like the rasberry pi 3. These middle ground processors are usually some kind of RISC perversion as well (such as ARM) making them painful to code directly on and necessitating things like “C compilers” and, hence, the perceived need for ridiculous ideas like malloc() and multi-threading.

>>2782930
How ridiculous. Writing ARM assembler is easier than x86.

>>2782934
Neither is a breeze, but x86 (especially pre-flat-386) is a mess of dealing with segments and segment overrides. In comparison, ARM just needs to dump literal pools from time to time, like a dog taking a crap on a neighbor's lawn.

>>2782937
> segments are hard.
How ridiculous. I think complaining about segments on their very few microconrollers out there is a bit of a “meme problem” and they can actually come in handy. They’re not the only ones that had to implement unusual shit to increase the memory addressability to 20 bits.

The other “meme problem” was processors (e.g. SPARC) that claimed you had to write eveything in, say, “C” because there was “too many registers”

Too many registers!?!? That’s like being too happy, or having too much money.

>>2782934
Yeah, in the same way writing in “scheme” is easier than writing in common lisp. It’s a skill issue.
Ideally you want a lot of instructions that do shit you want to do, and have all memory addressing modes available on all those instructions including MOV [mem addr], [mem addr].
And do it all in one clock cycle like RISC was supposed to do. Most modern CISC cores do everything in 1 clock now which is why the idea of RISC became silly. In fact, now the bottleneck is those wasteful wide-ass instructions once memory became the bottleneck. That’s why ARM stole the “thumb” instructions from SuperH to try and clawback some performance leading to the big effing mess that it is today. “ARM” barely means anything now.

>>2782925
>>2782930
The default ch32x035 project has no freertos. If I had freertos I would have one task for each job: communicating with the 3d printer, another task communicating with the pc, and another one to bit bang an h bridge driving a piezo. If I put everything into one main loop I have to commit to an ordering, and the piezo period has to be a multiple of the main loop period. This reminds me of imgui.

>>2782952
> 3d printer
Hello zoomer.
> communicating with the PC
You have whole PC what do you even need a microcontroller for? I don’t get it.
> bit-bang piezo
You’re trying to make me start cutting myself aren’t you? You got the wrong piezo, you need the one that makes the noise already instead of spawing a task to spew a square wave into it. See picrel.

>>2782957
The PC only has one ADC channel and it's not as good as the ad7606. You're right that an active buzzer would be easier.

>>2782944
No you mong, it's not simply "segments are hard", it's that assembly language support 8086 is hard because segments mean there are more things to keep track of, and you have to pay attention to shit like near vs far calls.
t.went with 68000 during that era

>>2774325
i want to make a drone using arduino, anyone knows
found that you can make one using multiwii/wii gyroscope, but i dont know the basics of the brushless motor(what kind do i need) or the kind of battery that i need
any tips to get starting?

>>2783662
>found that you can make one using multiwii/wii gyroscope
Could just get a MPU6050.

I’m ready to move up from Arduino and start programming MCUs in C. Should I continue with AVRs (atmega168) or should I just go directly to STM32? It seems like a pain in the ass to program the AVR compared to the STM32

>>2783902
AVR was a school project by students in Norwegia.
The ‘A’ in “AVR” stands for ‘Alf’ — see picrel. Any more questions?

>>2783016
> promulgating quickly googled meme problems
No, that’s not why there are near and far calls, and the 68k has the same shit for the same reasons—BCC, for example, has 8 bit branch-to addresses as well as 16-bit branch-to addresses
> doesn’t pay attention
Thank god you didn’t work in life support or critical systems.

Hello everyone! Does anyone here have some experience with CC1101? I wanted to know how hard would it be to control its frequency with a microcontroller. I have read that people do it either by writing data to this chip's registers or by modifying capacitors/chokes on the circuit. Which approach is correct? is it even possible to do that? Thanks in advance.

So I picked up someone's project from 2006 on a PIC18F242 and want to make small changes + recompile on MPLABX.
I tried to use the standard (unlicensed) version of the C18 compiler with MPLABX, but it doesn't recognise headers
>#include "io18f252.h"
>#include "Inpic18.h"
and if I comment those out it raises
>WARNING: This version of MPLAB C18 does not support procedural abstraction. Procedural abstraction will not be run.
for this code:
[code]
__bank volatile __no_init char OutBuffer[256] @ 0x100;
[/code]

Can any old-timers or people otherwise knowledgeable about updating ancient products here give me tips on bringing this project up to date?

do mcg still love Japan? <br>https://www.youtube.com/watch?v=i5M<wbr>NLTc7YhY

reposting here. Kinda new, sorry. What do you guys recommend for small wifi enabled boards? I want to make a magnet sensor for my refrigerator that will talk with a pi to send an email to me so I know when my cheap & available carbs are in danger. Seeing a lot of feather stuff, but I'm going to want to eventually make like 6 of these, so don't want to spend a whole lot per board.

>>2774325
Is there any way to make a intel 8088 be a microcontroller? Im very familiar with it and id like to be able to use it to drive io pins like an arduino

>>2784444
With accompanying IO chip(s) I think it's doable for any microprocessor like that. Like the 6502's 6522, which might even work for you here too if the addresses don't overlap. If not it's basically a few address decoders and registers, might be doable to implement using a dozen ICs but that wouldn't exactly be compact.

This guy asks a relevant question:
https://www.reddit.com/r/retrocompu<wbr>ting/comments/106g6oh/questions_abo<wbr>ut_the_8088_and_its_functionality/
But I didn't stick around to see if there's a good answer in all the nested replies.

>>2784453
I tinker with ibm pc compatibles and ms dos as a hobby so in theory any program i write in a dos BASIC, pascal, turboc etc can be programmed to an eeprom and run. I think theres ms dos microcontrollers out there but i want bare metal so i can cheaply install it in a permanently soldered project

>>2784459
MPUs aren't exactly designed to be MCUs, and while there is overlap, it doesn't seem as if this was done with the 8088's case in particular. Either do more research than my 15s of googling, design a hodgepodge board full of decoders and registers, or pick a different chip. If you're aiming for a low-cost chip, the CH32V003 is looking pretty good right about now.

>>2784444
First of all, you want an 8086 based microcontroller, not an 8088—that is crippled version. Second, you want 80186 or a NEC V20 or something.
I think it’s insane they don’t make any readily available and cheap 80x86 microcontrollers/SoCs… I would think all the patents expired on those like SuperH.

>>2784489
>I would think all the patents expired on those like SuperH
You say that like there are readily available and cheap SuperH microcontrollers. The first box is ticked, but certainly not the second.

>>2784499
They were selling super-h dev boards for a few bucks years ago, but the’ve gone way back up since then because of replacement of old parts.
There are some open vhdl and asic models for them, but nobody’s bothered to do anything with them thus far.
Imagine an alternate world where they took off and you were typing this on a SuperH based PC.

>>2774325
Someone is trying to sell 107 EPROMs for $75. Worth it?

>>2784419
I forgot that epson makes microcontrollers. Massive street cred.
24 bit registers. Nice.
Picrel dev board uses the one with LED drivers. Nice.
Unobtainium. Not nice.

>>2784616
Eproms can be emulated pretty easily.
Are you making an art sculpture?

>>2784616
>EPROMs
Wait you mean quartz window UV erasable EPROMs? Personally I love the way they look, but I already have a dozen of them and wouldn't really know what to do with more. I guess if you do a lot of stuff that would normally use a socketed EEPROM you can use an EPROM for that instead, but 107 sounds like a lot unless you're selling them as game cartridges for a retro console. Print off some cool stickers for the windows. Please someone do this.

Since I heard some boomer in a Jaycar mention it, I've always wanted to use an EPROM as an image sensor.

>>2784631
>always wanted to use an EPROM as an image sensor.
Cool, pretty sure I saw somebody do that on hackaday.

>>2784631
> quartz window
You almost never see them that way because we put foil stickers (like floppy disk write protect tabs) on top of them so some fucker doesn’t erase it when poking around with a high powered flashlight or leaves the cover off under a fluroescent lamp.

>>2784639
Some of the first “webcams” … you know, for your Apple II… which have nothing to do with the “web” were decapped RAM chips.

>>2784944
>decapped RAM chips
That was DRAM, not EPROM.
I don't think anyone has ever used EPROM as an image sensor, and anon was just not paying attention.

>>2784995
>I don't think anyone has ever used EPROM as an image sensor

kodak got a patent for one using eeproms a long time ago
a company this innovative is a dream investment for your 401(k)

>>2784995
>I don't think anyone has ever used EPROM as an image sensor, and anon was just not paying attention
Well EPROMs don't need to be decapped in the first place, but you might be right. But the topic was definitely EPROMs when I was talking to the guy, because at least one of us was holding an EPROM in our hand at the time. Yes Jaycar still sells EPROMs, but they're not exactly current products.

Found this comment on a hackaday article:
>There once was someone who made an image sensor out of an eprom
>Loaded all zeros or all ones to the eprom and then focused an image onto the array
>It was only black and white and had impractical long exposure times but it did work
>Unfortunately I cannot find the link anymore
I can't find anything else like it either. I imagine it was far slower than using DRAM. With DRAM you could vary the exposure period around the maximum time the memory cells can hold their charge, and see an image out of even a small difference. Since that charge holding period is much less than a second compared to the minutes for an exposure with an EPROM, you could probably do video with such a system.

Do you need any additional wiring to send serial data from an arduino uno to an attached XBee transceiver if you have the XBee mounted on an XBee shield attached to the uno? I can get these little shits to talk fine using XTCU but it refuses to send API frames to the other transceivers despite being discoverable and the frames in my arduino sketch being valid. Should add that these are Xbee Series 3s I rolled back to the Series 1 firmware since my best source for how to do this is for the Series 1s.

>>2786600
The hardware on the Xbee module itself may differ somehow, I'd try to use the series 3 firmware instead.

>>2786731
Got it working in transparent (retard) mode where its just a glorified serial bus. I will take this W

How do I find out the size of my binary, that will take up the flash space? I am building for pico.

Is it the size of .bin file?

hi, retard who just fried two arduinos here,
just wondering if anyone has any guess to the fault in my application is if the damage manifests as the 5v now being permanently shorted to ground.
did it to a nano and and uno r3. the uno has removable dip and curiously the sockets for 5v and gnd are not shorted (implying its not a component or trace fusing?) AND the 5v and gnd pins on the dip itself are also not shorted(implying the chip itself is not damaged?). this must be bad probing on by part right? how else could that work? also again please guess at the kind of retardation which causes this type of failure

>>2786762
Your compiler or programming tool should tell you? Maybe you need to use verbose mode. The bin file may not be accurate.

>>2786806
What did you do to cause the fault? Were any wires plugged into the arduinos when it happened? Did you power from USB or VIN or directly via the 5V pin? Was the DIP ATmega plugged in the right way around?

>>2786806
Stop powering your micrwave using 5v pin of your arduino and pulling too much current from it. Or you are just straight up shorting it mistakenly

>>2786838
>>2786853
sorry for not being clear. made a circuit by soldering female headers to perfboard and connecting with wires, then i plug the arduinos (and an H-bridge module) into those headers (directly in the case of the nano, with jumpers to test with the uno). the circuit is constructed by connecting the underside of the female headers with soldered wires.
by putting the arduinos into the circuit have constructed, they become damaged. obviously i have made an error in constructing my circuit (am retarded).
my question was more about if you can guess where the error in my circuit is based on the way the boards are damaged. the 5v and gnd pins are now permanently shorted when removed from circuit.
like would you expect this sort of damage if my circuit shorted gnd to 5v during operation? or would that provide a lower resistance path and actually prevent an overcurrent from that pin?
probably a stupid question, and i'm definitely going to basically restart the circuit, but i don't really know where the fault is. its pretty sparse in connections and everything looks okay, so my confusion must be a lurking issue

>>2786893
Could have happened if you fed a higher voltage to your arduinos somehow. Draw a rough schematic of which pins were connected where.

>>2786944
hope this is clear, made some changes between the frying of the boards to because suspected 12v vin might have been too much, but when i connected the uno up to the H-bridge i think thats when it broke? it was hard to tell. not pictured are some extra data connections that i think were working before.
H- bridge is one of these L298N like
https://www.handsontec.com/dataspec<wbr>s/L298N%20Motor%20Driver.pdf

>>2786953
Which wire was the 9V wall adapter connected to in the second image?

>>2786972
9v wall adapter was plugged via barrel jack into a breadboard compatible linear voltage regulator. the 5v output of this module was plugged into 5v pin of arduino

>>2786974
Ah, those two lines in the image were one sentence.
Not seeing anything glaringly obvious. My only guess is that some shitty solder blob shorted something to 12V. Hook it up to power without the arduino and check the voltage to ground on all the L298N's pins. Also double check that the breadboard adapter outputs properly, I've had those die before.

>>2783902
AVR is significantly simpler than STM32. Both at an architecture level and programming the microcontroller itself with avr-libc. What pain points are you struggling with?

>>2786975
okay, so when powered the L98N's 5v input was reading about 12v, and all of the enable inputs were around five. reckon thats probably what fried my boards. have another L298N module that reads the expected 5v at the 5v. a little worried to go ahead with it though because i thought this first module was fine from previous use and i don't know what broke it

>>2784358
I don't know anything about CC1101 but it should be obvious that you won't be modifying capacitors or chokes with a microcontroller. There will probably be an optimal frequency range based off the components that are on there but with the register writes you can force it to run at other frequencies with some reduction in quality.

>>2786987
put 10k resistors in between the arduino and module on the en1/2 lines, and leave the 5v unconnected. this will reduce the chance of it destroying the arduino if it goes fucky

Are my DRV8874 all rejects? I did picrel but the motor only turns one way. That is, IN1 high IN2 low on 2/3 of them makes it go but IN2 high, IN1 low doesn't turn the opposite way.

>>2787091
As usual I find the problem right after asking. With PMODE logic high it does the right thing.

>>2786987
IIRC there's a jumper on the L298N to set whether it gets internal or external power for its 5V rail, maybe something went wrong with that?

>>2787021
do you mean as like a pull down like 1 or actually in series like 2?
>>2787190
yeah maybe, i had not been using the jumper because earlier iterations were using higher than 12v(this is fine according to documentation, and it was working). don't really remember but might have tried the jumper with higher voltages while troubleshooting.
anyway, will be using jumper on the undamaged module so i dont cook the 5v arduino pin, but still worried about the 5v high enables on the failure

>>2787223
In series like 2. But it’s also coming through the voltage pin, so that alone isn’t going to save you. Keeping the power supplies seperate and using the internal 5V regulator for the H bridge is probably the way to go. The only wires between the arduino and the H bridge should be ground, and signal wires with series resistors. Note that resistors might cause issues depending on the L298N’s input stage.

>>2787223
I could only get L298N to slow down by setting the PWM to an unpleasantly low frequency (100Hz). The other motor drivers I've tried are much better in that respect. But for whatever reason L298N is still the first one in the curriculum.

>>2779471
I used mythtv since 05 or so, now emby. The heat output from SSD is or was lower, and latency or jitter is more predictable which might be important. Also loud music bass will not disrupt a SSD.

>>2787297
yes, i will use the jumper on the module to provide 5v and power the arduino with an external buck regulator.
>L298N's input stage
i am not familiar with this, could you elaborate?
>>2787302
I am using this at full speed currently, just switching directions

>>2787320
If the 30 or 100 uA across the resistor drops the GPIO's voltage below 2.3V it won't work according to the data sheet.

>>2774325
Anyone have experience using a LoRa module? Wich module and how bad it's the latency at +5km? It's LoRa the best option for having a constant stream of data, the packages would be ~100 bytes

>>2787451
>constant stream of data
LoRa cannot do this, the protocol defines a need to have down-time between packets to keep the airwaves clear.

>>2787451
Depends on what you define as “constant stream”
Lora sends data using a “chirp” like a bird.
TCP (well originally) could handle 5 minute idles with no packets and still maintain the connection at the OS level.

>>2787684
>>2787693
I would like a package every 100ms but one package every 2 seconds is the longest I can do

I’m traveling for work and brought my basement with me. Ended up in a section 8 extended stay and now I’m thinking about what sort of imporomptu security I can come with. I’ve got a good selection of ICs, relays, caps and resistors with me as well as esp32, laser/collector, small servo and a dc -dc super boost converter that’ll put out a couple good sparks so I’m not short on ideas just wondering what you would do. Also have a gun but that’s not as fun as an elaborate Rube Goldberg crackhead zapper.

I heard that there are issues with the ESP32S2 and its USB not waking up without replugging it. I’ve also heard that high polling rates can cause issues. I’m looking for a similar MCU with both USB HID and Bluetooth as the ideal mouse/keyboard/joystick controller. Enough GPIOs to run a 100% keyboard matrix would be nice too, but isn’t a requirement. Having existing code written would also be handy. Will other ESPs work for this, like the S3 or C6? Or should I look for something from Nordic? Or perhaps combine a USB HID MCU like an RP2040 or STM32 with a dedicated Bluetooth chip/module? I’d probably run it off a lithium iron phosphate cell, but those go up to 3.6V so probably need to use an HT7333.

I want to be able to run a corded mouse, and unplug the cable and have it seamlessly transition to wireless. The option of communicating wirelessly to the other end of the cord or to a dongle would be neat too.

>>2787328
Lol, dark-mode data sheet. That’s a first.

Hello /mcg/

I stumbled across HC-05 serial BT transceivers on ebay and have some questions. I take it these things talk TTL serial on the MCU side, BT on the other. Do I need a pair of them? or is there a serial BT standard, so I could get away with just a bog-standard BT dongle on a computer?

Also, how good is BT at passing through gyprock walls?

>>2789830
It’s probably able to be picked up by the computer’s standard Bluetooth modem/dongle, but how that data is actually received isn’t necessarily trivial. I think my laptop’s Bluetooth hardware shows up as a serial port though so it might be pretty easy. Otherwise it’s probably pretty doable with a python lib.

>>2782937
Segments weren't even remotely hard.

>>2789925
No, especially since we had multiple dedicated segment registers.
But, don’t forget that zoomers can’t even deal with wires on their keyboard and mouse, so perspectives are changing as to “what is hardship?”

>>2789967
>zoomers can’t even deal with wires on their keyboard and mouse
This isn't even remotely true, fuck face.

>>2789978
Sorry, you’re right. I heard about zoomers that need those PS/2 wired keyboards because they have low latency true n-key rollover for pro mindcraft gaming.

>>2790075
It's as if you enjoy being wrong.

>>2782422
Wow this is an amazing question and somebody should answer it.

>>2790531
Yeah this thread can be brutally slow, I'm considering leaving it to die and merging it back with /ohm/, but when it is used it acts as a nice containment thread for a bunch of code posting. /g/ moves too fast for all but the simplest of embedded questions, though speaking of which you may have luck on the friendly gnu/linux general thread, they know something of raspis.

Are you the anon from last thread? I can't think of any other methods, assuming booting from an image on an external storage device is no more preferable than booting from an image on the SD card.
The whole GPU bootloader thing looks like a massive pain to me. All I can suggest to you is to consider:
>forking an existing bare metal project for the pi where all the hard work has been done for you
>choosing hardware that's actually designed to run bare metal code, like the Ox64

What's the project?

>>2790562
Or look into rtlinux. It lets the linux kernel deal with the GPU, CD card and so on and gets out of the way so your code runs on the bare metal.

But I suspect that Anon is confused by the Pi's small size. They aren't mcus. You wouldn't expect to easily bare metal a 386-based board, much less a i7 or Ryzen. A Pi is no different.

>>2786981
The flashing process for the AVR seems much more complicated than for STM32. I have since found out about the USBasp and will try that soon. The STM32 dev boards seem to be the easiest way to get started but, like you said, the STM32 seems much more complex and thus AVR development is suggest for newbies to embedded (I started doing Arduino a few months ago)

>>2790562
>>2790645
Actually the pi baremetal examples look pretty simple.
Regarding that anon's question, maybe the pi has jtag ports available?

>>2778205
>ipa + toothbrush
Does it have to be a specific brand? I only have hazy little thing in my fridge.

Is there a program I can use to simulate a STM32 or some other microcontroller and connect it with virtual resistors and shit? I don't have a job anymore and I've just been looking to practice embedded applications

>>2790654
The STM32 has a bootloader built into it that supports serial and (for suitably equipped models) USB firmware upload. It's much easier to drop in a bootloader when you have 32 bits of address than with 16 bits.
It also has a debug mode which is more or less equivalent to what usbasp uses, and you can load flash that way too.

>>2790819
I'm not aware of anything free but you can emulate some ARM boards (including some STM32 ones) with qemu. If you want actual hardware emulation with analog electronics I'm not aware of anything free. There are dirt cheap actual boards though.

>>2790709
ipa as in isopropyl alcohol, not India pale ale.

>>2790935
Just use “2-propanol” like the iupac chads and remove all ambiguity.

>>2790562
/g/ is fucking garbage and i'm pretty sick of their faggotry, not gonna lie.

>Are you the anon from last thread?
maybe? maybe not the last thread but i've asked related questions here before.

>What's the project?
just baremetal shit really. i want to get down low as possible, and was looking for ways to play with kernel.img without it turining into computing from the 80s (swap that disk motherfucker, now swap it again!).

>>2790645
>You wouldn't expect to easily bare metal a 386-based board, much less a i7 or Ryzen. A Pi is no different.
well i'd download a car if it could. i've fucked around on cortex-ms before, although that was mostly rolling c on a donor under keil and injecting via a usb cable. doesn't look like it's that easy on a pi. i intend to use one because i have a couple lying about, and some other arm systems to fuck with once i've got a bit further. or i might go back to fucking with the cortex-m i've got.

>>2790655
>maybe the pi has jtag ports available?
don't think they do, no.

i am considering connecting the two i have, then dual booting one with raspberry pi linux and my own kernel.img, if that's possible and it might be. i figure if my shit doesn't work i can reboot it in linux and use the linux-to-linux connection to modify the test image. other than that my only other idea is become homeless in LA and get all the free money and hobo-pussy.

would you call that hobussy? fuck it, i will.

>>2790531
>>2790974
why don't you just do a microkernel project on the pi? I haven't tried myself, there has got to be a mature project out there.

With a microkernel you still get plenty of useful OS magic like bootloaders and driver blobs, then you can also tell the OS to fuck off and just run your app until it dies

>>2790974
>don't think they do, no.
lol i'm wrong

>>2790980
i kinda hate linux, c and gnu. i'm trying to get away from it. just a thing you know.

>>2790994
>i kinda hate linux, c and gnu. i'm trying to get away from it. just a thing you know
ok do the same thing with bsd and fortran

>>2790995
>ok do the same thing with bsd and fortran
take hormones and wear knee socks? way ahead of you there buddy.

>>2790819
There's a site called wokwi, personally I don't like it but it might be what you want

>>2787735
I found the RFD900 it just what I wanted but it's a little expensive, this one have a range of 40km if someone knows a ~10km version that it's a little cheaper I will send him pics of my anus

>>2791016
i have looked at risc-v before but i don't want to go spending more money at the moment when i already have gear at home, even if gear at home is memealicious. i intend to get into it at an indeterminate point in future, along with all the other shit i will absolutely definitely possibly maybe get around to.

>>2790974
>well i'd download a car if it could
Same here. My point was that unlike back in the day, when you could bit-bang a floppy drive (something I did back in school), modern desktop PCs are really fucking complicated and the Pi is a closer to a modern desktop PC then a mcu.

That said, I encourage you to keep at it. It seems the Pi has a JTAG https://pinout.xyz/pinout/jtag

>>2791172
>RPI literally hogging the term pinout
"Makers" were a mistake.

>>2783897
>MPU6050
why would you use an ancient and obsolete imu

>>2791249
Because it's cheap and what more do you need for a very simple drone? Especially if you were thinking of taking apart wii controller for your IMU.

>>2790974
>>2791172
Pi is "easy to use", but only for some definition of use.
Documentation useful to system administrators and developers is hard to find, in within all the garbage guides aimed at the lowest common denominator.
And its boot process is bespoke garbage rather than following standard arm platform specs.
>>2791210
most of these makers can't even into typing `make` to build from a makefile.

>>2791317
>Documentation useful to system administrators and developers is hard to find, in within all the garbage guides aimed at the lowest common denominator.
yeah, i have noticed this, and it has made me consider switching to risc-v or even x86 (lol, LOL LOL LOL). the raspberry pi forums aren't the best, but you can say that about most tech-related shit. /diy/ seems to be the least g-a-y. but here we are.

>>2791380
I am still bitter from the serial port going away from the usual pins in rpi3 (or was it 3+?), as they connected it to the bluetooth chip instead.
Getting it back needs applying a dtb "overlay" using their fickle bootloader.
This carried over to rpi4 despite that one having several UARTs in the SoC, remappable to arbitrary gpios.
Sucks that they let rpi degrade this much.

>>2791390
it always happens with these idealogical startups (we want the kids to learning!). they get to a point where they have to fuck something up. because it's not like they're cheap little educational single boards anymore, they're turning into value added shitty lin-boxes.

>>2791424
I gifted my niece an Arduino kit instead.
As far as SBCs, I have moved on to RISC-V, not even bothering with the ARM ones again.

>>2791425
What's RISC-V like for SBCs, and what do you do with them? Specifically, do you use linux, an RTOS, or bare metal? And do you require the GPIOs? For Linux stuff with existing software (and probably not using the GPIOs) then the Raspberry Pi boards seem to be the most compatible things out there. But if you're interfacing with the GPIOs with your own code, especially without an OS, existing software doesn't matter as much as well designed hardware.

If an eeprom has been locked but it doesn't have a lock fuse.. Is there anyway to interface with it to grab the program like using a debugger in circuit? I've seen russian services for like $500 that can pull the program.

>>2791681
Internal or external EEPROM? If it's external then you can just (partially) desolder it and scan through all its addresses. If it's inside an MCU then you'd probably have to use those janky hardware hacking techniques of strobing power during startup with just the right timing to bypass certain checks. Well even if you can extract the memory, converting it into human readable content may not be easy. Worst case it's encrypted.

>>2791444
I run Linux (Arch Linux) just to play with Linux on RISC-V.
But there is fun on baremetal (assembly, uploaded and run via u-boot), RTOS (nuttx specifically) as well as alternative OS kernels, too.
atm haiku and serenityOS are working on their RISC-V ports. Haiku got their system with full GUI running months ago.

>>2791760
Does risc-v architecture have a corresponding gpu or something?
Apparently a rasberry pi “boots into the gpu” so we don’t even need arm cpus anymore. Apparently.

>>2790860
what are the upsides of using that instead of just sticking to tarduino?
is picrel any good?

>>2791827
STM32s are definitely more powerful than 8-bit AVRs. Though the word "arduino" no longer just refers to 8-bit AVRs, they've released official boards with Renesas somethings and Microchip SAMD-series MCUs on them. The important thing about STM32s is they're used heavily in industry, and they have a very wide variety of chips running effectively the same architecture. Once you've learnt to program them efficiently, you can find an MCU for basically any project you want. The bad thing though is the boards from alibay are often fake. See:
https://github.com/keirf/Greaseweaz<wbr>le/wiki/STM32-Fakes

You also may not need the extra power of the STM32. Personally I've barely ever never needed more power than an ATtiny can provide. I bought a bunch of CH32V003s and CH32V203s just to mess about with though, they're neat chips.

I'm trying to connect arduino to a motor controller via uart. the controller is 3.3v, but 5v tolerant.
sending commands to the controller works great, without any issues.
receiving commands does not work. Serial.available() always returns 0.
I tried looking at the rx and tx lines with a logic analyzer. when i have everything connected, tx from arduino to rx on controller works fine, i can decode the commands sent. the rx line on arduino always stays high though. if I disconnect the rx line from arduino and look at tx from controller, the line works fine then (i receive the response im expecting).
Why does the signal (response) disappear when i connect everything? is there something holding arduino rx high?
Also, the rx led on arduino does flash when im expecting a response, but logic analyzer and arduino does not see anything. Do i need to rip off the ch340 chip? is 3.3v not enough to register?

>>2791780
>“boots into the gpu” so we don’t even need arm cpus anymore.
for whatever reason the gpu boots first but then hands over to the cpu. so you still need the cpu.

>>2792012
Thanks. Sometimes i wonder if those PC GPU cards have more power than the processors nowadays, lol.

I remember getting my first laser printer in the 90s and i read the specs and was disheartened to learn it was a powerpc processor way more powerful than my actual PC that was driving it through the centronics parallel port.

>>2791963
You can’t use the Rx and Tx lines for UART, they’re already tied to the CH340 and UART doesn’t work as a bus like I2C does. Set the UART to alternate pins instead.

>>2792051
>Thanks. Sometimes i wonder if those PC GPU cards have more power than the processors nowadays, lol.
i think a lot of them do, but it's a different sort of compute power. my understanding is that gpus are designed effectively as matrix calculators. so the circuitry is optimized for i guess linear algebra or vector calculus or fucking whatever, as this is important for graphics. turns out it's also important for number crunching in data centers and artificial intelligence, or as i have started to call it, advanced interpolation, but that's a copy pasta for another time. server side and shit they don't do graphics and don't have video output of any sort, they just crunch numbers. gpu seems to be a historical anachronism kept around just because. fucking nerds.

>I remember getting my first laser printer in the 90s and i read the specs and was disheartened to learn it was a powerpc processor way more powerful than my actual PC that was driving it through the centronics parallel port.
dude that's fucking nuts. every time you print something it's just sitting there, quietly judging you.

>>2792147
thank you.
i tried to run software serial on other pins and it works fine now.
just a thought: if i want to use hw serial on pins D0 and D1, can i just remove the CH340 chip? i can still program the arduino via icsp using another one as isp, correct?

>>2792217
Yeah desoldering it would work. Though at that point you might as well be using an Arduino Mini instead. Bootloaders were a mistake.

>>2790994
>I want to do baremetal programming
>kind hate c
this is incomprehensible, fix your shit or get the fuck out

>>2792642
Maybe he really just wants to program in ASM?

>>2792649
Virtually everybody who programs in C long enough can also do ASM.
Ever heard of software bugs? Well, it’s a thing.
You break into the monitor, it’s all assembly. You can’t avoid it in the real world.
> i only use source level debuggers
Go back to designing web pages and python.

has anyone built a custom arduino board per project, i.e. instead of using a standard arduino and making a bunch of ugly connections, make a PCB with an STM32 chip onboard and maybe FT232 and flash an Arduino bootloader into it and it basically becomes arduino? Then route only the connections you need and add other parts as needed for the project. Or use an external FT232 chip since it would be a waste to use a dedicated FT232 per project.

can someone tell me why the following code gives me way less than 1 stepper revolution per second?

I have a simple setup,

-Arduino Uno
-Nema 17 Stepper motor (200 step revolution) pt num STP-MTRL-14034
-DM422E stepping drive (minimum 400 step/rev, the current setting)

The low/High change is quick enough for 400 cycles a second. Only it takes more like 3-5 seconds for a full rev, with no physical load on the motor, an ample 24vdc power supply.

These are sinking outputs if it matters (so only the PUL needs to go LOW for a step, the others are already LOW)

>>2793626
NVM, i'm retarded.

The serial print was the issue, low baud rate. but either way fucks up the code timing

>>2792642
>this is incomprehensible, fix your shit or get the fuck out
you're a fag, you get the fuck out.

>>2792649
basically yeah. thinking about hex just because.

>>2792652
>i'm a huge faggot, please rape my face
yeah dude we know. thanks for your contributions but no one asked and no gives a fuck about your precious bullshit so 'fix your shit' and get the fuck out you sperglord motherfucker.

>>2790709
>I only have hazy little thing in my fridge.
KEK

>>2793626
>>2793627
[code]
#include <util/delay.h>
void gUARTWrite(unsigned char iByte) {
 while (!(UCSR0A & 0x20));
 UDR0 = iByte;
}
int main(void) {
 UBRR0L = 0x1;
 UCSR0B = 0x8;
 UCSR0C = 0x6;
 DDRB |= 0x8;
 while (0x1) {
 gUARTWrite((PORTB ^= 0x8) ? '1' : '0');
 gUARTWrite('\n');
 _delay_us(1250);
 }
 return 0x0;
}
[/code]
Are code tags supported here?
Had to setup my oscilloscope for something, so I thought I'd just bang it out.

You need to adjust the 1250 delay by a fixed value, the entire loop and port toggle and everything runs in definite time, i.e. the same number of cycles everytime, meaning to get a perfect 1250 us delay, you need to adjust it down til the physical output matches.

Also, the output signal is in a perfect 50/50 duty cycle using a toggle, turning off and on and looping back is not a perfect 50/50 cycle, because the jump instruction back to the beginning of the loop biases the duty cycle towards the last setting, i.e. low in your application.

Also, I tested it on a Nano, but it should work just the same on an UNO.

>>2793682
*Oh yeah, 500K baud rate for serial comms.
*And also the adjustment of the fixed delay value may even need to be positive (or may even miraculously negate itself) as the 16 Mhz CPU clock cycle often is too fast or too slow to a factual 16 Mhz cycle.
Serial seems to work, but of course the entire console gets flooded.

Hey /mcg/ didn't see a 3d printer thread so figured I'd ask here.

I'm going to be building an FDM printer. Going to be using an Adafruit Grand Central M4 Express (SAMD51 @ 120mhz) as the controller, and paired up with a RADDS v1.6 board, and 3x stepper expansion. Working on setting up Marlin for this, as the Grand Central isn't 100% pin-for-pin identical to the Arduino Due, and the current Marlin source code assumes use of the Grand Central with RAMPS which isn't identical to RADDS. Drivers will be TMC2226 in standalone mode, as I doubt I'll ever need spread-cycle.

My question is what board to choose for running octoprint. I don't plan on using a webcam, so it doesn't need to be stellar in terms of processing power.

Things I've considered:

>Beaglebone Black
Expensive for what it is, classic, tons of documentation, comes with Debian, guide for installing gentoo

>Mangopi MQ Pro
RISC-V, cheap (and cheap for what it is), extremely power efficient, potentially not powerful enough to do anything but run the octoprint server, good gentoo installation guide

>La\Le Frite\Potato\SweetPotato
Probably the easiest option, but kinda the most boring. It would work, but there would be little to no tinkering.

What SBC in the <$75 price range would you all go with?

>>2793623
Yeah, sorta. I frequently solder ATmegas and ATtinies into custom PCBs, especially tiny13s and tiny1614s. But I didn't go out of my way to use an ICSP programmer to put a bootloader onto them so I could use a CH340 to program them, because that would be stupid when I could just use the ICSP programmer directly. Bootloaders are a waste of space. The whole point of dev-boards is to prototype a circuit that you'll later convert into a PCB, not having ICSP being the default method of programming is real stupid, especially since we've got ourselves into a wonko world where not being able to debug or even read back static memory is somehow the norm. Soldering shit to a dev-board is truly poverty-core.
>FT232
lmao, take the WCH pill.

>>2793626
Use a constantly running hardware timer instead of delays, that way you can get the timing properly synchronised to your clock without having to worry about other code taking up time. Though you should probably use interrupts anyhow. If you write only a single character to serial it should take only a few clock cycles, your code won't have to wait for it to get sent, though knowing the arduino library's code quality it might still do so. I'm assuming it doesn't have buffer registers for multiple characters, idk I barely ever use UART on AVR.

>>2793685
Why not put the serial comms on an incrementing variable (like the aforementioned timer) so it only writes data every X full cycles?

>>2793694
Have you considered a 2nd hand android phone? That comes with the touch screen you'll probably want for interfacing with the printer.

also rip 3dpg lmao

>>2793708
>Why not put the serial comms on an incrementing variable (like the aforementioned timer) so it only writes data every X full cycles?
Not my code, just reimplemented what the anon I replied to posted.
Maybe an application he's using requires the serial comms, idk.
>constantly running hardware timer instead of delays
_delay_us() is an AVR provided function that requires compile-time knowledge of the delay value, because it achieves the delay by precisely calculating cycle times of loops of nops.
I get what you mean, but *you* can use _delay_us() if the MCU ain't doing much else.
>you should probably use interrupts anyhow
Eh, depends again on what else the MCU needs to do.
For just switching on/off in at delays that are all known in compile time, interrupts might be a bit overkill.
>your code won't have to wait for it to get sent
You load a byte into UDR0 and the MCU does the rest (provided you've correctly set up the UART interface).
Then you poll UCSR0A & 0x20, if the bit is set, it's busy, otherwise you can load the next byte.
Ergo, code blocking because of serial communication is a programmer's choice, not a limitation.
>I'm assuming it doesn't have buffer registers for multiple characters
No, just the one, like I outlined above.
Inbound packets are also read from UDR0, and in this direction, the MCU buffers one or two additional bytes, can't remember.

>>2793716
>*you* can use _delay_us() if the MCU ain't doing much else.
Not if you want to time the motor accurately. The issue isn't the lost clock cycles in terms of stuff the MCU could be doing, it's the fact you're adding the delay function to the delay of all the other stuff you've got in the loop. You're assuming the microsecond delay function's delay is significantly greater than the delay from all that other stuff, but obviously that's a wrong assumption to make. Yeah you could take that into account and decrease the delay accordingly (up to a point) but it's just a less robust and worse programmed solution compared to using a hardware timer. Everything uses hardware timers, this anon should learn to use them properly.
>interrupts might be a bit overkill
A lot of things use interrupts too (e.g. ADC code), this anon should learn to use them properly too.
>code blocking because of serial communication is a programmer's choice, not a limitation
If you're given that choice, yes. But you don't get that choice when you say 'serialWrite("High");' instead of writing the registers directly. That waiting and polling is filled with noops when you use the tarduino lib. A robust code would have interrupts on the serial writing too so you can do other stuff while the bytes send, but I think that's overkill if the baud rate is sufficiently high. Just writing a single character is a quick way of avoiding the problem regardless of baud, assuming it doesn't noop away the time spent polling until the final character is finished sending. Maybe it does do that, since it could make receiving serial comms more reliable.
If the AVRs had DMA then you wouldn't have to worry about it.

>>2793719
>The issue isn't the lost clock cycles in terms of stuff the MCU could be doing, it's the fact you're adding the delay function to the delay of all the other stuff you've got in the loop.
This code >>2793682 runs exactly switches exactly at 399.5 Hz on my Nano.
Technically, using the serial interface introduces the unknown factor, yes, you're not wrong there.
But remove that all the serial and it will switch the port EXACTLY the same period every single time around.
There's nothing that could block it then.
>this anon should learn to use them properly too.
Not wrong, but I believe it's more important for anon to start coding AVR chips with real AVR code and not use the Arduino libs.

>>2793719
>it's the fact you're adding the delay function to the delay of all the other stuff you've got in the loop
Already addressed here, by the way >>2793682:
>You need to adjust the 1250 delay by a fixed value, the entire loop and port toggle and everything runs in definite time, i.e. the same number of cycles everytime, meaning to get a perfect 1250 us delay, you need to adjust it down til the physical output matches.
Technically, you can calculate it by looking at the assembly instructions and adding up all the cycle times and then deduct that, but then you're not accounting for the resonator tolerances, so manually adjusting with oscilloscope feedback is the most reliable way.

>>2793708
Nah, I do everything through the octoprint server, and if I do need to deal with directly touching the machine, then I'd use the RADDS version of the RepRap Discount Display.

>>2793708
I don't know anything about ATmegas but I make my own custom PCBs with bare STM32 chips, no bootloaders, just program them directly via JTAG. I am helping an Arduino user who prefers the easy of use of Arduino IDE and programming via bootloader. I just want to show how nice the end project will look when everything is done on a single PCB, no ugly interconnects and pin heads. So my plan is to arduinize a generic STMF32F1 chip and essentially make a Blue pill arduino board. If I understand it correctly, I won't need any USB to serial converter chip like FT232 or whatever. My understanding is I will need to load the STM32 arduino bootloader via JTAG and then switch booting to bootloader and the chip should be ready to be programmed via USB in the standard arduino IDE.

>>2793708
>lmao, take the WCH pill.
what is so lmao about it? Your CH340 is probably a chinese fake and it is cheaper and is used on cheap chinese clones and some people report reliability problems. Other than that there is literally no difference.

>>2793797
I don't know about STM32 chips specifically so the following could be wrong. The Arduino IDE expects to use a COM port for programming. All the Arduino boards of have USB to serial and talk to the PC via serial.

>>2793722
>Not wrong, but I believe it's more important for anon to start coding AVR chips with real AVR code and not use the Arduino libs.
I'd agree with that.

>>2793805
CH340s aren't "chinese fakes" because they're original chips made in china in the first place. The specs aren't brilliant but they're way cheaper than FT232s and usually good enough. FT232s have a bunch of other advanced features that you just don't need to pay for. WCH also make some other interesting original chips, like some native USB 8-bit microcontrollers, and now also some 32-bit RISC-V microcontrollers. For these RISC-V chips, they sell a kit on aliexpress with a USB programmer dongle, a dev-board, and a bunch of MCU ICs in a bag, just like it should be.

>>2793892
The STM32 has native USB. My assumption is that the bootloader configures the USB port to act as a virtual USB-to-serial device.

>>2793914
>The STM32 has native USB. My assumption is that the bootloader configures the USB port to act as a virtual USB-to-serial device.
You'd have to read the code to confirm that.

Have you ever just wanted to choose the most esoteric and obscure MCU for a work project so that you have more job security? I've been tasked with designing an internal prototype as an intern. I'm supposed to design the PCB and also write firmware, and two MechE students are designing the enclosure and doing some simulations. The company is a startup and run by MBAs. I want to get hired again after graduation.

>>2793968
You kinda have to actually have a job before you can pull a stunt like that.

>>2793974
I'm getting paid minimum wage. This company is a complete clusterfuck

>>2793968
You're not going to get a big enough raise from that company, so it's better to pick something popular to help you get a job elsewhere.

>>2793968
>both PCB and firmware
>for minimum wage
Wow.

>>2793968
> designing the enclosure: 2x
> MBAs: at least 2x
You, of course, realize that you’re doing all the work, eh?
The MBAs are taught to extract all the money—nay… more than all the money (they will put the company in debt to themselves) from the company.
This is a one-way ticket to nowhere’sville.

>>2793914
>>2793925
> bootloader configures the USB port to act as a virtual USB-to-serial device.

What do you mean by that?

My understanding is that the bootloader that is running on the microcontroller uses a USB peripheral instead of UART, and listens on a USB port to receive program code and flash it into the flash memory. There is also a driver on the PC side so that the microcontroller is accessible as a virtual COM port. That driver is similar to the ones that come with an FT232 or CH340. It is very similar except there is no extra chip to convert USB to serial, since USB packets are sent directly from PC to the USB peripheral on the microcontroller.

So the way I understand it, in a standard Arduino set-up with a UART based bootloader, there are two conversions when uploading a sketch: Serial to USB (in Arduino IDE, when writing to a virtual COM port, a FT232/CH340 driver converts it to USB packets) and USB to UART RX/TX(electrical signalling on theFT232/CH340 chip). But with Blue pill you use a USB based bootloader so the second conversion is not necessary: ArduinoIDE opens and writes to a virtual COM port and the Blue pill PC driver converts serial COM data to USB packets and they are received directly by the Blue pill bootloader on the uC.

>>2793925
We’ll either way it’s acting as some sort of USB device, since bluepills both don’t have a usb serial IC and can be programmed via USB. Maybe they just present as a custom usb device that isn’t compliant with any particular usb class. A similar thing is done with an arduino pro micro, or any other dev-board that has native USB (and doesn’t just have two USB ports). If I recall the ESP32-S3 can be programmed via its USB port without needing a bootloader, but there are problems with getting it to reset afterwards or something along those lines. Maybe they fixed that in the C6, I doubt it though.

Take me back to the days where computer parallel ports could be used as GPIOs for programming an MCU directly.

>>2793968
No, but going for extremely cheap Chinese MCUs with shitty documentation and an esoteric tool chain has been tempting. But it does mean more work for you if you're not familiar with the chips in the first place. If your boss doesn’t specify which architecture at the very least, they shouldn’t come complaining when you use something z80 derived.

>>2794030
How the MCU receives the data isn’t that important, it’s some form of serial data packets either way (usb = universal serial bus), the difference is in how the MCU is seen by the computer when you plug it in. If it’s just a generic data standard that your ide uses custom drivers for then it’s less portable compared to using an existing standard like USB-serial, which has common drivers available. The arduino ide in particular is designed to connect to a serial port and not doing so is a bit more involved. Though I guess it could instead present as a STlinkV2, that could be handy.

>>2794033
Yes, that's what I am saying. ArduinoIDE can only program arduino via a virtual COM port. And all the difference is how this virtual COM port is created. FT232 comes with VSP drivers .while the bootloader for STM32 probably configures USB as CDC and since CDC is supported natively by windows, no special driver is necessary but I am not sure.

>How the MCU receives the data isn’t that important,
That's hugely important but I guess you may mean that it is not important if we are talking about the PC side of things. My point is it's brilliant that there is a USB based bootloader so there is no need to use a USB to UART chip and it seems to be relatively straightforward to configure ArduinoIDE for this kind of setup. But I haven't tried it yet.

>>2794035
>ArduinoIDE can only program arduino via a virtual COM port
Wrong, you can program an arduino by using the “upload with programmer” option that uses its own usb code, which is all I ever do now. I’m doing that with a USBasp or serialUPDI dongle, but in principle you could build such a programmer into your dev-board, or even make the native usb MCU present as a programmer dongle directly. AVRdude, which the ide uses for programming, can use all sorts of programming methods, including official PICkits.

The arduino hardware and software system was designed poorly, shoulda used no bootloaders with a programmer built into the dev-board. Somehow old style arduino unos use an atmega to act as a usb interface directly, but instead of using it as a proper ICSP programmer with debugging support they just programmed it into a glorified usb to serial IC instead. They also used socketed atmega chips, but require a bootloader on them so you can’t just buy fresh avr chips and use them without having to own an icsp programmer anyhow. Arduino brainrot was there from the start.

>>2784419
the noise he must be getting from these wires must be unreal, i doubt whatever he built actually works

>>2794056
So Arduino without a bootloader is basically an alternative toolchain + IDE + HAL drivers / SDK. Why even bother then. I guess it provides an extra layer of abstraction around the HAL drivers which it still includes and uses to build code for a specific platform such as STM32. Why not use STM32Cube then. Probably the most important difference is it eliminates the need for an expensive debugging probe if you don't care about debugging on the target. I know newer arduino IDE has debugging options using SEGGER J-Link/ST-Link and such but again, why bother? You could just use STM32CubeIDE, or Keil, or Eclipse, or whatever. Seems like the Arduino Platform is stepping into the professional market territory while still providing easy options for the beginners.

>>2794056
>shoulda used no bootloaders with a programmer built into the dev-board.
Like I said I don't know anything about Atmegas or PICs so I don't know what you mean by USBasp or any of those dongles. I can only speak for STM32 and it would be a really expensive board to include both STM32 and an ARM debugger such as a Segger J-link onboard. STM32 eval boards have this setup and they are not cheap and you'd still need to configure your dev environment with additional Segger drivers or ST-Link drivers if you choose to use it and potentially a 3rd party GDBServer. That would be too complicated for a beginner. It was perfectly reasonable to create a board with a cheap 8-bit MCU with an UART based bootloader and a USB to serial converter chip onboard and with an easy-to-use IDE since Arduino targeted absolute beginners. But now it sounds like they need to grow and expand their market to more experienced users so they offer all kinds of advanced options while maintaining the least common denominator.

>>2794195
this is funny, because i build prototypes like picrel all the time and they work perfectly fine even at 175Mhz with several I2C/SPI peripherals. And that japanese video is a 8-bit MCU running at 8Mhz tops. Of course it is going to work just fine. It is so funny when PCB gurus on youtube lecture people about this whole transmission line theory, current return paths at high freq, proper grounding, and how to properly stack power and ground planes for 4-layer boards and such, while simple prototypes with messy wires all over the place work just fine. Of course proper PCBs are important for long term reliability, but to say that nothing is going to work is not true.

>>2794275
Please rewire that bird’s nest.
PCBs also tend to make bigger capacitors so some things actually work better as point-to-point, but that’s a complicated topic.

Coming from STM32 dev tools and IDEs, I finally installed Arduino like a cool kid that I always wanted to be. What an interesting experience. The IDE is kindergarten level simple. Basically a couple of buttons. Apparently there's no concept of projects and all code is meant to be put in one single file. Just perfect for blinking an LED. I just wanted to explore bootloading options and it is a mess. There is a Maple derived bootloader that comes with a custom driver which registers a custom USB device. Then there is also a HID bootloader that doesn't need a driver. But the support is broken in the new arduino IDE 2.x. It registers itself as a HID device and the first upload is done without picking a COM port. And then through some magic it creates a USB CDC COM port and becomes visible as a virtual COMx device instead of a HID device. I know very little about that but the problem is old Arduino IDE 1.x did not require picking a COM port, and so the first upload worked fine. But 2.x bails out with "no COM port selected" error. One option is to select a random COM port like COM1. Long story short, stm32duino sounds like a niche community. Most people who work with STM32 chips either use a proper dev environment for adults, or use a programmer/debugging probe like ST-LINK to program their STM32 based arduinos over SWD. Those custom boot loaders are a fucking mess. Imagine the new IDE "feature" broke it and nobody cares and nobody is fixing it.

>>2794964
Arduino everything and bootloaders were a mistake.

>>2794964
>the most important part when devlets change hardware is the change of the devlet-mandated vendor-specific IDE
Kill yourself.

>>2794964
> bootloader broken, nobody cares
I’ve seen this before. They poison the open version right before they re-monitize it which will either be a paid/fixed version, subscription that works for a while, or some other novel mba intern idea.
Same thing happens with linux, qemu, etc.

>>2795129
The funny part is they fixed it (or at least attempted to fix it) in the arduino-cli command line client. I;ve seen a PR that vaguely mentions lifting the requirement to select a port. But not in the UI version. Very strange. It just feels like there's not enough demand to pressure them into fixing it. It is possible that very few people even care about these exotic home made bootloaders. It is definitely not the mainstream approach. It is amazing how much some people prefer the "convenience" of a one click upload with no special hardware over the flexibility of using a debug probe that requires a little bit of configuration.

>>2795193
There's also price and learning curve.

>>2795193
The thing is, if you’re going out of your way to use a debug probe, you’re probably savvy enough to not be using the Arduino IDE. At the very least use PlatformIO or vendor IDEs. PlatformIO kinda runs on Arduino code itself for some hardware, so beware. Better is to use (community made, FOSS, platform agnostic) command line tools and a text editor of your choice. They often support 3rd party programming tools, which is good because I’m not buying a fucking Atmel Dragon. More of a pain to get initially set up, but once your workflow is established it’s much more convenient to have all the configs already in your makefile. It’s probably also better for using other languages, like Rust.

>>2793805
>>2793708
FT232 are overpriced AF.
CH340 are literal shit that can't tolerate the slightest clock drift.
CP2104 / CP2102N is where it's at. Cheap and actually decent.
>>2794353
Sockets, FFS.
>>2794964
Use avr-libc or assembly outright.
Arduino SDK/IDE is only good for trivial/educative.
Better yet, ditch 8bit legacy and embrace RISC-V, with CH32V or ESP32C.

>>2796210
The chinks make knockoff FT232s for cheaper than those CP210x chips:
https://www.lcsc.com/product-detail<wbr>/USB-Converters_JSMSEMI-FT232BL-JSM<wbr>_C7436405.html
I wonder what they're like? The datasheet is in chinese jpegs, so it's enormous and can't be translated without ocr. Can't see if it uses the FTDI drivers, I'd guess so but who knows.

>>2796223
> unknown shit is even worse than known shit.
Those are the shit that shit shits.
FTDI is probably already working on bricking them, software updates for FTDI drivers should be disabled permanently. The main problem that made the chinese clones shit was actually FTDI.

The CP210x likker guy in >>2796210 is right, use the SILabs versions, they’re as based as Texas Instruments.

Is there anything like these buzzers but they make a pleasant sound instead?

>>2796644
Buzzers are just a membrane bouncing back and fourth. As such, it's physically impossible for the sound to be pleasant. What application do you need it for?

>>2796644
They have a built-in square-ish oscillator, of course they sound awful. If you want something that sounds better, get a piezo disc and feed it a nicer waveform from a DAC. You might be fine with just ~4 bits of R2R from spare outputs on your micro, though either way you'll need a buffer (and maybe a higher voltage amplifier or a transformer) to drive the disc.

>>2796644
Try put the outlet through a tubing or trumpet?

>>2796800
>>2796784
>>2796711
I mean I'm looking for a different component, not trying to make these sound good.
it's to alert people when an automation device is finished and needs human intervention, but I don't want to go as far as programming a speaker and audio file.

>>2796816
>I mean I'm looking for a different component, not trying to make these sound good.
They don't exist. The least ear piercing I've heard is pic related, but even then it sounds like a pathetic electrical bleating. No datasheet.

>programming a speaker and audio file
It's probably fine if you just output a square wave directly from a timer's compare output, then use a couple of passive filter stages to make it rounder, before amplifying it.

>>2796711
Marketing problem. Just call them
>planar magnetic
And then you can sell them as expensive headphones.

>>2796784
>feed it a nicer waveform from a DAC.
you dont need to do any of that shit, just find a nicer frequency so it sounds more like a beep than a buzz. a uC will just drive a little piezo.

>>2796644
Just buy these cards that plays music and take out the module. You can get the modules themselves even cheaper from china for the initiated.
Have you been living under a rock for 20 years?

>be me, college dropout
>get a job at factory making fortune cookies
>long hours but have to pay rent
>have to put bullshit chinglish messages inside stale dough
>9 hours each day
>hands quickly get numb
>each message more insulting than the last
>fill up bags 50 at a time
>bag gets full, a moment of respite
>stand up, carry bag over to sealing machine
>place bag edge in and stand back
>heat presses a seal
>machine starts singing happy birthday
>every fucking hour of every fucking day
>happy fucking birthday

How viable is it to try and build a working x86 pc from scratch? What would one need to accomplish it? It's more of a /g/ question but /g/ is retarded<br>Preferably to run collapseos.org or Windows XP (the latter is probably very unrealistic)

i'm trying to find some code to use an arduine and a gps module as an autopilot for a fixed wing aircraft but can't find any help on google

the idea is semple, set target gps coordinate in the arduino before flight, and the arduino should be able to get to those exact coordinate, preferably in curved line

>inb4 just use an ardupilot
the cheapest one cost $70 while an arduino mini + gps module will cost less than $10

>>2796946
>nicer frequency
That's the problem. A single frequency is always going to sound harsh.

>>2797045
>How viable is it to try and build a working x86 pc from scratch?
What do you mean "from scratch"? If you mean from a pile of chips, then you might be able to do it with wirewrap.

>>2797102
I'm not talking about schizo-tier processor from scratch, more like get a bread board, order all the necessary MCUs and a cpu socket if its even possible
So yeah, from a pile of chips
Modern motherboards datasheets scare the shit out of me so I don't really know where to start

>>2797103
It would be easy to do a 8086-era PC.

You are never going to build something with a modern CPU. Even if you go for a SOC like the Pi does, the high clock speeds mean you are going to be very susceptible to the slightest imperfection data and control buses.

>>2797102
I’m one of they guys who thinks the non-existence of 8086 microcontrollers is crazy given the amount of software available for it. A microcontroller doesn’t always have an external memory bus though.

Unfortunately, the best way to do it nowadays would be through an emulator on an ARM microcontroller. The chips themselves are pretty unobtainium. I have some old NEC V20s that I saved, but don’t have any of the support chips or keyboard ROMs, etc.

why do some breakout boards use male pins and some others use female pin headers? male headers seem a lot more common.

Drooling retard, here.

I am not sure what I'm looking for in terms of the name. I am trying to add a new crosshair to my game. I can't see the little white one and as a console fag, I can't change the color.

What the fuck would I need to build a device that accepts the input from the PS4, adds a goddamn basic, transparent png file, and then outputs it to the HDMI port of the TV?

I keep seeing shit about the difficulty of such a thing because DHCP exists. I'd prefer not to buy some $200 FPGA just to do this, and I really don't wanna buy different colors of tape to put on my TV like some kind of gaming MacGuyver.

Thanks for any help or ideas, bros.

>>2797337
Yeah, so this was possible on the atari 2600 and your cable TV box because you could just inject an additional analog signal into the channel 3 tuner output. At worst, you’d use a video mixer (a video op-amp) that costs 34 cents.

As you mentioned, you cannot simply inject an extra signal into a digital stream, DHCP/macrovision or no.

You can probably do it with the component out, not sure if PS4 still has that or not, but you’ll have to go down to 720p most likely.

>>2797337
>>2797352
Me again. Have considered using some laser pointers or laser level to project it onto the TV? I assume you want some kind of guide for aiming or something.

>>2797095
>relying on arduino code you get from online
don't do this
>autopilot for fixed wing aircraft
I think the reason they use a more powerful chip is they need to integrate the data from an IMU and combine that with corrections from GPS. GPS itself generally isn't accurate enough, though some guy did a youtube video about getting 3cm accuracy with an ESP32 so look into that. Doing those integrations on an 8-bit AVR without vector operations or hardware division sounds like a pain.
Ask /rcg/ for their suggestions, they may not understand the nitty gritty of MCU selection but they should give you a decent idea of what you're paying for when you get an ardupilot board, or other gps FC.

>>2797163
At least 8051 MCUs exist, you can probably run 8051 assembly on an x86 cpu if you squint.

>>2797175
Male pins are good for plugging into breadboards, which is important when you might need some extra passives. Female pins are better for using with male-to-male jumpers, which are generally more common than other jumpers, and is more convenient if you're just running jumpers from an uno to a module.

>>2797337
>convert hdmi to vga
>inject signal on vga lines
>convert vga back to hdmi
If you do it well it might not look terrible. Skip the conversion steps where possible, maybe your TV or console supports VGA in the first place. Composite will look worse, and I think generally has a lower maximum resolution, plus you need to generate sync signals for timing.

>>2774325
guys, noob here, i need help with this usb to serial adapter, i bought bc it was isolated and you could chose the voltage level, but i do not understand the jumper on the data lines, nor what the txa pin does in this device
i need it mainly to interface with a victron solar charger, and will also be used as a usb to serial generic cable.

Screenshot 2024-05-09 at 15-45-06 4.03€ FT232 Serial port module USB to TTL USB to serial port Magnetic isolation FT232RL Photoelectric isolation - AliExpress.png

>>2797337
Can't you just use a grease pencil?

>>2797455
>4chan ate my response
Fuck you 4chan. Short version again.
>i do not understand the jumper on the data lines
Loopback?
>nor what the txa pin does
Look at datasheet.

>>2797509
Not him, but there isn't a TXA pin in the FT232 datasheet. I'd guess it inverts the RX and TX pins when you tie it to ground, but it could be a custom programmed pin for anything really. It could also be a onewire pin that combines RX and TX with that diode, there's only four pins on each side of the opto after all.

>>2797509
>>2797597
me again, datasheet is here https://pdf1.alldatasheet.com/datas<wbr>heet-pdf/download/166553/AD/ADUM320<wbr>1ARZ.html , which is just an isolator for a serial signal. but now i see that the tx is connected to the txa through the t4 diode that can be seen bellow right in the image, other than that is the exact pinout of the isolator chip

why would i need to get an output pin in an isolator through an optional diode?

and why the data jumper?

Screenshot 2024-05-09 at 23-15-46 ADUM3200 AD Alldatasheet - ADUM3200.PDF.png

>>2797602
If the jumper was for combining RX with the TX+diode node, and there was a pullup, then it could be for onewire. But that doesn't seem to be the case. Tying RX to TX though, as the other anon said, is probably to get loopback. That way you can be sure your serial hardware is working, since each signal you send gets received. Assuming your serial console can do full duplex that is.

>>2797602
>>2797653
If it's set up like this it should be for updi programming, I've seen it either wired through a diode or a resistor

>>2797653
>>2797813
i guess it makes sense thanks, the jumper is not in the correct place but that could mean that chang is clueless

If a processor has multiple SPI controllers, does that mean that it can use them concurrently? Or can only one of them send out data at a time? Specicially talking about the RK3308

>>2797893
I don't know your chip, but normally yes. Make sure you actually have the pins and the DMA channels to use them. If it's ok to be slow, you can bit-bang it with any GPIO to get even more SPI ports, or multiplex them by using multiple CS lines.

>>2782422
There's no monitor program built into the pi so whatever you use to program it will determine how you can hook it up.
Uboot has IP support so if you can boot the pi into that maybe load your images over tftp.

>>2797813
Oh yeah, 1-Wire defines whether a bit is 1 or 0 based on pulse width, while UART is just high or low. It's better for using the comms line for power at the same time, I suppose.
UPDI and DebugWire are the same though, wonder why we never got software support for programming the older MCUs via DebugWire with a USB-serial dongle?

Pico has vin range of 1.8v to 5.5v. So I can use 2 or 3 NiMH batteries. Will it draw more amper if I use 2 batteries instead of 3 and has shorter battery span?

>>2798107
> one-wire uses pulse width
Huh, that’s fascinating. Brilliant idea. I wonder if they use passive filter and can crank it up to RF frequencies, and you wouldn’t even necessarily need a ground lead in common. In fact, if you made an antenna, you’d have “0-wire”

>>2798439
I looked into using a single wire for transmitting information at high frequencies, don't do it. It's objectively worse than using no wires. Not having a return loop just means you've got a really long antenna, the emission pattern of which is everywhere except your target. All your data would be transmitted via the electric field alone, which falls off far faster than the E+M field of a proper radio transmitter.

>>2798482
> no wires
I could never figure out why we don’t use IR more. You just put a led/photodiode (if you need bidi) on the dev board and point it. Dirt cheap. Cheaper than pin headers. Should be able to do into the multi GHz, although, at that point, you might not want, literally, “infra red” but rathe one of those near UV LEDs at GHz speeds. Kind of like fiber optics, sans fiber.
I think most of the microcontrollers that have built-in IR channels are mostly for “remote control” class service though. But, for run-of-the-mill low-end microcontrollers with, like 2kB of flash, programming it on IR would be totally fine.
I think I’m onto something here.
> inb4 toslink

>search "ESP32" on youtube, hoping to find a cool project
>it's all brown people showing stock footage
it's over.

>>2799070
That's because the barrier-to-entry is really low, thanks to ESPhome and Arduino, the turd worlder sees an opportunity to make 5 dollars in ad revenue from 5 hours of work, that's weeks of rice. Searching for anything other than vague ideas on YouTube is a bad idea in the first place, unless you already know a specific channel to look at. Maybe look for specific projects with them instead of mass market introductory videos, or look for specific models like the ESP32C6.

I would like to make a portable music player and I would like an MCU that is compatible with the current esp32 ones, what do you recommend?

>>2799098
I picked an ESP32 just to complete the minimum price for free shipping. That's why I was vaguely searching for "ESP32" instead of more concrete ideas.
But hey, at least I found this thumbnail which made me kek.

>>2799104
>an MCU that is compatible with the current esp32 ones
You want an MCU that's compatible with ESP32 MP3 player modules? Or MP3 player projects/tutorials? Or what? MCU refers to the ESP32 itself, FYI.

If you get one of those SD-card MP3 modules (or the ICs found on them) you can use that with a very minimal MCU, be it an ATtiny or whatever. If you want to use bluetooth and wifi then I guess there's a point to using an ESP32, it can probably be programmed to stream audio to bluetooth headphones, plus it has other handy features like DMA and built-in SD card interfacing hardware and I2S output. It also probably has the power to decode MP3s into an audio bitstream live, but I'm not certain of that, or of its ability to decode lossless formats, or anything other than .wav. The ESP32 S3, C3, and C6 have bluetooth 5.0, which is better for some reason. The S3 and C6 have native USB, which you could use for more easily configuring or loading music. The C3 and C6 are RISC-V, which is a different architecture to the older series, which may make a difference for trying to port an existing project. You should write it yourself though, it makes debugging actually a reasonable suggestion.

Then, assuming you're not designing a minimalistic custom PCB (which is an option if space is a major constraint), you'll probably want to get the ESP32 on some sort of module. You can either go for the ESP32 WROOM-32 boards which have castellated vias for mounting to a PCB, or a larger but breadboard-friendly type of board that probably has a WROOM-32 atop it, plus LEDs and a programming connector and stuff.

Also FYI the ESP32 is kinda bad for quiescent current, i.e. it will have kinda bad battery life. From what I've seen, projects that want such a powerful wireless-capable chip (like Meshtastic) use other chips instead, like Nordic's NRF52 series. If you don't need the power and wireless capabilities of an ESP32, I'd advise not using one.

>>2799109
I'm a nigger, forgot to say "compatible w/ current esp32 audio libraries". I need to play MP3, AAC, ALAC, AIFF, APE, FLAC, MP, APE, WAV, OGG and OPUS

>>2784440
The ESP-01s is small, has wifi, uart and spi.
Have a few myself, love them for small projects that don't need much GPIO. Quite cheap. Only downside is you need a programmer to connect it to a pc. Or make your own from an arduino or rbpi

>>2798422
2 batteries is always going to have a shorter battery life then three for the same amount of power draw.

But to answer your question : to do 1 watt of work, the pico is going to draw 1/(2*1.2) = 415mA (2 cell configuration) vs 1/(3*1.2) = 278mA (3 cell configuration)

>>2799304
Idk man, read the documentation for the libs yourself, or find appnotes on using different MCUs for audio. If the audio libs need the ESP32’s audio PLL feature, not many of them actually have that, only the first ESP32 IIRC. The only way someone here could answer that better than you would be if they’d made their own ESP32 audio project, which is somewhat unlikely. If you’re patient one might show up, but don’t hold your breath. Unironically reddit is a better place for your question than a general of like 15 people.

anyone have experience using IEEE-488 aka GPIB with a microcontroller? we have a bunch of scientific equipment that i would like to be able to control over the network.

>>2799651
>anyone have experience using IEEE-488 aka GPIB with a microcontroller?
No, but what I've seen on Marco Reps' channel suggests it's quite doable to diy, and also that there's a lot of people doing similar things on various forums.

>>2799723
interdasting. any links to said various forums?

>>2799651
No but I have written a Commodore disk drive emulator (I just did, stop asking) and spent a lot of time reading up on IEEE-488 and learning how it's essentially bit-banged out of an 8bit PIA. You'd basically have to do the same with a microcontroller.

You might find these useful:

https://www.pagetable.com/?p=1018
http://www.primrosebank.net/compute<wbr>rs/pet/documents/PET_and_the_IEEE48<wbr>8_Bus_text.pdf

>>2799929
i was thinking i had to write a linux kernel plugin, but do you think i could get away with just GPIO? that first link seems to suggest that the max throughput of 488 is only 2KB/s

>>2800039
>just GPIO
*plus a couple chips like https://www.ti.com/lit/ds/symlink/s<wbr>n75160b.pdf and https://www.ti.com/lit/ds/symlink/s<wbr>n75162b.pdf

>>2799929
(unrelated Anon reading this)
Very interesting stuff, thank you Anon.
Had no clue about Fast Serial / C128.
Awesome compilation of information there.

>>2800039
>do you think i could get away with just GPIO
You absolutely can. The clock is basically up to you via. the DIO & NRFD lines.

>>2800398
excellent. time to steal the company credit card and order some PCBs.

>>2800040
actually do i even need these? they just seem to pass the bus lines through. what exactly do they do?

>>2800462
They do all kinds of things.
Are you familiar with transmission line theory? They have termination resistors built-in.
They also clean up bus signals with hysteresis.
The provide enough current and voltage for other things that might be on the bus.
A lot of bus transceivers have a “high impedance” mode that disconnects them from the bus altogether.
ESD protection,
etc, etc, ad nauseam.

>>2800476
hmm, i see.
ill try to get a pi talking to an instrument without the drivers, and if it goes well we can move on to fancier boards.

Anyone here used these together (ATTiny25 and I2C HD44780)? I haven't managed to get the I2C communication it working.
>Arduino libraries
Too big binary
>Libraries for this I found on Github etc.
Didn't have success, possibly skill issue.
>Writing my own
Did manage to get the tiny and an ESP32 slave to communicate but the initialization sequence for HD44780 is like a weird esoteric ritual dance.

Specifically switching from 8-bit to 4-bit mode is the issue, if I understood this right after the switch command data must be sent in 4-bit sequences.

need help with with implementing i2c communication between two stm32 microcontrollers, any tips?

master code https://pastebin.com/AEBcW44k
slave code https://pastebin.com/KcfbsuXZ

>>2800837
Just bitbang i2c.

>>2800842
Have fun dying of brain cancer.

>>2800845
Because i2c is so complex. Why use it if you control both MCUs anyway? UART is simpler, but you could bitbang something custom too.

>>2800852
of course i would've used uart, but the damn tutor wants i2c. it's honestly a pain in the ass, even when using HAL

>>2800843
>>2800852
Guess it's brain cancer day for me too then. Because of the 4-bit thing I can't even use the USI and just have to do everything manually.

I'm planning to build a platform similar to this autonomous "follow me" cooler using Arduino. I want my platform to follow me just like this cooler does, but I'm having trouble finding a GPS module similar to the one used in the video. Does anyone know a similar GPS module?

Video: youtube.com/watch?v=6I5rQfJSmaM&lis<wbr>t=PL39pssg07dpCBNHQbxaql-8NT9rz-k3R<wbr>B&index=2

I just managed to make a hello world program with no crappy Cube IDE for STM32 thanks to this guide https://vivonomicon.com/2018/04/02/<wbr>bare-metal-stm32-programming-part-1<wbr>-hello-arm/ as well as Part 2.<br>I'm so happy.

>>2801081
You have chosen to walk a difficult path, but may there be a glorious light at the end of your journey.

>>2801081
hey, ive gone that before, though i seem to have misplaced by pictures of it. good job anon! i believe i used that same tutorial. once you get C code working, you should use something like https://github.com/mpaland/printf to print over the UART line.

>>2774325
I need to keep track of the orientation of something. I have a mpu 6050 but im not sure how good these would be for this purpose. Whats the best type of sensor for this purpose. Whatever smartphones use seems to work really well.

>>2801467
Is it next to something motionless, or is it freely moving? If the former, use a magnetic encoder of some sort. Otherwise an IMU of some sort is your only option. Any modern 9-axis IMU should be fine for this, it’s the filtering code that combines the magnetic compass with the gyroscope that’s the tricky part.

>>2801467
Oh you could also do something like IR LED flight sim head tracking if it’s staying within a certain area.

>>2801478
>it’s the filtering code that combines the magnetic compass with the gyroscope that’s the tricky part.
I see. Found the BNO055 which looks to do all the algorithm stuff for you. But its kinda expensive to buy without certainty its what im looking for.
>>2801481
Ive thought about this as well but I dont want to turn this into a multiyear project.

>>2801497
>But its kinda expensive to buy without certainty its what im looking for
>dont want to turn this into a multiyear project
For either method, you'd almost certainly want to find an existing solution that you can learn from. What hardware is it going to be programmed for? Just an MCU, or can you offload it to a computer that would be taking the data either way? Computer implementations are probably more complicated to get the low-level comms going, but they're more likely to have existing solutions for flight sim and VR reasons respectively. For MCU implementations, you may have luck with ardupilot and similar UAV projects (or self balancing-robots) using an MPU for inertial navigation, while LED detection with openCV on an ESP32 is probably also something that's been done.

>>2801220
>though i seem to have misplaced my pictures of it
found one.