[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/diy/ - Do It Yourself

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


[Advertise on 4chan]


File: MC68701CL.jpg (38 KB, 572x297)
38 KB
38 KB JPG
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-electronics

>RISC-V microcontroller list:
https://codeberg.org/20-100/Awesome_RISC-V/raw/branch/master/RISC-V_MCU_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
>>
>>2775277
be a fag somewhere else
>>
>>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
>>
>>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-FFT
>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/3256805882522448.html
vs
https://www.aliexpress.us/item/2255801061083792.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.
>>
File: 1711407805807.jpg (124 KB, 482x673)
124 KB
124 KB JPG
>>2777053
perfboard soldering
>>
File: 1711407766234.jpg (72 KB, 532x409)
72 KB
72 KB JPG
perfboard soldering
>>
File: 1711408019913.jpg (125 KB, 833x529)
125 KB
125 KB JPG
veroboard soldering
>>
File: 1711407983950.jpg (188 KB, 982x596)
188 KB
188 KB JPG
veroboard
>>
>>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?
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?
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.
>>
File: not free running.png (86 KB, 978x648)
86 KB
86 KB PNG
>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.
>>
File: AASD CN2 PInout.png (989 KB, 918x1136)
989 KB
989 KB PNG
>>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?
>>
File: SMC01.png (2.68 MB, 1572x1568)
2.68 MB
2.68 MB PNG
>>2779588
>>
>>2777077
>>
>>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
>>
File: 1701703908084483.jpg (665 KB, 2048x1536)
665 KB
665 KB JPG
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?
>>
File deleted.
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.
>>
>>2782690
Is freertos bare metal?
>>
>>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
>>>/diy/rcg
>>
>>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?
>>
File: wiring5.jpg (32 KB, 363x323)
32 KB
32 KB JPG
do mcg still love Japan?
https://www.youtube.com/watch?v=i5MNLTc7YhY
>>
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/retrocomputing/comments/106g6oh/questions_about_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.
>>
File: 1706980120571466.jpg (1.24 MB, 2364x1325)
1.24 MB
1.24 MB JPG
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.
>>
File: 1712448357794262.jpg (20 KB, 318x292)
20 KB
20 KB JPG
>>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/dataspecs/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.
>>
>>2786953
post pics of soldering
>>
>>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
>>
File: drv8874.png (29 KB, 610x387)
29 KB
29 KB PNG
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
>>
File: L298-datasheet.jpg (217 KB, 1080x705)
217 KB
217 KB JPG
>>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
t. zoomie
>>
>>2790027
Wrong, again.
>>
>>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.
>>
>>2790033
Lol no
>>
>>2790075
It's as if you enjoy being wrong.
>>
File: 1712532520083664.jpg (979 KB, 1536x2048)
979 KB
979 KB JPG
>>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.
>>
File: 1704518411687613.jpg (41 KB, 536x440)
41 KB
41 KB JPG
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.
>>
File: 1643875371377.jpg (103 KB, 623x726)
103 KB
103 KB JPG
>>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
>>
>>2790974
VisionFive 2.
>>
>>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.
>>
USE ZEPHYR RTOS
>>
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.
>>
File: file.png (316 KB, 1010x556)
316 KB
316 KB PNG
>>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/Greaseweazle/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
>>
File: file.png (54 KB, 490x602)
54 KB
54 KB PNG
>>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.
>>
File: 4064-03.jpg (162 KB, 970x728)
162 KB
162 KB JPG
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?



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.