[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: kino.jpg (2.17 MB, 4032x1960)
2.17 MB
2.17 MB JPG
Previous thread:>>xxxxxxx

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
>>
actual previous thread: >>2774325
>>
File: blinkleds.webm (2.94 MB, 1280x720)
2.94 MB
2.94 MB WEBM
no interest anymore?
>>
>>2803735
I am interested but I am busy with a move, but I still lurk
>>
>>2803735
No. I quit embedded and took up gardening. I now think of snails as Arduino users. The day of the rake is coming for you.
>>
>>2803735
The autistic shithead brigade ruined this general long ago.
>>
>>2803735
I successfully managed to avoid putting a microcontroller in my last two projects. Used relay logic for one, and an LM3914 in the other. Started work back on a BLDC driver though, I’ll need to mess around with 32-bit MCUs for the first time to get that working, so I’ll post about that in a month or so.
At least we can keep the thread bumped with arduino hatred.
>>
>>2802510
I need to run 4 arduino input / output wires 50 yards. 5V going through them max, need no signal loss. Using CAT6 Ethernet cable atm. What are my other options?

> waterproof
> no signal loss without repeater bullshit
> can be rolled up, stepped on, cows might shit on it
>>
>>2804613
What kind of current draw? If no power is needing to be transferred (i.e. there’s a power source at both ends), I’d want to add differential pair transceivers on each end, with termination resistors to keep the line impedance low. Like RS485 or whatever. That would use up all 8 wires in your cat cable. But if it works as-is then I probably wouldn’t worry about it. Run it through conduit if you want something stronger, or use that double layer insulated outdoor rated cat cable.
>>
Have any of you successfully connected an ESP32 or nrf52840 that is emulating a keyboard to a PS4 console? I keep trying and it tells me it's not supported and then I change the vendor and product IDs and it gets me to pair it before it tells me that it's unsupported. Any advice on libraries or options?
>>
Any of you fucks have experience with using rust (inb4 troon) on an esp32?
>>
>>2804751
What does that even mean? You want to compile and edit and run on the esp?
If just run compiled, the existence of mrustc—turning your rust code into C—and using that would pretty much solve your problem.
Then, once you have the resultant C code, delete the original rust code and maintain it C as you should have in the first place.
>>
>>2804737
I bet it doesn't like your report descriptor.
And I am not going to help you with it because I haven't touched that shit in years.
>>
File: IMG_0984.jpg (1.98 MB, 1170x1551)
1.98 MB
1.98 MB JPG
>>2802510
What’s OPs image? I see the pi, the arm, the sd and the leds plus the nip characters. Some kind of serial interface/led light chaser?


Here’s mine latest. Paper speaker, lm386 and some 555s made baby’s first synth today. Worst speaker I ever heard and I cooked one timer trying to pull too much current when the amp didn’t work but it makes lights and sound and there’s only room for improvement.
>>
>>2804871
Hooking the fan up in place if that “speaker” would orobably sound better.
>>
>>2804751
Why would anyone want to use rust on embedded? I am not saying use C++, just use C
>>
>>2805061
Memory safety I guess, but all these examples of managing hardware (which are "singletons" to desktop brain damage programmers) with the retarded Rust ownership model makes me not want to take them seriously.
>>
>>2804905
I don’t see how? The pulses that drive the speaker wouldn’t be enough to get the fan going and spinning is not the same as oscillating. I do however have my eye on some audio exciters that should shake things up.
>>
>>2805338
No, but the fan doesn’t have to “go” it just has to vibrate and the blades act as the “cone”.

This was an actual product from a few years ago, except it was an actual spinning fan that could impart the audio through the fan blades.

>>2805086
> memory safety
Heh, I see singletons as more of a new name to “global variables” but the cargo cultests follow the “globals are evil” doctrine without understanding how computers work.
Embedded and microcontrollers bring you a lot closer to the computer. The C++ and Rust people are out of work theoreticians and neither one ever had any practical value except to be different and sell O’reilley nutshell books. And maybe for dummies books. That’s why they’re constantly adding and changing shit.

If you want memory safety, look up MISRA C rules and valgrind. Ultimately, they’re just bugs, and it’s up to you to fix them by whatever means necessary.
If you look through he gnu C standard library, like half of it is written in assembly to take advantage of SIMD anyway. Only works with long strings, the setup and checking sometimes takes like 100 clocks, so it’s worthless. Hopefully the compiler can figure out if it’s a “long haul” sized string or can fit in an m_128… oh it can’t? Well, so much for that.

I dropped rust when I updated the compiler and it kept crashing. The compiler itself is written in rust. It’s worthless, and it told me so by dumping core.
>>
Is it possible to make a somewhat useful computer with a P8X32A?
>>
>>2805663
>I dropped rust when I updated the compiler and it kept crashing.
I bet that's because they use LLVM, a C++ project, to do the real work at code generation, and some API or ABI incompatibility got them.
>>
I learned C intending to get into programming some stuff, but ended up using other dev environments instead. Is there much difference between regular C and embedded C, and can I use it on any old microcontroller? I'd love to give some electronics projects a try, since that kind of low level, simple programming looks like fun.
>>
>>2806396
theres not really any fundamental differences in syntax. however things like dynamic memory allocation, multithreading/processing, networking are just a few of the things that dont work out of the box on a mcu. instead those features are chip specifc and may use different function names and have other limitations
>>
>>2806449
To start with I'll only be doing basic shit like a light controller or a garden watering monitor. Is it possible to use assembly to program mcus as well?
>instead those features are chip specifc and may use different function names and have other limitations
I guess as long as the documentation is good I'll be fine.
>>
>>2804828
Anon, I will give you the finest PP touch that a straight man can send over text if you at least point me in a direction that isn't "sucks to suck, faggot."
>>
>>2806452
Assembly is usually preferred on smaller mcus.
You can almost always emit assembly code from your C code. Everything used to work that way until idiots became involved.
Even microsoft C++ could do this and you could assemble the output it with masm. Up until 2016 or so, but then they said “the asm might not complie any more” … but the microsoft boat is adrift at sea with no captain and infested with pakleds.

If you write it in assembly, and you gave trouble with something, sometimes it’s helpful to “cheat” and see how the compiler emits the code for it. Maybe you want to copy it verbatim, but more likely you can cut it down by two thirds… it’s a little chatty sometimes and does useless checking or saves registers you don’t care about.

CISC cpus were more designed to be programmed in assembly, back when they cared about that stuff. RISC CPUs, not so much… this culminated in the Itainium, the ultimate expression of RISC and the futility of the endeavour. Thank god it never made it to the embedded arena but the lesson should be observed from a distance and learned from.
>>
>>2806396
Read a microcontroller datasheet to see what you might be getting yourself into. I recommend an older AVR like the popular ATmega328P. It has both assembly and C code examples, though I prefer how the later AVRs handle their I/O ports.

The relevant assembly manual may also be useful, if just to see what instructions the part you've chosen has. Whether it can do hardware multiplication or division, floating point, etc. Whether it can bit-shift multiple bits at once, or just one at a time. Whether it has instructions for easily reading longs from adjacent registers, or if it can read-bitwiseop-write a register in a single clock cycle. Additionally, and this may be in a different document, how many clock cycles it takes for things that don't have instructions, like different multiply and divide routines from different optimisation levels. The kind of stuff that's important for optimising code.

I'd also check out Ben Heck's videos where he programs an ATtiny10, a chip with 6 pins, 1kB progmem, and 32B RAM, to run space invaders. Surprisingly entertaining.
>>
Hello /MCG/ is there a better, high IQ way to talk to individual pins on a shift register than just to specify every bit digit individually?

(I'm too embarrassed to ask chatgpt again)
[code]
#include <SPI.h>

/*Define the pins we are using on the Arduino Board and
cross reference them with the pins on the Shift register
so you can give them appropriate names*/
int latchpin = 3; // chip select
int datapin = 11;
int clockpin = 13;

byte shiftLED1 = 1;
byte shiftLED2 = 2;
byte shiftLED3 = 4;
byte shiftLED4 = 8;
byte shiftLED5 = 16;
byte shiftLED6 = 32;
byte shiftLED7 = 64;
byte shiftLED8 = 128;


void setup() {

SPI.begin(); //Start the SPI library
SPI.setBitOrder(MSBFIRST); //Set LSB as bit order, this means we will send the least significant bit first and it will be written to Q7 = Register Pin 7 with the most significant bit being written last to Q0 or Pin 15
/*Configure the Arduino pins we use as OUTPUT, so they can send
data to the Shift Register
*/
pinMode(latchpin, OUTPUT);
pinMode(datapin, OUTPUT);
pinMode(clockpin, OUTPUT);

delay(50);
}
void loop() {
digitalWrite(latchpin, LOW);

SPI.transfer(shiftLED3); // Send a test byte

digitalWrite(latchpin, HIGH);
delay(0); // 1 second delay to observe changes

digitalWrite(latchpin, LOW);

}
[/code]
>>
aah how would I even iterate a for loop this way?
im brain ded
>>
>>2806527
you need a "shadow register"
add a variable to keep the state of all your LEDs, turn bits off and on in that, then send it out to the shift register
>>
>>2806527
Instead of
>byte shiftLED1 = 1;
>byte shiftLED2 = 2;
>byte shiftLED3 = 4;
it's more common to see
>byte shiftLED1 = 1<<0;
>byte shiftLED2 = 1<<1;
>byte shiftLED3 = 1<<2;
Of course, you should call them LED0-LED7, not LED1-LED8, for more clarity. I'd also use the term "bitmask" (or "bm") instead of "shift" when labelling these variables.

But better than that is to use the bitmasks that come along with the register data in the header files that the compiler uses. I don't actually know where to get human-readable names for these bitmasks, I see them in tutorials and code that MPlab wizards create for people, and in examples in datasheets, but nowhere in whole. They make more sense with status registers, here's an example:
>/* Write logical one to WDCE and WDE */
>WDTCR |= (1<<WDCE) | (1<<WDE);
Where WDCE is bit 4 of the Watchdog Timer Control Register WDTCR, and WDCE stands for Watchdog Change Enable. The actual constant WDCE is just "4", it's intended to be used to bitshift for bitwise boolean setting or unsetting of bits. For I/O ports specifically, here's another example:
>/* Define pull-ups and set outputs high */
>PORTB = (1<<PB7)|(1<<PB6)|(1<<PB1)|(1<<PB0);
>/* Define directions for port pins */
>DDRB = (1<<DDB3)|(1<<DDB2)|(1<<DDB1)|(1<<DDB0);
Here, writing "PB7" is the same as writing "7", but it's more clear.

The arduino IDE uses something similar but more removed from the user and less flexible, it uses a selection of functions to calculate which bitmask of which port a given "i/o pin number" is, e.g. arduino pin 12 = port B, bitmask 0b00000001. It's fine for static use cases as it all gets precalculated at compile time, but if you're trying to iterate through several pins it becomes extra bloat. See:
https://forum.arduino.cc/t/get-portx-from-arduino-style-pin-number/469729/8
If you want to optimise code portability (e.g. in a Marlin compiler) then using this sort of function may well be desirable. I don't know how to use it properly.
>>
>>2806539
>>2806527
also i misread your entire question but i think it's not entirely out of place
>>
File: media_F9a1YYDXQAA4h5k.jpg (43 KB, 960x960)
43 KB
43 KB JPG
>>2806539
Ok anon. I didn't really get it. but thanks for your effort anyways.
I asked chatgpt where I learned about bitshifting. I feel retarded for having everything spoonfed but I guess I also learned something new:
https://pst.moe/paste/gyenln
>>
Getting ready to start a phone alert security project with esp32. Sensors are of the 433mhz sort. I’ll figure out the hardware stuff but I’m confused about the pushing of notifications. Looks like a lot of options. Was going to try and learn MQTT and use mosquito but I’m not sure if that’s the best route.
>>
>>2806539
> byte shiftLED2 = 1<<1;
Except you shouldn’t make a variable for a constant. I’ve worked with microcontrollers that are 128 bytes of memory and you don’t want to trust the compiler to optimize that out.
>>
>>2806482
That's really good to know, I'm kind of hoping to build up enough knowledge to eventually make my own 8-bit microcomputer clone, but first I need to get a grasp of the basics. Having watched the Ben Eater 6502 videos, assembly seems like an interesting way to program.

>>2806520
I've got a few 328Ps and a 2560 that I need to dust off and put to use, then.
>Ben Heck
I'll definitely give that a watch, thanks anons.
>>
>>2806785
Well I'm pretty sure that will get consistently optimised out, but I can feel some of that apprehension. Is #define the better way to go?
>>
>>2806662
Mqtt implies the need of having a server, if you want to keep it simple just set it up to send emails or telegram messages
>>
>>2806530
What is your expected result and what do you get instead?
The loop condition won't end as the "i" counter isn't ever increased, but instead the test byte (?) "shiftLED".
>>
>>2806530
>for (led i = 0; i <= 255; testLED++)
should probably be
>for (int i = 0; i < 256; i++)

Then increase testLED inside the loop, either directly after usage or at the end. If that's even what you want done?
>>
>>2806543
>asked chatgpt
Pick up a book or find a bootstrap example. No one sanitize the output of AI and it is frankly rude comining with
that crap and asking others to do it for you.
>>
>>2806543
>asked chatgpt
Don't forget to kill yourself, low IQ retard.
>>
>>2806530
>delay(0) // 1 second delay to observe changes
>>
>>2806894
> use #define
Most certainly. Always use the simplest tool that accomplishes the task.
Also, assembly typically uses macros as well, so it’s easier to adapt. I sometimes prototype fluffy things in C and then rip out the assembly code and optimize it.
A lot of microprocessors have special instructions that you can sometimes take advantage of.

Microsoft’s C++ template system used the C preprocessor to work, which was kind of funny when it was discovered since the C++ theoreticians and neo-purists hated the C preprocessor without realizing #include was just that.
>>
>>2806931
Thanks, I’m an aspiring boomer that’s never used telegram either but I’ve already got a new bot so that was pretty easy. What’s my exposure puttying WiFi credentials into the arduino IDE and sending a hello world message from the ESP32? Are the hackers going to come in through my back door?! Any steps I can take or concepts I should explore to protect said back door?
>>
>>2807040
>t. born with intrinsic knowledge of everything
>shitposts on a Tibetan homesteading forum
nice
>>
>>2807201
Just don’t hook up your dev env to the internet. Simple.
>>
>>2807207
Development environment? Is that the same as arduino IDE because the machine running that is connected to web. Is there a sandbox or something that should be involved? Also what’s the secret to flashing these fucks. I swear I’ve done it before but I’ve got 8266 and 32WROOM and between the two I can’t figure out why the ESP8266WiFilibrary won’t work or if the flash/boot button pulls pin 0 low or how long I’m supposed to do that. At least I keep getting different errors.
>t.ignorant, please spoonfeed.
>>
>>2807435
> dev env == arduino ide
So, it depends on the microcontroller. For the older architectures, you can get by with an old 386.
So what do you have on there?
Editors, compilers, debuggers, emulators, eeprom burning stuff, now writes flash instead, telix, serial ports, rs232 to uart box, parallel ports, your pickit2 or whatever. It’s sometimes useful to have a few dev microcontroller dev boards to handle things like i2c, spi, gpio, d/a and a/d converters, or maybe a raspberry pi or latte panda for usb stuff. Or, maybe you want a pentium if you’re doing Usb.
>>
>>2803735
its summer in the US, alot of people would rather be outside, than cooped up inside doing electronics.
>>
>>2807482
It’s already too hot out.
This is peak basement-dweller productivity time.
>>
>>2807444
Checked. although took too many neurons to figure out you’re probably suggesting I use an old dedicated machine with no internet connection. If so, good advice and I imagine anything else is beyond my scope. Currently I think my usb cable is charge only because I cut up the other ones to use for powering leds.
>>
File: GOPuOKfXYAA2FAV.jpg (63 KB, 800x463)
63 KB
63 KB JPG
>>2802510
How do I charge esp32-cam with a lipo battery?
>>
>>2807035
>it is frankly rude comining with that crap and asking others to do it for you.
Reading back on the post it does sound kinda rude, but wasn't intended to be. I didn't really understand the entirety if Anons post but he led me in the right direction with bitshifts and the code example chatgpt provided was genuinly helpful.
>>
File: ring-doorbell-4-1.jpg (98 KB, 1200x900)
98 KB
98 KB JPG
Hi /mcg/

Doing my first ever electronics project:
a doorbell camera.

Saw a video on the esp32-cam and it looked simple enough.
Have ordered bits from aliexpress.

Wish me luck.
>>
>>2808390
>run esp32-cam from lipo

From https://www.dfrobot.com/product-1879.html
>Power supply range: 5V

You could step up your 3.6v lipo to 5v using a step-up/boost circuit.
Or step down 7.2v (2 cells) to 5v using a linear regulator.

>charge lipo
If 1 cell then maybe tp4056 ?
If 2 cells then I don't know.
>>
>>2804737
Does it work against your pc ?

Here's a video showing an oscilloscope-level view into usb keyboard stuff
https://www.youtube.com/watch?v=wdgULBpRoXk

It does briefly talk about the usb from 27:58.
>>
>>2808583
>It does briefly talk about the usb setup from 27:58.
Fixed.
>>
>>2808583
I thought the point of that video was to show that PS/2 keyboards and mice were simple and worked well, and USB started off as a disgrace, and went downhill from there.

“let’s base the USB supply voltage on TTL logic since that will be around forever and will only become more popular”
>>
>>2808610
That must be some other video.

He spends the bulk of this video looking at traces and decoding by hand what is being sent between computer and keyboard.
>>
File: 4alfIoAL.png (1.3 MB, 1792x1024)
1.3 MB
1.3 MB PNG
Here's some AI kino that got posted in this SO thread:
https://electronics.stackexchange.com/questions/715517/artificial-intelligence-in-pcb-component-definitions
>>
File: 1694612826682375.webm (1.65 MB, 608x1080)
1.65 MB
1.65 MB WEBM
>>2802510
>have a need for an analog/digital io block to can bus module for attaching various signals to and making them available on the can
>find no products or even projects that do just that
>"fine... I'll do it myself"
>stm32, can bus transciever, 8 channel optoisolator for inputs
>find some basic example code off ST's website and strip it down further to build off of
>whole thing done in 3 hours

>want to expand the project a bit
>want to pull in data from a 1-wire bus
>one project exists for it
>doesnt compile
>bullshit OOP issues
>get fucked

FINE ILL DO IT MY FUCKING SELF AGAIN
why is everything hard and make me learn how to just solve it myself instead

3 year old code on github, load the .ino, put the header file in the right folder, click compile, dozens of undefined reference errors.
clearly the code worked at one point, and 3 years later it doesnt. why
>>
>>2809111
People like myself, and probably yourself, that are pro-grade, don’t vomit their failures on github, and don’t have time to write books about it either (back when those were a thing)

I’ve seen shit on github that’s so bad, I’d have sworn they were planted by our competitors to fuck us up. You can even find stuff that basically implements security holes and could damage d to a attached equipment, like all lines locking-up hi simultaneously due to bugs when they try and bit bash a 3ph motor signal.

Of course, this cesspool of github detritus is what a lot of the code-writing AI feeds from. Might as well have someone from india do it.
>>
>>2808583
Yep, it works perfectly on PC. But I know that the PS4 only supports a few Bluetooth keyboards. My goal is to figure out a way to spoof one of those keyboards.
>>
>>2809118
But they have working examples in videos and they are white American. I think it is a case where the code works on their machine or worked 3 years ago
It's only a few hundred lines of code anyway so I can just simplify it and de-oop it until it works perfectly as all things do. It just doesn't help that I'm low int on c++
>>
>>2809126
> low int on c++
I’m high int, I started decades ago on cfront.
After too many decades, I realized that oop and c++ is bullshit, and is made worse with every new c++ misfeature that out-of-work theoreticians put forth because they’re academic and not practitioners (who are too busy getting things done). There’s a few neat tricks and whatnot in c++ over C, but nothing very extraordinary.
Could be worse though… python comes to mind.
> de-oop
Good. You’re ahead of the game.
>>
>>2809119
> ps4 bluetooth keyboards
I find that all kinds of devices randomly support/or don’t work at all on random bluetooth keyboards.
Some can’t even see them to pair. But it’s random, across apple, PCs, laptops, PS3/4, etc, and all kinds of bluetooth keyboards both big names and chiwanese knock offs.

The worst thing is when you have to go dig out the original controller to use that stupid pad thing in one random place where sony paid-off the game devs just to include it somewhere in the game to make it artificially relevant.
>>
>>2809111
>.ino
there's your problem
assuming your stm32 actually has hardware 1-wire support, it should be pretty easy to just read/write the registers in the right order and shuffle data like any other comms hardware
if not, you can bit-bang better than a tarduino
>>
File: race ya.jpg (378 KB, 1024x709)
378 KB
378 KB JPG
Give it to me straight bros: what's the minimum voltage you can run a Arduino Nano at? ESP2866? Surely you can run it on a single button cell? All I get is "but you wouldn't do that, you would run it of AAs"
>>
>>2809189
read the datasheet
>>
>>2809184
It might have some hardware, but I'm using it for hardware can support
It just level shifts to 3.3v and goes in an pin.
I don't have to transmit so I can really strip it down
>>
>>2808557
You’ll need more patience than luck. Following a video is almost retard proof just don’t get mad when you start coming to terms with how retarded you are, like most things it will be an opportunity to be less retarded. I believe in you Anon.
>>
are there any cheap FPGA dev boards like the icesugar line, but that actually have a serdes?
>>
File: 1.jpg (352 KB, 1600x1064)
352 KB
352 KB JPG
>>2802510
Will I be able to play a 4gb .mp4 video file even though the pi 3 B has 1gb of ram? I need to convert a raspberry pi 3 B into a media player, with composite video/audio coming out of the 3.5mm jack. I have an understanding on how to configure the 3.5mm jack, but I also need a script to have the device launch a running media player app upon startup. Can I get some help on where to go to find a script like this, or where to find a how-to for a project like this? Big thanks in advance for any help you can provide. I'm hoping to have this running by Saturday for a video art installation.
>>
>>2809493
>Will I be able to play a 4gb .mp4 video file even though the pi 3 B has 1gb of ram?
Sounds fine.
Bits of the .mp4 will be read from usb drive as they are needed.

>need a script to have the device launch a running media player app upon startup.
(1) install raspberry os to sd card
(2) confirm install by booting your raspberry pi from the card
(3) poke around the desktop and see if you can get it to play your .mp4 file at all
(4) poke arounds settings to see if you can boot without login or password straight to desktop
(5) poke around settings to see if you can get it to launch a program as soon as you login, eg: a web browser
>>
File: 2.jpg (405 KB, 1600x1064)
405 KB
405 KB JPG
>>2809501
I found an install (Video Looper) but I can't get config.txt settled so the pi outputs a working NTSC 4:3 signal. I tried sdtv_mode=0 and sdtv_mode=16, and neither are working. The config.txt also said to uncomment the sdtv section for PAL. I commented the section and no clear picture. The pi boots up and my tv displays a messed up NTSC signal. Any ideas? I'm using a 3.5mm headphone jack RCA splitter and I have the composite cable plugged into the correct jack port.
>>
File: 3.jpg (449 KB, 1600x1064)
449 KB
449 KB JPG
>>2809536
I think I figured it out. My 3.5mm RCA adapter isn't the right style for a raspberry pi.
>>
File: OSMC.jpg (107 KB, 1202x734)
107 KB
107 KB JPG
>>2809493
>also need a script to have the device launch a running media player

you can install an OS that contains just a media player
best is LibreElec, second best is OSMC
(or OMXPlayer if you prefer a geeky command-line experience)
https://www.youtube.com/watch?v=ngGkVd-_LP8
>>
>>2809493
>Will I be able to play a 4gb .mp4 video file even though the pi 3 B has 1gb of ram?
The total size of the video doesn't matter shit, because it will be streamed from the storage media. What matters is how the video file is encoded (resolution, codec profile), and how the player manages memory.
>>
>>2809493
Every media format since caveman times has been readable incrementally, instead of having to load the entire thing in ram. The rest is up to how your media player handles things, it should be fine if it’s not potato coded.
>>
>>2809961
> potato coded
Reading everything into memory has been commonplace among the retards that infiltrated 90% of sw devs for the last 15 years at least.
>>
>>2810000
checked quads of truth
>>
>>2809493
>that pic
What is this thing? Tried various terms in google and I can't find anything like it.
>>
>>2810388
https://youtu.be/pbpFgvttBZw
>>
>>2810388
>he doesn't know about eurorack synths
>>
And idea what I'm missing here. I'm expecting TX to idle high, but it's not. (SAMD21E18A). Pullups? idk..


void UART_init(void)
{
uint32_t u32_baud = 36000;

// Configure pins
IO_pin_gpio_init(IO_PIN_PA24); // init TX
IO_pin_gpio_init(IO_PIN_PA25); // init RX
IO_pin_pmux_enable(IO_PIN_PA24, IO_PERIPHERAL_FUNCTION_C); // Enable peripheral function for pin TX
IO_pin_pmux_enable(IO_PIN_PA25, IO_PERIPHERAL_FUNCTION_C); // Enable peripheral function for pin RX

// Enable the peripheral bus for SERCOM3
PM_REGS->PM_APBCMASK |= PM_APBCMASK_SERCOM3(1);

// Use GCLK 0 to clock SERCOM 3
GCLK_REGS->GCLK_CLKCTRL = GCLK_CLKCTRL_GEN(GCLK_CLKCTRL_GEN_GCLK0_Val) |
GCLK_CLKCTRL_ID(GCLK_CLKCTRL_ID_SERCOM3_CORE_Val) |
GCLK_CLKCTRL_CLKEN(1);


SERCOM3_REGS->USART_INT.SERCOM_CTRLA = SERCOM_USART_INT_CTRLA_MODE(SERCOM_USART_INT_CTRLA_MODE_USART_INT_CLK_Val) | // Use internal clock
SERCOM_USART_INT_CTRLA_CMODE(SERCOM_USART_INT_CTRLA_CMODE_ASYNC_Val) | // Async mode
SERCOM_USART_INT_CTRLA_DORD(SERCOM_USART_INT_CTRLA_DORD_LSB_Val) | // Send LSB
SERCOM_USART_INT_CTRLA_RXPO(SERCOM_USART_INT_CTRLA_RXPO_PAD3_Val) | // Pad 3 for RX
SERCOM_USART_INT_CTRLA_TXPO(SERCOM_USART_INT_CTRLA_TXPO_PAD2_Val); // Pad 2 for TX

SERCOM3_REGS->USART_INT.SERCOM_CTRLB = SERCOM_USART_INT_CTRLB_SBMODE(SERCOM_USART_INT_CTRLB_SBMODE_1_BIT_Val) | // Single stop bit
SERCOM_USART_INT_CTRLB_RXEN(1) | // Enable RX
SERCOM_USART_INT_CTRLB_TXEN(1) | // Enable TX
SERCOM_USART_INT_CTRLB_CHSIZE(SERCOM_USART_INT_CTRLB_CHSIZE_8_BIT_Val); // 8 bit char size

SERCOM3_REGS->USART_INT.SERCOM_INTENSET = SERCOM_USART_INT_INTENCLR_TXC(1) |
SERCOM_USART_INT_INTENCLR_DRE(1);

SERCOM3_REGS->USART_INT.SERCOM_BAUD = u32_baud;

SERCOM3_REGS->USART_INT.SERCOM_CTRLA |= SERCOM_USART_INT_CTRLA_ENABLE(1);
}
>>
>>2810757
> uint32_t u32_baud = 36000;
> SERCOM3_REGS->USART_INT.SERCOM_BAUD = u32_baud;
Why is this a variable?
>>
>>2810898
It makes it easier to track in gdb, you pedantic twat
>>
File: its_cheaper.gif (2.79 MB, 520x250)
2.79 MB
2.79 MB GIF
What is the cheapest SBC out there that can hold "full" linux (kernel + some networking)?

Raspberry Pi Zero 2 W is $15, but can we find something for below $5? Specs can be worse.
>>
>>2810945
> linux
The real goal should be running something like bsd 2.11.
>>
>>2811006
To be honest, linux is not a hard requirement, as long as it has networking stack and can communicate with ethernet camera
>>
>>2810757
do you have a device connected to it or are the rx/tx lines floating? im pretty sure the "idle high" is actually done by the receiving end not the transmitting end.
>>
>>2811125
I have them being passed through my debugger. TX lines are typically pulled up by the transmitter. Receiving devices expect their RX line to be pulled up by the transmitter. Could also be the case that there's some peripheral muxing problem. Not sure. Will take another crack at it tomorrow. Let me know if anything comes to mind
>>
>>2810945
>What is the cheapest SBC out there that can hold "full" linux (kernel + some networking)?
>Specs can be worse
You phrased that a bit retarded. What's your tasks/requirements? What are you trying to accomplish?
Is it for personal education? => Better buy popular board, you'll get more options later.
Is it one board only project? Can you (re)use old board? => Buy a used router (check OpenWRT support though).
Why do need GNU/Linux at all? You can use networking on more simple OSes. => STM32, ESP32 etc support networking almost natively
>>
Programmer here, not new to microcontrollers but don't have a lot of domain knowledge.

>friend has idea for product
>pick up Xaio ESP32-C6 to prototype it
>oldered on a battery
>blink program killed it in a few hours
>want to start experimenting with the deep sleep mode to try and squeeze more life out of it
>need visibility into the battery state

I know I can basically read the battery voltage as a close approximation of battery life, but all my searches have returned no results on how to do this or if there's a nice battery info package.

I know some of these pins are analog, so is it as simple as just reading one of the analog pins with nothing connected to it to get the voltage and doing some math, or is there some electrical concept (voltage drop? idk) that makes that flawed? What is the proper google search terminology to figure this out?
>>
whats the easiest, least bullshit way to add a ntc thermister to a stm32?
any simple built in functions or some simple code I can use? I dont want to use some bloated 3 file 1200 line abortion to read the fucking outside temp, especially when it gets condensed down to the same damn fucking shit in machine code no matter how autistic you write it
>>
>>2811382
If you don't want to use shitty third party code written by idiots (like most "driver" code in embedded seems to be), you need to do it yourself. First get the shitty third party code to work to make sure the hardware works. Then either write your own code by reading the datasheets, or minimize the third party code by removing all bullshit.
>>
>>2811351
Okay I figured out how to do this I'm just reading A0 and doing some math, but I am unable to upload sketches while connected to both battery power and USB power. If I disconnect the battery, it works, if I unplug it then reconnect my battery, the sketch works.

Anybody know why this might be?
>>
>>2811405
I think i figured it out already
>buy TPM36
>analogRead(pin)
>>
>>2811415
>voltage linear to temperature
I guess that works, if your ADC is good enough.
>Ardushitto API
Die.
>>
>>2811418
12 bit adc, it's temperature, it does not matter.
>ardushitto
Nigger it's a stm32
All I am doing is getting the pin value to however many decimal places, and sending that value over can bus.
>>
>>2811421
analogRead is Arduino convention. I thought maybe they ported it to stm32. Most C devs would probably prefer this_convention.
>>
>>2811425
I'm sure there's some other method like HAL_Get_Pin or something like that but I just don't care, I already do digitalRead for other functions and it just werks
>>
>>2811421
>>ardushitto
>Nigger it's a stm32
"Wiring", "Processing" and other arduino-like APIs are not confined to the AVR chips
>>
>>2811406
posting a schematic of how youve wired it up might help for a start
>>
>>2811351

Battery capacity voltage/capacity curves are very non-linear and differ by chemistry, size, etc. On top of that, you can discharge a battery less (i.e., set your "0%" to a higher voltage) to get more lifetime charge/discharge cycles out of it. In most consumer devices 0% is definitely not 0% on the cell.

The easiest thing for you to do software wise is add a discrete fuel gauge IC. It will do the compensation, filtering, measurement, etc. that you need. Do a search for "fuel gauge," pick your flavor, TI, analog devices, etc. Follow integration manuals for those components because measuring voltage affects the voltage, which affects the curve, which affects the measurement, etc. If your MCU is running and you really care about battery life, that means there is a load on the cell that will affect the voltage you're trying to measure. A discrete IC gets around this.

You may also want to look into cell characterization, that's the process by which you work out those curves for your particular cell/load. If you are doing a production part you'll want to do some testing to figure out how to squeeze the battery life you want out of the power budget you have.
>>
>>2811351
>>2811611
(2/2)

As for software, different peripherals of your MCU will have different current draws; if the datasheet is good they will tell you. But in general, you want the MCU to be in the deepest sleep it can be while preserving the state that you need for your application (many can power down SRAM but only partially, for example) Your RTOS also probably has configuration options that will sleep the processor to various degrees when entering the idle task, for example; the tradeoff is that there's some latency to wake back up.

Having the CPU running, or a lot of RAM, is expensive power wise. So it's better if you can to do e.g. DMA, or batch sensor reads so that a SPI line can be kept "on" for only a short time, instead of waking it up a bunch of times every time a tiny amount of data comes through. For that ESP, the Wifi and BLE radio are very very power hungry peripherals that you should keep alive as infrequently as you can manage. Techniques like that. And, choose your MCU well. Keep your memory footprint as small as it can be. Not sure about the ESP32 family but MCUs come in various flavors, one of which is usually a "low power" version which is designed with good sleep current draw and fewer power-hungry peripherals.
>>
>>2811406
The pixies line up and march from the negative of the battery, through your MCU, to the positive of the battery. Your MCU measures how energetic they are on the positive side by having them flow from ground into a capacitor inside the MCU and then timing how long it takes for the voltage to equalize.

So if you connect a USB, your MCU starts drawing power from that, and the pixies don't really know where to go. Why would they go towards the cell when they can just go towards the higher-voltage USB port instead?

That's why it works only one way.
>>
I'm logging data to a csv files on an sd card (esp32c3 sdspi), do I have to worry about synching the fat filesystem or at least blocking the main loop if the 5V starts to sag?
>>
>>2811751
esp32s are a 3.3V device so it hardly matters. why would your 5V line "sag"?
>>
>>2811806
Because I'm unplugging it to turn it off.
>>
>>2811807
Don't do that
>>
>>2811807
well thats fine when you are not dealing with external memories or internal flash writes. but since you are, you should explicitly finish all transfers and unmount the memory before turning it off. most actual devices that datalog have a battery backup if the main power source is lost, and it will kick in and allow the device to turn itself off properly
>>
>>2812001
I was hoping that a smallish capacitor (500uF) would last long enough to do the File::sync_all(). Another way it can go wrong is if somebody ejects the SD card without powering it down.
>>
what microcontroller (programming) and frameworks/tools/standards should i learn if I want to get into automotive embedded programming?
>>
>>2812541
It depends on what you mean by that.
MISRA, obviously, for that high level C fluff.
The tesla still uses the ‘ol MC68HC11 in places.
>>
File: file.png (1.42 MB, 1280x720)
1.42 MB
1.42 MB PNG
i have stm32 blue pill and stlink v2 and i need to program a bios chip and i've tried flashing it with this program to use it for that
https://github.com/dword1511/stm32-vserprog
but i can't get through with it because my PC doesnt detect /dev/ttyUSBxxx nor /dev/ttyACM etc.
i've tried on Xubuntu liveusb and still no luck, my regular install is nixos and my user is in flashrom group
the jumper is on 1 on BOOT0 and 0 at BOOT1
i am an absolute beginner
>>
>>2812751
>beginner
Then you may be interested in knowing that controlling serial lines directly requires some special permissions, at least on Ubuntu. You don't need root, it's just standard Linux shit about adding random lines of text to random config files. That's the way i remeber it at least. Try it
https://askubuntu.com/questions/58119/changing-permissions-on-serial-port#58122
Idk if this is your exact issue
>>2812719
Misra, right
Fanks
>>
File: IMG_1368.jpg (879 KB, 4032x3024)
879 KB
879 KB JPG
having trouble with RPI interrupts:
i was on here a while ago asking if a RPI could handle GPIB. i bought a board, installed the drivers, and was able to successfully transmit a message to my oscilloscope. reading from the scope, however, is not working. i send "*IDN?", which asks for the name of the device, and i get back "T" (the first letter of "Tektronix"), but nothing else, and the Pi times-out waiting for EOL. the scope shows the DAV (data available, active low) line going down several times, but the interrupt routine in the kernel module (which gets the interrupt with request_threaded_irq()) is only being called once. im not sure how to proceed. any ideas?
>>2802510
hey, its my image! thanks for saving it! btw, the LCD says "lolicon".
>>2804871
its an STM32L462 (or something like that). i bought one and tried to get it to do something just to see if i could (and also to learn how MCUs work under the hood). the reference manual was like 1600 pages long and it took many nights just to get an LCD to blink. the Pi (same one in pic rel!) uses SPI to program it and it uses UART to get output. i got printf() to output over the UART controller, quite proud of that one. the LCD is controlled with some hardcoded GPIO stuff. i never got the SD card to work, not for lack of trying.
>>
>>2812771
i'm new to electronics, not linux
i can see the stlink device in lsusb but i dont have any interface in /dev/
not sure if that's a permission problem because i tried that on root
think i've had that same issue with my arduino
i dont know, i dont use ubuntu i fucking loathe how not streamline it is, they just change shit for the fuck of it
>>
>>2812772
>im not sure how to proceed. any ideas?
Get a USB logic analyser (or a second scope) to probe the lines and see if it is sending more letter than just the T, or if it’s waiting for flow control pins or a clock edge or whatever. Compare what you see to a handy timing diagram that I hope someone made already.

I did the same logic analyser snooping to figure out that my scope RS232 was actually a master that was to be sent to a plotter, and was carrying HPGL data. For that I used a cheap FX2-based unit.

>>2812776
Maybe /g/fglt will have some archaic insight for you?
>>
>>2812841
>Maybe /g/fglt will have some archaic insight for you?
they wont
i'm asking here because i wasnt sure if the jumper is set correctly or the device is fucked for some reason or maybe someone's used that program before
/g/ is just /v/ with gpus, we don't even discuss linux anymore
>>
>>2812841
>Get a USB logic analyser
dont have that
>(or a second scope)
do have that
>see if it is sending more letter than just the T
from what i can tell, it's sending the T, then it tries to send the E but the Pi never acknowledges that it receives it. this is backed up by 1) the debug menu on the scope shows that it tries to send both T and E, and then stops; and 2) the scope otherwise works fine with a USB GPIB adapter.
this discussion is kinda pointless for now because i reinstalled the OS on the Pi and now nothing works :c
>>
File: file.png (142 KB, 1368x751)
142 KB
142 KB PNG
>>2812851
the gpio_request_one() is failing on the first call. it was at least partially working before reinstalling the OS, but its fucked now. its also concerning that the function is apparently deprecated. i dont think any other processes are using any GPIO pins. not sure what to do.
>>
>>2812751
no. what you have is chink shit clones of "bluepill and stlink".
>>
>>2812876
ok i also have a chinkshit clone of arduino and it works fine, why wouldnt this
>>
>>2812883
because its much easier to clone. expecting any chink shit to work properly its just retarded. get some legit devices, verify your shit works, then roll the dice with chang
>>
>>2812861
What’s errno?
>>
>>2812911
iunno, errno isnt working in the kernel module for some reason.
>>
>>2812876
iirc stlink is an open source design so anyone can make and sell them
pretty good idea for making your products more accessible, especially considering the low price of the stlink
atmel can eat my ass im never buying an atmel ice or dragon

>>2812914
well i’unno either mate
>>
File: you.png (390 KB, 1080x1080)
390 KB
390 KB PNG
I thought i would use the day productively today and progress with the ARM Cortex course
I hit the point where I need a simulator now.
i've spend the ENTIRE day trying to make the simulator work but it tries to build something and then fails.
i have no idea what to do.
i fucking H A T E packages that you have to build yourself. Today is a wasted day thanks to those delays.
I'm going to jerk off to some porn, and then i'm going to the gym. fuck this shit.
>>
>>2813014
apt install qemu-system-arm

Getting it to work requires some fiddling if you're new to this.
I rarely need an emulator. I run everything local (on x86) or on a dev board. the only time when an emulator makes sense to me is when writing asm.
>>
I'm looking to make a battery powered device that can be controlled with an RF remote controller inside an apartment. The device will be idle for 99% of the time and during periods of activity I don't expect it to consume more than some tens of mA, and I want the battery to last as long as possible, preferably months to a year.
So, what I need is a digital radio protocol that can remain at a very low power consumption idle while still being able to wake up on radio activity, my understanding is that WiFi, BLE etc. will not work because they need to remain connected in a high power state to hear anything at all, does what I'm looking for even exist in a neat module or will I have to resort to a separate RX detector and all that?
>>
File: IMG_1371.jpg (475 KB, 1179x1636)
475 KB
475 KB JPG
>>2813029
>I don't expect it to consume more than some tens of mA.
thats a lot, low-power MCUs idle current is typically in the nanoamps. the IR receiver in pic rel has a typical supply current of 350uA. they probably make low-power IR receivers too.
>>
>>2813092
oh i can read lol. well you got your answer.
>>
>>2813093
fuck, cant type either, apparently.
>>
>>2813029
https://forum.allaboutcircuits.com/threads/low-power-ir-detection-circuit.115744/page-2#post-911606
guy on this forum reduced the IR detector current by a factor of 10 down to 35uA by cycling it at 7%.
>>
>>2813092
‘FT’ is the acronym for ‘Five volt Tolerant’ now?
That’s a disgraceful example of zoomerese.
Data sheets an app notes are going down hill.
> STM
As expected, about as much street cred as batteroo.
>>
>>2813092
Thanks, I was looking at RF remote controls so it's not so sensitive about directivity but those do seem like really good numbers
>>
>>2813029
Receiving only? Some sort of 433 MHz bullshit like zigbee or whatever would probably be my go-to, so long as the protocol does t require duplex. Ideally built into an MCU like an NRF something. LoRa is great for low power transmission but that’s not a requirement unless you want to really minimise the remote’s power consumption too. Even then it’s probably overkill since normal RF remotes last years on a 2032, and the NRF-based LoRa receivers are really expensive.

Also check out cnlohr’s latest video.
>>
>>2812541
QNX is somewhat popular, but its for chips with Raspberry Pi power, not microcontrollers.
>>
>>2810945
There's the Milk-V, a RISC-V board with an Arduino core on the side
https://www.youtube.com/watch?v=SeExddxWdNs
>>
>>2809493
if you install lightdm you can login upon startup without having to type the password
on xfce you can graphically select software to be launched upon login/ bootup
>>
File: 1618732765405.png (196 KB, 960x960)
196 KB
196 KB PNG
>>2813014
>I'm going to jerk off to some porn
>>
>>2813783
porns great, youre missing out bro.
>>
File: atech.webm (2.8 MB, 640x360)
2.8 MB
2.8 MB WEBM
>>2813783
>>
File: gpib3.png (508 KB, 1426x469)
508 KB
508 KB PNG
>>2812861
update: finally got it working after spending the entire working day yesterday (and most of monday) crawling around in the kernel module source. i had to replace the deprecated function with the new interface, but it was a fucking headache and there was very little documentation in the matter. i might push the changes to the kernel module after i clean it up a bit. thanks to everyone that believed in me <3
>>
>>2814336
>(and most of monday)
friday*
>>
>>2812911
>>2812914
i figured this out too: inside kernel modules, there's no global errno variable (errno lives in userspace). instead, errors are encapsulated in return values. if a function returns a pointer (gpio_request_one probably returns an int that i was too retarded to check, but the new gpiod_get returns a pointer), then you check the pointer with IS_ERR(ptr), and then get the error code (long) with PTR_ERR(ptr). strerror() doesnt exist in kernel headers either so i had to copy the error code to another program in userspace to check it.
>>
File: 1713872459913142.png (2.66 MB, 929x1239)
2.66 MB
2.66 MB PNG
Any way to tell if this Arduino Pro Mini clone is the 3.3V 8Mhz version or the 5V 16MHz one?
>>
>>2802510
Is there good reading material on how to design pattern a state machine for MCU code?
I am trying to get into more than blinky LEDs and such breadboard level toy projects. My code is turning spaghetti with the if statements and the mess of logic strewn about. Literally unreadable. Unmaintainable.
>>
Does this field makes any money or you are like 3DPG?
>>
>>2815201
>makes any money

not about money
3dpg makes the ass dildos
we make them wiggle
who even thinks about money when your holes are getting tickled
>>
>>2815209
Big oof!
>>
>>2815143
yes
>>
>16 MHz MCUs
Why does anyone bother?
>>
>>2815186
You might want to look at Algorithmic State Machine (ASM).
The first link from Google is a not bad overview:
https://uotechnology.edu.iq/ce/Lectures/Dr-Ikbal-Electronics-2nd/ASM1.pdf (There is a ASM2 too.)
If your shit is small Karnaugh Maps are old but good.
>>
>>2815186
Think about it hard and come up with something good.
>>
>>2815186
Use a table driven state machine. Two columns, current state, next state. One statement.
Or
Use the switch/case statements instead of ifs.
>>
File: brodie.jpg (12 KB, 183x275)
12 KB
12 KB JPG
>>2815186
Rewrite it until there's no more spaghetti.
>>
>>2815242
Well?
>>
>>2815143
the voltage regulator should say what voltage it outputs on its label, LG50 probably means 5.0V version of the MIC5219 regulator
it should also say 8.000 or 16.000 on the crystal oscillator itself
>>
>>2815394
He trolled ya, man! You've been trolled! You're a victim of a troll!
>>
>>2815476
What? I'm getting trolled on 4chan? What is the world coming to?
>>
Why are Arduino clones so expensive these days?
You could get 10 for $2.5 a couple of years ago, but for the at least the past year you can't find a single one under $5.
>>
>>2815540
World War 3
>>
>>2815438
In ENGLISH Carter!
>>
*takes a pin-up poster, folds it in two and then pierces with a pencil*
And that's how we will travel through time!
>>
>>2815540
>can't find a single one under $5.
where are you looking? i cant find an arduino above 1 dollar on aliexpress
>>
>>2815582
I'm not retarded, Anon.
Pro micros/Unos/Leonardo all costs above $5 on AE and the few listings below that are all shipping rate scams (pay $2 for the controller and pay $6.5 + $3.5 per additional controller for shipping).
>>
>>2815581
Indeed.
>>
>>2815602
(it's a /tv/ meme ya dip)
>>
>>2815598
32U4-based boards have never been cheap in the first place, plus I don’t think they’ve been cloned like the 328P has. Compare the board price to the individual price of the chips on LCSC. The 16U2 (8U2) are cheaper as far as native-USB MCUs go, you probably don’t need 32k of flash. Though the CH32V203 is probably cheaper again, has much better specs, and actually has dev-boards available.

>>2815609
for you
>>
File: 1668043280326943.jpg (20 KB, 376x360)
20 KB
20 KB JPG
can i find a charger that's capable of driving pinecil for ~$15 or should i maybe look into some other iron (recommendations?)
>>
>>2816590
60W+ for $15? I don’t think so. Maybe for $25 on alibay, but I wouldn’t trust anything cheaper than what Ugreen and those chinky brand names sell them for. Pine64 themselves sell one for a decent price IIRC.

If it has a barrel jack on the back too, see if you can get a 19-20V laptop brick at a thrift store. I think they might be able to handle up to 24V, but don’t quote me on that.
>>
>>2816590
the pinepower is 25 bucks on their global store and it works really well, its what ive been using for it, you can probably find slightly cheaper 65w chargers but i doubt it will go below $20
>>
>>2816797
$25 after tax is more like $40 and that's pretty expensive for me
>>2816659
>If it has a barrel jack on the back too, see if you can get a 19-20V laptop brick at a thrift store. I think they might be able to handle up to 24V, but don’t quote me on that.
yeah i've thought of that but i'd have to reterminate one to a smaller barrel and i'm not sure if that's safe to do for someone who has little experience with electronics
would it even work? to just cut off the connector and put on something different?
>>
>>2816806
>i'd have to reterminate one to a smaller barrel
Some laptops use 5.5x2.1mm jacks, it's not that common but it's not that uncommon either. The universal replacement laptop bricks almost always come with it, if you see one of them at a thrift store you might be able to ask the shop that sells them to see if they have the spare ends.
>i'm not sure if that's safe to do for someone who has little experience with electronics
It's not really unsafe to replace the plug, the devices have internal circuitry that shuts off the output in event of a short circuit.
>would it even work?
>to just cut off the connector and put on something different?
I see no reason it wouldn't work, assuming you make the middle positive. You might even be able to buy a plug adapter if it's a common one.
>>
>>2816844
if i could just get adapter from my thinkpad charger i'd be elated but i think i've tried searching for one and couldnt find it
i'll look into the chargers, shouldnt be too hard
>>
>>2816845
buy a replacement thinkpad charge port, and solder an adapter cable to that
>>
File: tempCVControl.jpg (230 KB, 1384x1599)
230 KB
230 KB JPG
>>2802510
I want to make a USB version of Colecovision controller. See pic related: it's a 3x4 numpad with joystick and 2 buttons. This would be for emulation; I'll print an enclosure and probably use SNES controller layout with the numpad in center.
> USB interface to retroarch machine running on Win10 machine
> Use arduino nano for size
Is following tutorial a good way to think about interface? It's basically having the arduino unit pass back keyboard commands... which doesn't seem right, would think there's a "gamepad" input of some sort that could be used instead.
https://www.arduino.cc/education/diy-game-controllers
>>
File: tempArduinoController.png (60 KB, 699x524)
60 KB
60 KB PNG
>>2816939
Code. Just doesn't seem like right way to do it.
>>
>>2816939
Sorta, yeah. You can ignore the serial comms, the actual sending of the key is done via "Keyboard.write(87);", though I don't think it's actually sending the ASCII value, rather the keyboard module is probably converting that to a scancode or some other format. I wouldn't know though.

You can't use an arduino nano though, it says in the tutorial you need to use a samd or 32u4 based board, because they're the only arduinos with native USB capability (well, the lillypad too). In practice there are lots of other non-arduino boards you can use, like a pi pico, ESP2S3 or C6, bluepill or blackpill, probably other's I'm forgetting. You can also bit-bang native USB with V-USB, but I advise against it. /g/ do a bit of diy keyboard stuff on their mechanical keyboard general, ask them for memey low-latency and n-key rollover methods.
>>
>>2817048
Thanks. Saw the bit about 32u4 and ordering some Arduino micro knockoffs that should work along w keypad.
I’ll check over at G on keyboard stuff. Never would have occurred to me to check there.
>>
>>2816939
>which doesn't seem right, would think there's a "gamepad" input
arduino has essentially crippled multiple generations of embedded enginners
usb has an idea of device classes, that is your uc can identify itself as a number of different things to the computer and then talk to the computer in a sensible way
what arduino does ( i don't care enough to check if this is correct ) is use a serial to usb bridge ic where the bridge chip (e.g. ftdi/cp2102) identifies its device class to the computer as a serial port and so the only communications you can do with ardino is emulate a serial port.
if you has a proper usb SIE you could tell it to identify your device using a game controller device class (most HID classes do not need drivers thank fuck because windows sucks ass at usb drivers)
for example if you had a microcontroller like a pic18f45k50 with a USB serial engine as a peripheral, you could have it send an HID game controller in the initial descriptor and the computer would treat it as a game pad controller. sending keyboard commands over serial bridge is just lame dogshit.
read usb 2.0 specification if you are at all interested, you can quite easily write a very simple usb stack on a microcontroller in a couple hundred lines of C.
>>
>>2816849
do you reckon i could just buy a USB-C to thinkpad adapter and just use the usb-c port? the thinkpad barrel is very uncommon and it would be a huge hassle
>>
>>2817110
>i don't care enough to check if this is correct
It’s correct for normal arduinos, but not for the leonardo and pro-micro. I can’t fault you for assuming arduino keyboard projects were just bit-banging shit over serial and relying on computer-side glue code to make it work, considering the backwards neanderthal programming conventions that the arduino environment fosters. Bootloaders (that aren’t for end-user use) and HALs were a mistake.
>>
File: fool on the hill.jpg (59 KB, 450x900)
59 KB
59 KB JPG
i have an esp cam i want to use at a hotel but i don't see how i can get past the wifi authentication that makes takes you through a web browser.
>>
File: smashed monk.jpg (49 KB, 474x355)
49 KB
49 KB JPG
>>2817149
nvm. should have thought about it for more than 8 seconds, would have realized computer can put out a mobile hotspot for esp32cam. too bad i dont have any PIR sensors with me. do have a laser emitter/collector that could be a trigger but i think the HCSR04 will be more discrete.
>>
>>2817112
is it something that takes the thinkpad charger as an input and has a usb c plug on the output? if so, maybe? i don't know if the pinecil would like a flat 19/20V on its usb c port without first negotiating for it
>>
File: keypad.png (285 KB, 423x529)
285 KB
285 KB PNG
>>2817110
>crippled multiple generations of embedded enginners
I think it's more like "enabled a generation of non-programmers / EEs to futz around on projects with crummy code
> your uc can identify itself as a number of different things to the computer
That's it. If I've read correctly the micro / leonardo ID's itself as such to the computer. Haven't looked yet to see if you can change that to something more suitable. In meantime, appears there are gamepad libaries that make the correct USB calls.
>>2817125
>bit-banging shit over serial and relying on computer-side glue code to make it work
lol I've actually done that for a project. What a complete pia.
> t. MechE that futzes with projects and crappy code to automate things
>>
Im using a black pill instead of a bluepill for a project. Is there some type of equivalent to the usbcomposite library the bluepill has for the blackpill. I cant find a single example of stmduino custom hid descriptors for anything but the bluepill. In the core theres a usb bare minimum example but its blank.
>>
File: file.png (657 KB, 848x776)
657 KB
657 KB PNG
>>2817206
actually i couldnt find usb-c either but i think it'd be technically possible if i could get an adapter like that
i think i'll just get a charger that has the same plug, this one is $10 shipped and does 90W, same connector
>>
>>2802510
In the early stages of designing a smart humidor for my cigars. Does anyone know of any decent CO2 sensors, sub-$100, that work in humid environments? I want to be able to detect any potential mould growth. My idea is to detect CO2 and particulates in the air, then record and track their amounts; if both go up, this is indicative of mould growth. So I can quickly intervene
>>
>>2817605
Looked into this more myself, and the SGP40 seems like a good option. It detects VOCs too, which I need
>>
>>2813014
Just learn what the error messages tells you. If you are the most lucky retard ever you search your platform + the error message to hit a home run solution at once.
Often it's some failed dependency or a retard filter in the code sample you just copypasted. They actually publish faulty examples to force you to learn.
>>
>>2817645
>SGP40
That doesn't actually measure CO2. To some extent you can assume CO2 based off VOCs, but in your case I'd probably want to use an actual infrared CO2 sensor. They're like $50 where I see them, see Andreas Speiss's video on the topic.
>>
>>2817963
Just realised I meant SGP30 anyway. The specs for that seem to say it does both VOCs and CO2, with the 40 dropping CO2, but I'll keep looking anyway. There's probably something better
>>
>>2817971
>>2817963
Nevermind, I see what you mean. The SCD-30 looks interesting and comes with temperature and humidity sensors. If I pair that with an SGPC3 for VOCs, I think it should get what I want
>>
>>2816939
>It's basically having the arduino unit pass back keyboard commands... which doesn't seem right, would think there's a "gamepad" input of some sort that could be used instead.
USB HID class handles everything. You just need to provide correct descriptor during enumeration.

>>2817248
>If I've read correctly the micro / leonardo ID's itself as such to the computer.
There are two options, and both are bad:
1. there is an intermediate usb-to-serial chip and your PC talks to it. Then you need a separate USB port (if MCU supports it) to be installed somehow.
2. you are talking to the ardushitto bootloader. Then you need to somehow force re-enumeration on behalf of your PC, and send correct USB descriptors

>>2817248
>>crippled multiple generations of embedded enginners
>I think it's more like "enabled a generation of non-programmers / EEs to futz around on projects with crummy code
No, it totally messed up the learning curve and labor market expectations.
1. Entry level jobs are destroyed, because "Oh I can blink a LED myself"
2. Above entry level there is a wall of "No way I'm reading the 300+ pages datasheet" and moving from ardushitto libs into something actually usable
3. And then customers come and "Whyyyy are you saying you need to rewrite everything from scratch?? It MOSTLY works"
>>
what would I need to do make a bluetooth light turn on from a program? I want to make a very simple program that just turns on a lightbulb because I think that would be cool. I have no real idea where to begin on the physical side...
>>
>>2818526
>There are two options, and both are bad
Option three:
>get a programmer dongle
>wipe the bootloader
>use the dedicated USB hardware to implement the HID class just as God intended

>>2818530
It’s probably pretty easy with an ESP32 and ESPhome. This is like five layers of abstraction atop what actually goes on, but I wouldn’t recommend bare metal C for a complicated peripheral like a Bluetooth modem to a beginner.
>>
>>2818530
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/esp-ble-mesh/ble-mesh-index.html#esp-ble-mesh-examples
>>
>>2802510
is there a point to the i2c protocol on HD44780?
none of the instructions use sda for data and instead read from d0-d7 and use another bit for coordination with the embedded controller
>>
>>2803735
>the way those led-legs and resistors are bent
FUCK
>>
>>2819165
>>2819165
nvm i went to set up the pinout and i think i am supposed to program mutliplexing here
>>
File: wemos_d1_7seg_cc.webm (3.47 MB, 640x426)
3.47 MB
3.47 MB WEBM
>>
File: wemos_d1_7seg_ca.webm (3.68 MB, 700x714)
3.68 MB
3.68 MB WEBM
>>
File: 1719756984145.jpg (170 KB, 854x1029)
170 KB
170 KB JPG
>>2819382
>>2819386
>>
>>2819387
>an array of 8 booleans
you know that’s just a byte, right?
>>
>>2819405
Quit explaining how computers work and let me exist in my zoomer python world
>>
File: ColecoKeypad.png (177 KB, 1476x734)
177 KB
177 KB PNG
>>2817248
>>2816939
Draft design. Waiting parts from China, micro knockoffs and 10-key pad. Will steal rest from from GBA controller.
>>
File: IMG_20240701_170320.jpg (3.91 MB, 3072x3609)
3.91 MB
3.91 MB JPG
>>2802510
bros i need some help because things seem very silly:
https://pastebin.com/2hjVQqaL
it is well commented dont worry
But basically this is what happes no matter what i try to do: PICREL

wtf?
things are lighting up and they are simply supposed not to
>>
part is 1602A btw
>>
>>2804128
I see an instagram video where the gardener protect their plants with an 5v open wires circuit.. the snails dies instantlyu
>>
>>2819543
>the snails dies instantlyu

ha, so you're the intended audience for those ridiculous fake videos like ''double your internet speed using just a paperclip''
>>
I just bought a Nucleo H755ZI-Q board since the H755 is evidently a dual-core arm cortex M7/M4 microcontroller

now, how does that actually work? I always assumed that to effectively make use of multiple processor cores/concurrency you need an operating system. Does that mean I'll need to install an embedded OS onto it somehow?
>>
>>2802510
>several months old general
ah, i see. Needs to be made again in g, this fits technology more than diy after all, nobody here is daily driving their own processor.
>>
>>2819658
chapter 11 or intel manuals volume 3, local apic.
>>
>>2819521
read the datasheet
>>
>>2819673
i did, i posted pastebin and part number, the datasheet is 12 pages long (assumes you know how th lcd is supposed to work) so i went and read hd44780 and i still have no idea what is going on
>>
>>2819671
Pretty sure it wouldn't get bumped quick enough there. From my experience, not many people on /g/ are doing embedded.
>>
>>2819680
we can psyop the autists into it and it will trickle down from there through shitpost and inclusion in the other generals' OPs
>>
>>2819681
>more people who don't understand electrical hardware wondering why their arduino won't power a motor, why they need pullup resistors, or why they can't sample a 12v signal
no thanks
>>
>>2819521
Just include "hd44780.h" tardiuno
>>
>>2819679
if you read the datasheet table 11 on page 39 it walks through the setup
you seem to only do function set and then skip over display on, entry set steps.
have you tried following this example?
i had a look when you posted first and i don't think you posted the part number of the driver or i didn't see it.
unless you post more info we can only assume wiring/voltages etc is correct, don't just assume a new or unfamiliar part of what you are doing is whats wrong, consider all possibilities.
>>
>>2819521
there are instances where you pull E high but don't pull it back to low. Line 138, 157 etc. Write a helper function that writes a byte to data pins and calls init_transaction. Probably also waits for WAIT_BUSYFLAG before doing anything. Use that function alone for writing data.

Start by a simpler examples that just inits the thing and puts a char and nothing else

Read the data sheet (carefully)
>>
>>2819691
looking at the table right now, i think internally you cant access ram until display on/off is called and i am doing my whole setup (clear, nigger, return home) and then turning it on

>>2819693
i am a bit worried about speed (controller is one instruction per microsecond, claimed at least) but i will write the wrapper and remove it if i *need* to

Cant mess around right now so i will report tomorrow, thank you Anons.
>>
>>2819699
>clearly didn't read the datasheet
Everytime

If are worried about speed then write your data directly to io registers instead of using tardunio's API to write them bit by bit

As long as you prepare your data on io pins for next command before that 1ms is over, you are not really losing time
>>
>>2819703
>clearly didnt read the datasheet
you literally have to write them bit by bit per the manual
>there must be an intermediate state between a change from an output high to an input etcetc
section 13.2.3 of atmega328p

anyway, the IO clock is as fast as the instructions clock...
>>
>>2819826
I haven't checked the Atmega but on the pic the IO ports were just registers and you could write the whole port at once if you wanted.
>>
File: 1719923225833.jpg (2.59 MB, 2479x3113)
2.59 MB
2.59 MB JPG
Now i am perplexed, writing display OFF and display ON makes picrel happen no matter what
Some things are commented because i have been trying stuff to find something that might work but nothing does, a second line showed up at least :D
>>
btw i did fuck around with the pulse (20 micros is super short), nothing works

it is over.
>>
I want to make a Linux SBC
I've laid out several boards (nrf52) for work and they work fine but I've never done anything with DDR memories or high speed data lines
Also another problem is, i have no use for such a board. I just like having random Linux devices which i can SSH into and make them so dumb stuff like web scraping etc
>>
>>2819836
use it as a proxy for random web surfing (downloading loli doujinshi)
>>
>>2819826
Read the datasheet. It even has an example for reading all bits at once. Set Enable pin after setting up all other data pins (all together) so your display does not try to read things while things are in intermediate state
>>
>>2819848
are you ignoring the pastebin or something?
I found a different document for the part, didnthe init sequence and now a cursor showed up (holy shit), i think the problem is solved and i just need to fix the bits for writing nigger since they seem to be different from the other document, not gonna update because this general is dunning krugers who dont click on pastebins and an unfrenly autist

i will move it to g on my own.
>>
>>2819876
>are you ignoring the pastebin or something?
ignoring what? it is just tardinio code. I am suggesting you to use port registers directly so you don't write write those registers bit by bit and not the make mistakes I pointed before
>>
>>2819876
>an unfrenly autist
i hope you don't mean me because it would bring me an overwhelming sense of vicarious wellbeing to see a pic when you get it working and i didn't mean to be unfriendly just succinct.
ganbare friendo.
>>
>>2819836
> ssh
It’s a meme.
Just hard-wire it with ethernet and use telnet.
They used to make 68000 based microcontrollers with eth phy on them back when fruit pi was something your mom made on Sunday.
Or, better yet, RS422 (or RS232).
>>
>>2820009
>telnet
I guess it's ok for local network, and if you put an embedded thing on the internet you deserve anything that could happen. I'd even go further and drop TCP altogether. Use UDP, which you can implement on top of raw ethernet in a couple of lines of C.
>RS422
>RS232
Isn't that different from a normal 3.3V UART? Why use that garbage?
>>
>>2820009
>They used to make 68000 based microcontrollers with eth phy on them
The original ESP32 has MAC hardware

>>2820016
>Why use that garbage?
because it's standardised, plus it uses the best connectors ever made
they're sturdy, can be screwed together so they don't accidentally come apart, you can easily have cable-mount and chassis-mount versions of both the male and female end, there are very reliable waterproof versions of the plugs, you can easily solder the connectors up yourself, the pins are the right width apart to solder a standard 2-sided 1.6mm PCB between them, they have their pins numbered on them, they have a convention as to master and slave but you can use a null modem if you want, they're perfect.

if only ethernet had as good a connector, maybe we wouldn't have to use USB for all our data and power peripherals
>>
>>2820018
You mean D-sub? They don't dictate any protocol. You can just use 3.3V UART with it instead of using that weird legacy odd-voltage shit.
>>
>>2820019
>You can just use 3.3V UART with it instead of using that weird legacy odd-voltage shit.
yeah but that's not standardised.
with rs232 at least you can just plug it into your pc and expect it to just work without caring about pinout or voltage levels.
and when you die, your wife's grandson will be able to just plug a quantum optic to rs232 adapter into your microcontroller project and not fry it with ±12V

the max232 just works
the only downside of rs232 is that you can't carry significant amounts of power over it, which is why ethernet is the better standard electrically speaking. i want to charge my phone over poe.
>>
>>2820020
Literally everything I've touched (except legacy PC hardware) used 3.3V UARTs instead of RS-anything.
>>
>>2820021
yeah and what connector did they use?
>>
>>2820021
then what youve touched is tarduino tier garbage. in the real world, where robustness and longevity matters, nothing uses 3v3 UART to do comms with off board/external systems
>>
>>2820077
This isn't entirely true. On a lot of professional electronics there's a serial port present on the board as a simple 4-terminal unpopulated pin-header. It isn't intended for use by non-technicians, or anything other than a temporary connection for debugging or reflashing hardware, but these are usually 3.3V UART. I'd be more amenable to using 3.3V uart if there was a half standardised connector for it, especially one that I could panel-mount. Dupont crimps don't count.
>>
>>2820077
>tarduino tier garbage
MCU and FPGA stuff isn't "tarduino tier garbage" you mouth breathing fucking retard.
>>
>>2820109
>I'd be more amenable to using 3.3V uart if there was a half standardised connector for it,
How is "solder wire to pad" not standard?
>>
>>2820141
I mean a standard for easily plugging and unplugging various peripherals. For one-time debugging I kinda agree, but soldering wires to pads is never gonna be a replacement for RS232.
>>
>>2819829
You need a potentiometer to control the backlight brightness. Looks like you don’t and the backlight has full voltage.
>>
File: 1714262962858417.jpg (80 KB, 785x847)
80 KB
80 KB JPG
I'm making a synchronous 20W boost converter with a 64MHz ARM MCU, a gate driver IC and some pretty slick 1.6mΩ FETs. Wish me luck boys i have never made anything like this before and i have barely any knowledge about control systems etc. I'll just dump the details i calculated if you guys are interested
>input voltage 3.2V from a LiFePO4 32650 cell, output 12V at 2A max
>switching freq 500KHz to 800KHz
>inductor 20uH 10A saturation 50mΩ
>this should give me between 150mA to 125mA of ripple current (can't fit a bigger inductor in the space i have)
>aiming to do basic proportional PWM from the feedback i get
>ADC measurements triggered when low side FET turns off (every single switching cycle)

Happy to receive feedback
>>
>>2820573
>every single switching cycle
Is your ADC fast enough?
Generally for SMPSs I want to use an analogue main PWM loop (e.g. TL494) and maybe use an MCU to control the reference voltages or provide a readout if needed.

Also put extra footprints for a snubber network at the switching node, and footprints for a small choke or resistor in series with the analogue power supply. Don't forget to minimise the switching loop.
>>
>>2820590
Thanks for mentioning that, i actually do have a comparator which is fed the feedback against a reference and it's output feeding to an interrupt pin on the MCU for a faster digital only feedback if i need it. I don't plan on using it for now.
The way i see it, ADC feedback can let me add more intelligence to the device firmware without having to modify the hardware.

Also a good point to add a choke in series to the switching node.

Its a non isolated SMPS, do i really need the snubber network? I don't foresee any major flux leakage (or whatever it's called) which could happen
>>
>>2820592
>a choke in series to the switching node
No the choke should be in series with the power going to the analog supply rails, to stop high-frequency noise.
>do i really need the snubber network?
Maybe, I've found it helped on occasion, it's nice to have the footprints in case you need them, but I probably wouldn't populate by default. I don't know the precise theory behind why you need them, but in general they'll eat the very highest frequencies from the peak of your inductive spike, it's those highest frequencies that radiate the worst electric field noise and could interfere with your circuitry if it isn't very thoroughly shielded.

Any plans to measure FET drain current? If so, you could implement current-mode control or voltage-mode control, or some combination. Or just use it for fault detection to prevent your bottom-side FET from exploding.

I'd also add footprints for RC filters on your analog inputs, if you don't have them already.

FYI all the extra footprints and things I'm suggesting are things I usually add to my very first prototype, where I don't know what I'll need and want to avoid ugly bodge jobs, before probably iterating the design once or twice more.
>>
>>2820573
> 20 μH @500 KHz
The resonant frequency is around 8 MHz, you are forcing it at another frequency which is going to be very inefficient.
>>
>>2820869
it's a boost converter, not some fancy resonant-mode switcher
>>
>>2820869
Switching at high frequencies is extremely difficult and never done because of high losses and the absolute behemoth of a gate driver that will be needed, capable of sourcing and draining several amps of current. Even the buck converters used in motherboards to feed CPU power are multi phase but still individually switch at low frequencies.
Another solution would be to increase the inductance but high value inductors are larger in size and much more expensive.
To be honest I'm not sure where you got that switching an inductor at its resonant frequency will increase the efficiency. I've never heard of this
>>
>>2820923
Resonant converters are more efficient because they have far less switching losses. When they close the switch, the current going through it is virtually 0, at least for a ZCS topology. It's similar for ZVS topologies, I think you get less energy loss to unwanted oscillations or something, but idk the details. They're also lower noise because you don't have anything above the fundamental frequency.

To not require an enormous inductor with thin wire, you lower the system's resonant frequency using capacitors. Now there's a thought.
>>
>>2820925
I have heard of ZVS and ZCS topologies as well but i too don't know much about them
I guess I'll try to build one sometime. PCBs are cheap
>>
>>2820918
> boost converter
I think it would be more important for a boost converter, no?

> Switching at high frequencies is extremely difficult
Not really. And it’s becoming more common in mass-produced electronics. The converter in my “inverter” microwave oven uses multi-strand wire in the main switching inductor to overcome the skin effect. I can never seem to fix that dammed thing.

> bigger and more expensive inductors
This is what I’m suggesting.
For a only 20 μH it’s completely feasible to build your own using 14 awg house wire depending on your core and whatnot, but bigger to keep the frequency down unless you have multi-strand insulated wire.

> never heard of resonant and efficiency correlation
I would think it’s kind of obvious if you think of how the inductor works—in this case it will be most efficient probably around the “top end” of it’s power output. As are transformers.
The tesla coil people might have some good insight on that (I’m not one of them)

Obviously I haven’t seen the whole circuit, I’m just saying test as you go. I made a lot of assumptions to come up with 8 MHz, it could be wildly different in your circuit. It just seemed low by about an order of magnitude.
>>
>>2820936
>I think it would be more important for a boost converter, no?
Going resonant is an entirely different topology. A boost converter works by turning on its main transistor, the current through the inductor increases linearly, then the transistor shuts off after some amount of time or after the current reaches a threshold. The shutting off of the transistor causes the magnetic field to collapse and cause a voltage spike, shunting the energy stored in the inductor out through the diode and into the output cap. This is fundamentally non-resonant. To control this topology, you just need to modulate the duty-cycle or threshold current as a function of output voltage. You can make it even simpler by just turning the oscillator on or off depending on the threshold, a simple 555 timer can be used as a boost controller if you're desperate.

A resonant converter turns on the transistor, the current increases and then decreases sinusoidally. The current passes back through 0 on this sinusoidal path, at which point the transistor shuts off. Then a different transistor on the opposite side of the inductor turns on to do the same thing but out of phase. The control of this kind of topology is much harder, since you can't vary the frequency or duty-cycle of the switching without breaking resonance or collapsing the field. Switching controllers that operate with this topology do exist, but they're pretty complex, and are only used for very high-power supplies where heat dissipation matters. Even kW ATX power supplies still use TL494s.
>>
>>2820957
No one was actually suggesting using a resonant circuit, but choosing a more optimal inductor for the pump frequency in typical operation, and that optimum point is the resonant frequency whether it’s free-running or externally pumped.

In this case, it’s a fixed 12 V output, and a nominal 3.2 V input so fixing the voltages makes computing all that (or testing) it easier.
>>
>>2821203
A mild inter-winding capacitance would slow down the ride time of the boost voltage spike, so the diode/high-side FET would have the current spread out more. Maybe this will make it significantly more efficient, but operating close to the resonant point for a topology that usually assumes the inductor has no capacitance may play havoc for control loop stability. Especially for a current-mode converter.

The aim of most switching converter design is to maximise performance while minimising inductor size, an inductor with a sensible low self-resonant frequency would be significantly more expensive for a couple percent more efficiency at best. If you wanted to use a small inductor and a parallel capacitor to drop the frequency, then the inrush current into the main FET would be awful and kill your efficiency gains. That might even happen with the big inductor approach. It would be objectively more sensible to use a resonant topology either way.
>>
esp32cam keeps crashing when writing to SD card. i think its because im using ext0_wakeup and it is being held low too long by the PIR sensor. it seemed to work at first and took multiple pictures, but when i test and hold pin low manually it only works with a low pulse and fails to mount sd card if held for more than a few millis. dont think i want to de bounce since im getting long pulses from the PIR instead of multiple shorts what else can i do?
>>
File: Untitled.png (160 KB, 1414x256)
160 KB
160 KB PNG
Would you recommend this to a total beginner? I'm about to make a perhaps impulsive purchase here. No idea what I'm doing.
>>
>>2822085
If you want to use arduinos, please learn basics of electronics and C-like programming so you don’t just flounder like a lot of tarduinos. For anything other than just copying an existing project, arduino relies on a foundation of supporting knowledge. Even for copying a project, if the tutorial isn’t very good you may find some assumptions and implications hard to follow.
>>
>>2822085
Not chink shit the collection, like in your image. Just buy any of these tiny boards for not more than $15, that will be enough for a start. I'd tell you to stay away from Arduino shit and maybe buy something cleaner like a RPI Pico, but I guess you'd blame me for suggesting something that isn't part of the Arduino ecosystem with its thousands of retard-level resources.
>>
>>2822085
that seems pretty expensive for what you get, also consider getting an atmega32u4 based card like a teensy 2.0 or a pro micro so that you can learn to program it with C/C++ and actually modify and read the registers with bit shifts which you can find by reading the datasheet, you will learn much faster and your knowledge will be deeper. you can skip bare metal programming for now and start with avr's microchip studio though.
for the arduino uno get one with a removable chip, that way you can use it standalone and then use the arduino uno just for flashing it.

also i realize now its hard to find good resources for complete beginners about the programming aspects of microcontrollers without access to courses, does anyone have a book or website for this? would be nice if it was added to the op
>>
>>2822085
If you have zero electronics crap laying around, and $45 is pocket change for you, it's probably fine. There are a gazillion of those kits out there; I've never tried to actually value all the parts but it's basically taking advantage of the combined shipping cost and low unit part cost to get you as much stuff as possible under 1 pound. You'll at least have enough to keep you busy dicking around with projects on your desk.
I had most of that stuff on hand when I started playing with Nanos, and any "real" project required other specialized modules I needed to buy seperately anyway. This kit wouldn't have been a good option for me, or other that are already doing electronics work.
>>
I'm looking at Santroller to set up some guitar controllers for a console. Software appears to allow you to program Pi Picos ootb; you connect up the Pico to the controller inputs and then use Santroller to configure the thing for whatever console you want to run it on.
I've only use Arduino for my controller projects, not familiar with Pico. The short bit of reading I've done, sounds like Picos are programmed using MicroPython... which it runs natively? Or compiles on board? The example I saw was using Thonny to dump code onto the board, but wasn't clear if it was compiliing it on PC, on Pico, or just sending over the code.
>>
>>2810945
It's worth the extra $10 for the giant code base RPi already has. If you spend 14 hours re-inventing the wheel to get your $5 Grape/Mango/Papaya/PlantainPi glorified broadcom breakout board working what you're essentially telling me is that your time is worth $0.71/hr.
>>
>>2822195
Tarduino has better library support
>>
>>2822224
Apples to oranges
>>
>>2802510
Radio is hard. I want to make outdoor thingmabobs that send/receive things to an indoor base station. Once I put my thingamabob outside the signal really turns to shit.
Maybe its the ass tier modules I get from AliExpress.
>>
>>2822428
increase power, or, put a high gain weatherproof antenna on your roof and run the coax inside. that way all rf is running outdoors.
>>
>>2822428
LoRa
>>
>>2822428
>>>/diy/ohm/
>>
File: 55555.jpg (65 KB, 650x500)
65 KB
65 KB JPG
>>2802510
is there any future in fpga career?
>>
>>2823237
Depends on the application.
Are you going to work for Tek or something? If not, then no.
>>
>>2823256
I meant working for intel etc...
>>
>>2823237
The picrel doesn’t make any sense.
For a data acquisition application a fpga can’t access memory (i.e. for oscilloscope acquisition) simultaneously either.
What they do is interleave it to different memory chips.
Programming is no different. As an example, the PS3 Cell BE had 9 cores and each had 256 KiB of independent memory so you didn’t have to fence, c&s, etc, and it just settles up later over the bus.

Only retards vigorously read and write the same variable in a memory location across many threads in critical applications inside their innermost triple-nested for() loops.
>>
Retard-tier RPI Pico question. If you plug one of these into a Win11 machine via USB... what should happen? Do the LEDs light up, does it open a system volume?
I've tried plugging this Pico in on a couple different cables, both with and without pressing the BOOTSEL button while plugging it in, and not getting anything. I have two of them, both are doing the same... nothing. Hard to believe both are DOA but I'm ready to ship them back.
My experience w/ Nano is they at least flicker the onboard LEDs as they come up...
>>
>>2823287
Nm… bad cables.
I fucking hate micro usb cables.
And no lights on these even when they are working.
>>
File: 1708780292302281.webm (391 KB, 770x594)
391 KB
391 KB WEBM
My friend gave me 8-10 ESP8266s dev boards and I got my env setup to the point where I can make it blink.
I know a little bit about programming (webshitter stuff) and nothing about embedded development.
Time to learn some C and tinker.
>enjoy the free bump and feel free to call me a useless faggot or whatever
>>
>>2802510
Is this the place to ask about whole home generators? I’m dealing with a multiple day power outage and looking for some ideas to avoid this in the future
>>
>>2823347
No, this is a thread for microcontrollers. Best bet is probably an sqt thread, or making an off-grid energy thread if there isn't one already.

Cheap method is just to buy a UPS (maybe a 2nd hand one with a dead battery) and bodge in a 100Ah or two to the internal connections. Then plug in your fridge and any pilot lights. Run some 12V stuff like lighting and your router directly off the battery.
>>
File: 1717311735895366.gif (171 KB, 339x490)
171 KB
171 KB GIF
I love ESP32, is that really wrong of me?
>>
spent the last 5 hours fucking around with a project designed to be built using stm32cubeide
even vscode would be easier
>>
>>2823334
cables werent bad, they are charge only. you need data cables.

>>2822085
if your going to buy that do it soon, those kits were $30 3 months ago... then you have to watch the paul mcwhorter arduino tutorials, he goes through all the projects without just teaching you to copypasta.
>baud rate 9600
>>
File: STM32F103 memory map.png (26 KB, 352x628)
26 KB
26 KB PNG
I'm trying to flash firmware to a T12 soldering controller that has an STM32F103C8 on it. I was following the instructions for using OpenOCD (stlink util is only for windows) here:
>https://github.com/deividAlfa/stm32_soldering_iron_controller/blob/master/Readme_files/Programming.md
But I get the error:
>** Programming Started **
>Warn : no flash bank found for address 0x08010000
>** Programming Finished **
>** Verify Started **
>Error: checksum mismatch - attempting binary compare
>embedded:startup.tcl:1516: Error: ** Verify Failed **
>in procedure 'script'
>at file "embedded:startup.tcl", line 28
>in procedure 'program' called at file "ocd-program.cfg", line 12
>in procedure 'program_error' called at file "embedded:startup.tcl", line 1577
>at file "embedded:startup.tcl", line 1516
It reads with an ID of 0x20036410 and a 64 KiB of flash. Is the code be trying to address reserved memory? Or is there some other problem? I'm fairly sure both the STlink and the KSGER V2 board have legit STM32s on them, but while the greaseweazel blinky code did load fine I couldn't see any flashing on the PC13 pin with my scope.

help
>>
>>2823568
Wait 0x08010000 should be in range of the normal flash addresses, it's only just over halfway into the flash address space. There's 0x00020000 addresses of flash memory here, which corresponds to 131072 * 32 / 8 = 524288 = 512KiB, the maximum size for an STM32F103. But this firmware should definitely work on chips smaller than 512KiB, as it says:

>The actual requirements are 10KB RAM and 64KB (*) flash.
>(*) Currently the firmware has surpassed the 64KB limit, and uses the additional undocumented 64KB flash block.
>(*) All 64KB devices have 128KB, with the second 64KB block untested from the factory, so not guaranteed to work.
>(*) To date, I have found zero issues. Original KSGER firmware also does this.
>(*) ST-Link checks the written data and the firmware uses CRC for settings, any error will be detected.

I don't get it.
>>
>>2823564
>they are charge only
You're probably right; I keep these cords in a box and just pull as needed. Problem I have now is nothing I have actually uses micro USB so I've no way to test whether a data cable is good with a known good device.
Well, other than these Pico. Which I now know work.
>>
>>2823568
>>2823573
Shit, now it isn't being detected by the OpenOCD, OR the bloaty STM32CubeProgrammer. We might be bricked, or even fried.

>>2823579
Test them all and put some (coloured) heatshrink around them to designate the cables as power only or data capable. I tried to colour code the USB A ends to tell me what was on the other side at a glance, but then the heatshrink just slipped off. Get the glue-lined stuff.
>>
File: sharpie900.jpg (132 KB, 900x900)
132 KB
132 KB JPG
>>2823581
if you want to color-code USB connectors, use markers. This is why I avoid black USB connectors from thrift store bins, except that I only do it to color the logo so that I can see which side goes up.
>>
>>2823573
what kind of shitty programming is on that thing that takes up more than 64K. holy fuck
>>
>>2823611
64K? That’s nothing. It’s still using TCL… i haven’t seen that travesty in more than a decade
>>
>>2823665
>It’s still using TCL… i haven’t seen that travesty in more than a decade
>is not using openocd
What are you doing here?
>>
File: paint markers.jpg (92 KB, 997x690)
92 KB
92 KB JPG
>>2823585
>I avoid black USB connectors from thrift store bins

impossible to avoid black USB cables
but they're not a problem to mark if you got some paint markers
or just some oil paint and a small brush
anything from a lil tube of artist's acrylic in ''robin's egg blue,'' to a gallon of house paint
>>
>>2823581
RIP, the STlink (the other STlink I have too) connects to another board, but not to this one. I'm pretty sure I didn't burn some fuses I shouldn't have, even then I think it should be detected. Unless that blinky script somehow shares some of the SWD pins.

Maybe I try and desolder the chip and resolder one that I scavenge from elsewhere, but my bluepill is fake. The STM32 on one of my STlinks looks to be real, but without hot air it will be nigh impossible to recover. I might try to desolder it with a shim underneath. People online are suggesting a piece cut from a razor blade.
>>
>>2823754
they're usually too short for anything useful so I've been cutting and splicing mine with 18g wire to make an 8" cable into 8' cable. nothing stopping me from making it longer except maybe ohms law. usb-jews hate this one trick.
>>
>>2823339
Good luck.
>>
if i throw a Pi in my PC case for reasons, is there a way to connect my motherboard to the Pi that would guarantee SSH access to the Pi from my PC even when the Pi isnt connected to the network?
>>
File: cisco_simpsons.jpg (47 KB, 400x345)
47 KB
47 KB JPG
>>2824693
>doesn't even know how to set up a private network link
go back to /g/ and stay there until you learn some basics
network <--- eth [PC] eth ---- eth [PI]
>>
>>2824694
seems simple enough but 1) im running wangblows so im not sure how straight forward setting up a VLAN would be; and 2) my motherboard has one physical ethernet port so id need to buy some usb adapter, meanwhile my motherboard definitely has some sort of USB header on it somewhere so if this could all be done over USB that would be perfect.
>>
>>2824696
>running wangblows
>one physical ethernet port
not our problem that your PC sucks, also you failed to mention such suckage in your original post, which is even more faggotry
>>
>>2824700
can you go be a nigger somewhere else please?
>>
>>2824693
I'm not sure whether PCs have this these days, or if it would be naturally available on the pi when it boots, but a UART header would be my first go-to. Well it's not SSH at that point, it's just opening a serial console, which is arguably even nicer.
>>
>>2824693
>>2824737
Or use something like this:
https://www.blicube.com/blikvm-v2-pcie/
A pi that slots onto a board that plugs into one of your PC's PCIE slots. This one uses a compute module though, so if you already have a pi you may want to look for a different model.
>>
File: stlinks.jpg (1.68 MB, 3636x1891)
1.68 MB
1.68 MB JPG
yo dawg heard you like stlinks
(both have fake/clone chips btw)
>>
File: First Boot!.jpg (996 KB, 2784x1503)
996 KB
996 KB JPG
>>2823775
>>2824740
I GOT IT WORKING
turns out i had to manually hold down the reset line for just the right amount of time, i guess the big cap on it might have been messing with the stlink
>>
File: shittypeephole.jpg (315 KB, 1926x1056)
315 KB
315 KB JPG
Fuckin' piece of shit cheap Chinese ESP32 cam boards. I built this little doorbell cam over a year ago, it's still working great, no problems. I've now rebuilt the same thing again with a new round GC9A01 display, and I can't for the life of me get it working consistently. It crashes any time I point it somewhere bright, if I keep it aimed down it stays running smoothly. I assume this has to be the camera's fault. The power is fine, no dips, no change in behavior from disabling and removing the LCD and stopping the stream, it still crashes if pointed out a window or toward a bright screen. Dammit Ping
>>
>>2825002
How much was the camera chip? And did it have a lot of reviews? I'm looking to do a camera project for security too in the future.
>>2824767
Way to go anon.
>>
https://streamable.com/dwors8
>inb4 this links to porn in a couple of days
>>
Glory be to the Fuhrer of Germany.
>>
>>2824767
dropped it and broke a corner of the OLED, not including any pixels but possibly including some micro traces
it still works fine for now, super-glued the back of it, hopefully it keeps working.



[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.