[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/diy/ - Do It Yourself


View post   

File: 100 KB, 1600x900, Octocopter.jpg [View same] [iqdb] [saucenao] [google]
2557052 No.2557052 [Reply] [Original]

Previous thread:>>2534035

Here we discuss microcontrollers, SBCs and microcontroller 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 or mouser'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

>> No.2557060
File: 148 KB, 1009x854, justworks.jpg [View same] [iqdb] [saucenao] [google]
2557060

>>2556361
Okay now I'm pissed.
I'm getting confused by your problem, so I pulled out some of my own shit to dick up an example, and now my own code from a year ago doesn't work correctly and I cannot for the life of me figure out why.
I finally got it to "work" but the resulting images are fucking wrong, I don't know what the hell is happening, I'm not even convinced it's JPEGDEC's fault at this point.

I'm going to waste a lot of time looking into this now, gonna go buy a bottle of scotch.

>> No.2557110
File: 155 KB, 1119x1252, Untitled.png [View same] [iqdb] [saucenao] [google]
2557110

How does the "sync logic" block here work? What does it do?
As I understand it, when USART in synchronous mode is driven by an external input clock, a problem arises, because we now have two clocks in the system - our internal clock, and the external input clock from the serial. How does it solve this problem? I don't know what keywords to use to find it myself

>> No.2557124

>>2557110
The baud rate clock signal is generated independently, either from its own source, or derived from the core clock.
USART communication typically uses packets to manage data transmission. A packet typically consists of a start bit, data bits, parity bit (optional), and stop bits.
Both the transmitting and receiving devices have buffers to store incoming and outgoing data. The transmit buffer holds data that is waiting to be transmitted, while the receive buffer holds data that has been received but not yet processed by the receiving device.

The sync logic typically includes a phase-locked loop (PLL) that adjusts the internal baud rate clock frequency of the receiving device to match the frequency of the incoming baud rate clock signal.

When transmitting data, the USART interface reads data from the transmit buffer and converts it into a packet for transmission. The interface then transmits the packet using the baud rate clock and the data transmission protocol defined by the USART specification.
When receiving data, the USART interface uses the baud rate clock to sample incoming data and reconstruct the original data stream. The reconstructed data is then stored in the receive buffer, where it can be processed by the receiving device.
In this way, the buffers and the USART interface manage the flow of data between the transmitting and receiving devices at a clock rate independent to the clock speeds of the devices doing the communication.
The processor has access to the buffers when they're not actively being read from/written to by the USART interface.

>> No.2557142

>>2557060
Try removing grayscale command, it kinda worked for me.

>> No.2557181
File: 243 KB, 500x338, Screenshot-2021-04-16-023656[1].png [View same] [iqdb] [saucenao] [google]
2557181

I'm trying to put together a routine for an AVR. Is there any way to get the compiler to completely ignore specific registers?

I have some assembly written that occupies most of the CPUs time, and the values it deals with are accessed near constantly. I want the compiler dealing with the C portion of the code to effectively treat 2-3 registers like they don't exist, so I can keep their stored values ready for use. I'm not finding any quick answers for this, though.

>> No.2557340

>>2557181
I'm not an expert at all but I had a similar problem last year with MPLAB. I eventually just gave up and rewrote everything in ASM, even though it was a fairly large program it was less stressful at the end because I got exactly what I fucking wrote.

>> No.2557381

>>2557340
>I eventually just gave up and rewrote everything in ASM

I may just end up doing that. Digging some more, then only semi-concrete answer I can find is basically "you can't". You just have to live with the extra SDS/LDS every time you grab the variable, if you want to mix ASM and C.

Not a big deal in my case, it's a small program. I mostly wanted to know how to/if you can do it for future reference.

>> No.2557412

>>2557052
regularop here
i forgor

>> No.2557435

>>2557060
Can you share all your code?

>> No.2557447

How do you guys make extensions for module's cables? I feel like the only way is to just solder wires to them and them couple them together with tape or something, is this the way?

>> No.2557523

>>2557447
>modules cables
what does this even mean? what cable? multicore/solidcore? what gauge? twisted pairs? what connector/mating system?
you can get roles of cable of various types from the chinks for cheap. you can also order certain lengths of cable with your choice of connector on one or both ends in quantities of 100 to a many thousand. just find a way to talk to the manufacturer (sweatshop)

>> No.2557665

>>2557412
This is why we get helicopter people.

>> No.2557702

>>2557181
The register keyword in c might help. Most compilers ignore it unless you specify a specific register, but I think the intent is to let you do what you are trying to do

>> No.2557724

>>2557181
As long as you're using a version of GCC, it has a very complicated set of asm options:
https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html

Really, the best way is to set up your code with a wrapper that saves registers and observes the GCC calling conventions for your CPU, giving it a label and module for C to call it. Then declare a forward reference, inside an extern "C" attribute if you're using C++.

>> No.2557763

I'm trying to implement a DDS for the first time, on an STM32F446RE nucleo board.
The idea was to feed a wavetable into the DMA, which then shuttles the wavetable into the DAC (eventually into an SPI buffer in a future build)

One of the necessary elements of a DDS is the ability to skip around through arbitrary indices of the wavetable, in order to be able to output a large range of different frequencies. But, looking through the datasheet and googling around, it doesn't seem like the STM32 DMA supports that. It seems like it just supports incrementing by fixed word, half-word, or byte lengths

tell me it isn't so
tell me there's some clever workaround so I don't have to set up a timer interrupt and waste all those CPU cycles shuttling in a sample value every few microseconds

>> No.2557765

>>2557523
what are the terms to find those type of cables?

>> No.2557839

>>2557763
You mean you can only increment by 8, 16, or 32 addresses at a time? Also one, presumably. You could maybe have 8 or 16 interleaved wavetables, making it trivial to move between indices. Assuming you have enough memory for that, and enough use for 16 different wavetables. Also that doesn't really work if it can only move from 24->32, and not 21->29.

t. dma noob

>> No.2557845

>>2557839
Let me explain a bit more about direct-digital synthesis. You have a, say, 4096-entry wavetable filled with wave data you want to output.

In C, for example, you could iterate through this wavetable by doing something like
for(i = 0; i<4096; i++){ output = wavetable[i]}. Simple enough. What if you want to change the frequency? Well, then things get a bit tricky.

It turns out, you can come up with some pretty accurate approximations to arbitrary frequencies, depending on how you increment the i in wavetable[i], so something like wavetable[(i + some pre-calculated number to get a specific frequency, the "Tuning Word")].
In essence, you can actually exploit digital aliasing to your benefit for once. If your wavetable's resolution is large enough, by changing how your i increments, you essentially "pick out" an alias of that wavetable at a specific frequency.

What's more, you can actually cycle through the wavetable with the argument as wavetable[(i + Tuning Word)%WTSIZE], so that it wraps around and "covers" more of the wavetable over time. This has the effect of reducing phase jitter and significantly reducing the noise floor. It also makes it so your output waveform doesn't just look like a staircase (assuming a proper reconstruction filter and wt size)

with all that being said, from what I see, the DMA can only increment with i = 32, 16, or 8. The STM32 is byte-addressable (I believe), so 8 is the minimum. Obviously this really sucks.
The "multiple wavetables" idea is about the only workaround I see but it ruins the elegance of it so much and also eats up a hell of a lot of memory. I'm trying to make a polyphonic musical synth, so crunching as much as possible into as little memory as possible is a priority

>> No.2557881

>>2557724
>https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html

Didn't have exactly what I'm looking for, but, looking through some related info, I found:

-ffixed-*register*

...which does exactly what I wanted. Plugging that in to the compiler options and looking at the generated code prevents the specified register from ever appearing. Perfect. Whether or not I'll end up using it, IDK, but might be handy in some very niche cases like mine.

>> No.2557883

>>2557845
>Obviously this really sucks.

Honestly, not surprised it works that way. General-purpose DMA is usually concerned with chunks of data being accessed one data-length (whether that be byte, word, dword, or qword) after the other. The AVR XMEGA's DMA has selectable block sizes, but will still only read one after the other.

IDK if any ARM chips have what you want, but, at that point, you could just dedicate a whole core to the task, anyway.

>> No.2557942

>>2557845
Yeah I've done that sort of thing once before, though DMA-less way and trying to cram it into an ATtiny. The moron me decided to use python to produce a sine table with a full scale range from 0 to 256, and I kept wondering why I was getting somewhat periodic dips. I also planned on making it polyphonic in 16kB flash after manual wavetable sampling and measuring the frequency of the capacitive pads, not sure how well that would have worked.
>I'm trying to make a polyphonic musical synth, so crunching as much as possible into as little memory as possible is a priority
What are your progmem limitations anyhow, compared to how long you'd like to make your wavetable? Because having 8 different voices (or 16 if you cram two 16-bit-depth values in the same 32-bit int) isn't necessarily a bad thing at all for a synth.

Taking an extreme of 44.1kS/s at 20Hz, that's 2.205kS for just one voice, assuming any dynamic effects are applied afterwards and so only need one cycle. Times 8 gives 17.64kS for interleaved waves, so 70.56kB. If you have 128kB of flash then the interleaved wavetable takes up a bit over half of that, which I'd say is probably doable. If you have 256kB or more of flash then I'd call that perfectly fine. If you use something like a RP2040 with the typical 2MB flash it's a non-issue, though the specs are somewhat worse than an STM32F4.

Can you not DMA that from an external SPI flash memory chip? A socketed wavetable might make swapping voices more convenient, and wouldn't add much complexity to your board.
Also arguably going full fourier and storing harmonic numbers might save more progmem in the end, though it would take up a shitton of RAM.

>> No.2557974

>>2557765
well what you search for depends on your purpose. for general purpose i bought a roll (100m) of 16p ribbon cable. i then bought various IDC connectors (plug assembly and sockets). want something for power? get search for 5mm barrel plug and cable assembly on alibay. need hi speed? use any CAT5/6 variant. easiest way to familiarise yourself is to get on digikey and just look at all the connectors/cables types

>> No.2558398

how bad is if i subsitute 400mw resistors to ones for 500mw in a circuit all other things equal?
The guy that designed this board lives in the other side of the world, with very different local options

>> No.2558404

>>2558398
two in series two in parallel, boom you have an 800mW resistor

>> No.2558408

>>2557942
>a sine table with a full scale range from 0 to 256
Did you compute your table offset as just an 8-bit number or did you use the high 8 bits of a 16-bit number? (That's called "fixed point".)
Your frequency corresponds to a fractional offset for each sample, so if you need 1.5x step per sample, you add 0x0180 per step, and it goes 0, 1, 3, 4. Then every sample you accumulate the remainder and eventually it skips you another sample into the table.

>> No.2558421

>>2558404
i am seriusly asking if I can get one resistor that has the same ohms, 1% etc, but somewhat higher power rating? i guess it is ok, but i need a sanity check

>> No.2558450

>>2558421
oh I'm sorry, I thought you wanted to use 400 mW instead of 500 mW, not the other way around.

Yeah, you can do that. Higher power rating isn't going to hurt anything.

>> No.2558455

>>2558450
i am a noob, there may be some non linearity or weird shit that changes how it goes.
thanks

>> No.2558577

>>2558408
I did it with pure integers. It meant the only frequencies I was capable of producing were strange integer fractions.
>it goes 0, 1, 3, 4
>Then every sample you accumulate the remainder and eventually it skips you another sample into the table
Oh I see, that's really neat. Not too difficult to do with an AVR, probably? 16-bit additions are cheap. Multiplications less so, but I was only having 6 fixed output frequencies anyhow, so I think I could just bake the 16-bit offset into progmem.

>> No.2558601

>>2558577
I've done it before on a 6502.

>> No.2559056

I'm trying to set the rtc time of an esp32 with the time on a ntp server, i can get the time from the ntp server no problem, but i can't set the time on the rtc.

Using the ESP32Time.h library, i've tried >rtc.setTime(timeinfo)
gives an error because timeinfo is struct tm. Currently i have:
>rtc.setTimeStruct(timeinfo);
But if i print rtc.getHour(true), i still get 0, always different from ntp.

>> No.2559067
File: 52 KB, 540x540, stm32-nucleo-f446re-stm32f446re-arm-cortex-m4.jpg [View same] [iqdb] [saucenao] [google]
2559067

>>2557052
i see lot of tutorials online showing you how to blink your first led but i never see them explain how they found the correct GPIO port that is related to the pin number on the schematic. Does anyone know which diagram can show this?

>> No.2559075

>>2559067
Bro just google "full board name + pinout".

>> No.2559092

>>2559056
forget it, i got it

>> No.2559142

>>2559075
i've tried looking it doesnt show whether the pin belongs to port GPIOA, GPIOB, GPIOC, etc.

>> No.2559148
File: 101 KB, 683x609, FoxitPDFReader_Zoc9ACiQwq.png [View same] [iqdb] [saucenao] [google]
2559148

>>2559067
ST documentation a shit, but it's there in the manual, and if you got it in the retail package it should be on the bit of cardboard. PC8 for example = GPIO C bit

>> No.2559150
File: 50 KB, 1123x183, FoxitPDFReader_VIrjPepCnF.png [View same] [iqdb] [saucenao] [google]
2559150

>>2559067
also if you want the little LED that's already on the board,

>> No.2559174

>>2559148
It is funny how not only mbed is arduino, but now arduino uses mbed.

I found out when reading about the new Arduino threads library proposal.

>> No.2559389

Has anyone used logic gates in your projects? How?

>> No.2559409 [DELETED] 
File: 227 KB, 2041x912, Screenshot from 2023-02-09 15-56-50.jpg [View same] [iqdb] [saucenao] [google]
2559409

>>2559148
I've read through the whole GPIO chapter in Reference Manual and i still don't get it regarding pin number output.
How did you decipher that PC8 is GPIO C bit?

Am i actually understanding this wrong? Is it actually possible to manually assign any GPIO A..H ports to any of the PC 0-15 pins?

>>2559150
yes the led is already blinking and the tutorial showed that GPIO A port was used for the PA5 pin to make it run. I just have no idea how he knew that GPIO A is tied to PA5.

>> No.2559458

>>2559148
ok holy fuck i finally got it after looking at how stm32cube generates code
PA pins are mapped to GPIOA
PB pins are mapped to GPIOB
PC pins are mapped to GPIOC
it was that simple that's why i couldn't find it anywhere in the reference manual.

>> No.2559461

if i set gpios as outputs on esp32 and then put the esp into deep sleep, will the gpios stay on, or will they start floating?

>> No.2559478
File: 47 KB, 687x171, Screenshot_2023-02-09_12-37-43.png [View same] [iqdb] [saucenao] [google]
2559478

>>2559461

>> No.2559600
File: 42 KB, 692x555, file.png [View same] [iqdb] [saucenao] [google]
2559600

>>2559478
cool beans looks like i can set pretty much all gpios as rtc which is great since i need 14 of them to hold their states in deep sleep

>> No.2559630

>>2558601
> 6502 programming
How come there is no good 6502 (or, ideally, 6809) core mcus out there? I mean modern ones.

especially considering you could now fit millions of them on a single PC processor die, and probably run them at 10 GHz.

8051 has a similar problem, but it's easier to get them for chips that are NOT general purpose... the just throw in a tiny 8051 to run the main function.

Considering the amount of code out there, and the latent expertese, this seems like a conspiracy.

>> No.2559638

>>2559630
>especially considering you could now fit millions of them on a single PC processor die, and probably run them at 10 GHz
See that's not actually as easy as it sounds.
Old cheap tooling that's cheap as fuck to operate is what makes cheap components.
What you're talking about is an extensive process that results in a fast 48-year-old processor that's more expensive than an incomparable 32-bit ARM processor.
It'd be cool, but not particularly useful. 6502s and other ancient chips are still around because they're cheap as fuck, and manufacturers can continue to produce ancient designs that still work with as little revision as possible.

Personally I feel like ARM dominance is why we'll never see a fancy 96-core Epyc6502 or Xe80 Phi.

>> No.2559771
File: 560 KB, 1024x1011, 2017-D_Roosevelt_dime_obverse_transparent.png [View same] [iqdb] [saucenao] [google]
2559771

>>2559630
Because now we have 10 cent RISC-V microcontrollers with no need to suffer a jank as fuck instruction set.
https://www.youtube.com/watch?v=L9Wrv7nW-S8&t=947s

>> No.2559792

>>2559771
When can I buy them?

>> No.2559803

>>2559792
For several years now.

>> No.2559814

>>2559771
Haven't looked at the RISC-V instruction set yet, but yeah, ARM is very shitty to write for. The "RISC" idea doesn't even make sense nowadays, you can get everything down to a single instruction if you throw enough Si at it.

8051 - great to program, the OG.
65xx - legacy, not too bad
PIC - ancient crap, milked old IP back in the day
AVR - Norwegia master's thesis, shouldn't exist, getting killed anyway for ARM
x86 - good, lots of code/experts
SuperH - Like ARM, but taken to next pleateau/fixed problems now open like RISC-V

>> No.2559841
File: 62 KB, 840x859, texas-instruments-logo-vector-free-11574210403hc9jhg5q1r.png [View same] [iqdb] [saucenao] [google]
2559841

>>2559814
You forgot one

MSP430 - Everyone forgets this one

>> No.2559848

>>2559841
That's because it isn't real.
Have you ever seen an MSP430 with your own eyes, not just a photo? It's a hoax.
Texas Instruments is a money laundering front for a powerful cartel.
Microcontrollers are popular, here we are talking about 'em, it's a big market.
The MSP430 exists only on paper, as a competitor to other similar microcontrollers. Go ahead, try finding a devboard or loose chip in stock somewhere, you can't.
What's that, in stock on Mouser/DigiKey? Try ordering some. Go ahead, as many as you want. They'll give you the run around for ages, but ultimately "supply chain issues" will somehow mean >10,000 in stock equals zero that they can get to you.
It's why they're not priced competitively, they don't have to be, and it discourages people from wanting to actually use these "paper" chips.
Still, the books over at Texas Instruments are filled with countless orders for huge quantities of MSP430 family products.
They'll have you believe there are countless commercial products in every corner of every market with MSP430s, but you'll never in your life find one.
All the specs, the photos, the software, it's all a facade to legitimize a whole family of chips that's never actually left the board room.

The only real MSP430 is in your head.

>> No.2559859

>>2559771
Nobody cares about those chips except the manufacturers, who multiply number of chips needed say 10000 pieces by the price. Then yeah, it's cool.

If you do it's your hobby you buy what's convenient, has big hobby community, easy and fast to start. I clicked your video, you have to buy extra serial converter for it, you need to learn new programming environment, you have to learn new code. While I can simply insert my arduino-like board and start delivering immediately for my own needs.

>> No.2559883

I know how to program but don't want to fuck with hardware too much

is it easy to get into arduino/rasberry pi to make like
mini computers maybe a small server?

>> No.2559884
File: 11 KB, 154x150, 1529087867835.png [View same] [iqdb] [saucenao] [google]
2559884

>>2559848
>Have you ever seen an MSP430 with your own eyes, not just a photo? It's a hoax.
Yes, find a 10-15 year old thermostat, it's probably got an MSP430 in it. They're even nice comfy QFP, but I have some DIP versions too.
I was actually paid to write code for MSP430 ~10 years ago. Unlike birds, they're real, I just know they're real! You have to believe! I even have a few beat up MSP430 chips that were rejects from a sloppy pick-and-place machine at that job. (but I have more STM32 chips)
What I haven't found (though I haven't really looked hard) is a development environment on Linux. My old stash of genuine STM32 blue pill boards keeps me too distracted, and busy too. Hmm, I see a PDF from some random uni in canuckistan, gonna check it out.

>> No.2559886 [DELETED] 

>>2559859
>I clicked your video
And um, wut? I wasn't the anon you think you were replying to.

>> No.2559892

>>2559859
>clicked your video
Not my video, amigo, just a crazy ozzie who slaps power output splitters together for laffs, I'm still in the STM32 camp.

>> No.2559897

>>2559892
>STM32 camp
Out of stock.

>> No.2559898

>>2559884
^ Paid cartel shill

>> No.2559900

>>2559897
Just buy shitty clones from Ching and Chong, they're just as good except when they aren't.

>> No.2559903
File: 64 KB, 540x420, 1630870160246.jpg [View same] [iqdb] [saucenao] [google]
2559903

>>2559897
I've got all I need, bro.

>> No.2559923

>>2559900
Show them

>> No.2559927

>>2559897
What are you looking for?
I'm struggling to see any that aren't in stock.

>> No.2559929

>>2559927
F7 or H7

>> No.2559988

>>2559638
>6502s and other ancient chips are still around because they're cheap as fuck,
Where can you buy 6502 (or derivatives) and for how cheap? I looked and all I can find are the Western Design Center chips and they are like $14 or more in single quantities on mouser, which isn't cheap at all for what you get. I think they just keep being made because people still buy them for old designs.
Another example: microchip still sells the dinosaur 16F84 and it's several times more expensive than their modern microcontrollers. I've never actually seen a case where these ancient processors are cheaper than modern ones in terms of price for performance and features.

>> No.2560032

>>2559883
Raspberry pi computers/servers are pretty straightforward, there's very little you can't just install and follow a tutorial for. See /g/ for more on that kind of front.

>> No.2560040

>>2559988
>I've never actually seen a case where these ancient processors are cheaper than modern ones in terms of price for performance and features.
Basically only in the event you need the absolute bare minimum, and even then a 3c padauk is going to be the cheapest unless you have a bunch of excess stock.

>> No.2560057
File: 1.77 MB, 1771x1211, B326FB99-47DC-420D-A939-2F27891BA2C7.jpg [View same] [iqdb] [saucenao] [google]
2560057

>>2559988
> why no cheap 6502 cores?

A 6502 is like 3500 transistors, there is even a discrete version, the monster6502.

Back in the day Moto and Intel sat on the IP even though they were trying to upsell you on shit we didn't want or need (e.g. i960) so mfgs went with other in-house/acquired designs. After the IP for those cores expired, the low-end market was full of unnecessary rubbish.

SuperH was a contender with RISC-V since Hitachi 's IP expired.

And now, of course, as you've seen, the can milk your $ for the legacy core since there are enough desperate people out there that need them.

The newer mcus support idiots who think blinking a LED with a Rasberry Pi-class SOC using Python is a hard-core low-level achievement.

>> No.2560065

>DIT4192 I2S to S/PDIF IC arrived
woo

>>2560057
shame there's no discrete floating gate transistors for non-volatile memory, same for feram
core memory flip-flops anybody?

>> No.2560071

>>2560065
> transistor for non volatile ram elements
maybe a J-FET and a capacitor is close enough

>> No.2560102

>>2559927
Nice disappearance after you got the answer.

>> No.2560154

>>2559814
>The "RISC" idea doesn't even make sense nowadays, you can get everything down to a single instruction if you throw enough Si at it.
RISC versus CISC is probably an outdated concept. From what I understand, when RISC was new, CISC CPUs had tons of complicated instructions, which were typically microcoded and slow. Microcode is an internal instruction set, which is runs a small program for each user instruction, and controls what they do. The complexity was justified with assembler programmer convenience. Make every instruction do as much as possible. Pack common tasks into specialized instructions. Did you know that x86 has BCD instructions? Nobody uses them and they're slow.
When RISC came along, the idea was to throw out microcode and execute every instruction directly. Even if a RISC instruction could do less than a CISC instruction, it was faster, because they could execute an instruction in as little as 1 cycle. The reduced instruction complexity made pipelining simpler and possible and reduced the CPI.
Obviously, x86 (CISC) survived and became the instruction set of the fastest CPUs ever. I'm not sure what's the state of the art, but some x86 CPUs simply translated the CISC input into internal RISC instructions and stored it in the instruction cache. The CPU really executed the translated program. If you look at RISC instruction sets, you will notice that most of them have more instructions and more complexity than the original x86. It seems if you spend enough resources like design effort and transistors, the difference doesn't matter anymore.
RISC-V is puristic about the RISC concept. The designers argue that reducing complexity in the instruction set really does matter. Their main argument is that simplicity, in theory, can enable even better optimizations. Read the instruction set specification, the comments on their design decisions. It's interesting.
What instruction set do you like better than ARM? What do you dislike about ARM?

>> No.2560266

>>2560102
I went to bed faggot, sorry to shatter your hope.
I don't see a "ton" of the F7s or H7s right now:
STM32F756ZGY6TR, STM32F730I8K6, STM32F730R8T6, STM32F722RET6, STM32F745VGT6, STM32F730V8T6, STM32F723ZET6, STM32F730Z8T6, STM32F750Z8T6, STM32F767ZGT6, STM32H750IBK6, STM32H725IGK6, STM32H730VBT6, STM32H730ZBT6, STM32H723VET6, STM32H7B0VBT6, STM32H7B0RBT6, STM32H723ZET6.

All in stock at the usual places, with many big stocking deliveries coming in March and April so there will be even more to choose from.

>> No.2560268
File: 181 KB, 1905x1653, 1.png [View same] [iqdb] [saucenao] [google]
2560268

>>2560266
Did you forget to choose "In Stock" filter? Because if you would, you'd get these results: 4 pieces in stock for F7, none for H7 and next batch in December 2023.

>> No.2560271

>>2560268
>STM32F767IGK6
Didn't say those were available, but hey look they've got 3 on hand.
>STM32F730I8K6
>Stock: 1 Can Ship Immediately
Looks like they've got one in stock.

You're looking at literally only one website, you need to expand and check some of the hundreds of other distributors.

Need more than a couple? Should've specified. STM32F767ZGT6, F723ZET6, F750Z8T6, F746NGH6, F730V8T6, all available right now, in stock, ready to ship, several hundred units, from just the first place I checked.

>> No.2560274
File: 245 KB, 1167x997, how2internet.jpg [View same] [iqdb] [saucenao] [google]
2560274

>>2560268

>> No.2560280

>>2560271
>from just the first place I checked.
Which one?

>> No.2560292
File: 159 KB, 1329x826, shenzeneelick.jpg [View same] [iqdb] [saucenao] [google]
2560292

>>2560280
Shenzhen Zhongxinhua Electronics, the Jiangxi Zhongxinhua Electronics Industry Co., the Jiangsu Zhongxinhua Electronics Co., the Shenzhen JiaLiChuang Electronic Technology Development Co., and of course the Shenzhen LCSC Electronics Technology Co, together forming the conglomeration of e-rape that is ZXHPCB, JLCPCB, and LCSC.

>> No.2560311

>>2560071
are jfets lower leakage than mosfets?

>> No.2560316

>>2560311
JFETs should have more leakage than MOSFETs, MOSFETs have higher input impedance and capacitance than JFETs.
I don't know what I'm talking about, that's just all I can remember, I'm hoping someone else chimes in to shit some real knowledge down our throats.

>> No.2560331

>>2559630
>imagine instead of 8086 based we had 6502 based
hnnng

think thats pretty much what ARM is though.

>> No.2560354

>>2560292
Thanks.

>> No.2560467

>>2560154
> RISC doesn’t make sense
Well explained. Wish I had written that.
> Microcoded
Things like the BCD instructions are still used at the assembly level, but compilers don’t often use them, they output a lot of RISC-like code now. Take a simple STL loop, the compiler was unable to fit the loop in a single cache line, so I used microcoded ancient instructions (e.g. XLAT) to shrink the loop, re-profiled and it was much faster under 64 bytes.

If i recall correctly integer divide was originally 230 cycles on x86 mcus, and on the modern core it’s like 12 clocks (and 1000x the clock freq, if you believe the GHz ratings of modern processors)

> ARM
ARM has become more of a religion, there is so many options, classes, cortexes, multiple instruction sets (i.e. thumb 1 and/or 2), +available customizations for big orders, etc. that you can’t say “I’m an ARM guru” and be right in another shop. All the useful stuff is in the extensions, like DSP stuff depending on what you’re doing.

>> No.2560479

>>2559848
> where are MSP430s?
I’ve never seen on in the wild, come to think of it.
The most common mcu i remember seeing in devices and equipment was the ubiquitous Moto 68HC11. Now NXP/OnSemi (in case you want to blink a 100w LED with a real Motorola lineage 2N3055)

>> No.2560498

>>2560311
Yes, the 2N5457 JFET is in the pico amps, compared to a similar MOSFET device — the 2N7000 — has leakage in the nano amps. If you are talking about a power MOSFET like the IRFZ44N, thats even worse (more than 2000 times worse than the JFET)

Of course there are other parts with different specs, but those are the most popular ones afaik.

>> No.2560501

>>2560498
> the 2N7000

You can see one in action in ben eater’s voltage multiplier video he just posted a few days ago but i assume everyone here watches that. Or should.

>> No.2560578

>>2560479
>MSP430
That made-up chip that doesn't exist?

>> No.2560680

Ok give it to me straight, Ive never done pcb design. Ive made some basic circuits from tutorials and stuff and im able to wire breakout boards to esp-32s and program them and what not but i wanna make a pcb and have it manufactured.

I want an ESP-32 on a PCB with two sensors and a TFT display

Stretch goal would be the ability to add an microSD card for storage.

Anyways where can i even begin to learn PCB design is this somethign I can learn in 2 or 3 months enough to be able to put that PCB design together and have it manufactured or should i pay some jabroni on FIVER to do it for me?

>> No.2560700

>>2560680
If you've made circuits of any kind, applying a similar level of complexity to PCBs is really straightforward.
That is, anything within your ability to make on a breadboard you can readily make into a real PCB.
First time I decided I wanted a real PCB, I watched a 20 minute YouTube video, had my design ordered later the same day.

Download KiCAD or EasyEDA and watch a tutorial. Getting started is easy, well worth it to dip your toes in and at least try.
Both are popular, EasyEDA has the bonus of integration with JLCPCB and LCSC, which genuinely does add some convenience.

Simple stuff is forgiving, the devil is in the details, the more complex your designs get the greater your chances of weird problems.
If I redesigned my first PCB today it'd be way better, but my first attempt still worked just fine.

>> No.2560701
File: 58 KB, 959x346, 29-11-2019-15-31-5de139da2dd7c[1].jpg [View same] [iqdb] [saucenao] [google]
2560701

>>2560680

For any non-RF design (those PCBs are black magic, complete with runes), it's pretty straightforward. Design software for this comes as a package, and will include something to put together schematics. Draw something up in that, import it into the PCB module, and connect up the lines however you need.

Download KiCad (it's free) and poke around. It's capable, not too hard to figure out, and there's a lot of community support for it.

>> No.2560707

>>2560680
Oh, I should add that like so many things, with only a little effort it becomes easy to work with freely available designs.
Shitloads of products have their schematics freely available because of how they're intended to be used, it's great for hobbyists.

Want to design a PCB with an ESP-32, an LCD, a MicroSD slot, and plenty of left over GPIO for sensors?
Sounds like a TTGO-TS to me! Here's the entire schematic, right from LilyGO's github: https://github.com/LilyGO/TTGO-TS/blob/master/T10_V1.0.pdf
Includes lots of useful stuff you'd probably want anyway, in a real schematic for a real product, so you can see exactly what's used and how.
Like the ME6211 regulator, and the way it's hooked up with a power switch for the battery that's bypassed by USB power input.
There's a TP4054 in there so it can be used with a LiPo battery, but you can see that there's nothing in there to prevent undervoltage of the battery, so the battery needs to have its own protection.
The CP2104 is there too, that's a USB-UART bridge that lets you program the thing with just a USB cable.
You can see the speaker is hooked up to a NS4148 audio amplifier with some filtering of some kind, probably a low-pass filter. The input comes from Pin 25, a DAC output from the ESP, so they're using the DAC to output audio. That's super convenient for an ESP32 because you can use all the fun I2S audio stuff and have it fed right out the DAC!
The TFT connections, SD card, it's all there.
All of that's built around an ESP32-D0WDQ6. If you built around an existing dev module, then tons of it is taken care of for you.
That voltage regulator, LiPo charger, the USB-UART bridge, that's all the stuff that comes on a typical ESP32 dev board.

When it comes to hobbyist shit, there are schematics out there, tons of fucking schematics for so much shit.
Tons of work that's already done for you.

>> No.2560708

>>2560701
Why would a beginner start with kicad if you can pirate something like altium?

>> No.2560715

>>2560708
Because Altium offers a steeper learning curve while giving you features you will never use but endlessly sift through.
>Why drive a Civic when I could steal an F-18?
Because you're trying to drive to 7-11, not starting another Gulf War.

>> No.2560721

>>2560715
>Altium offers a steeper learning curve than KiCAD
Kek, nice troll.

>>2560680
I don't recommend to listen to this bullshit, KiCAD is much more complicated and has tons of badly implemented open-source functionality. Unless you really want open-source for some reason, you should never touch that piece of crap.

>> No.2560735

>>2560721
Ah, so kicad is to altium as gimp is to photoshop.
Got it.

>> No.2560901

>>2560700
>>2560701
>>2560707

Holy shit this is exactly the info and guidance I needed thank you very much

>> No.2561090

Can you recommend a cheap arduino-compatible microcontroller with really good low noise analog inputs? Or maybe STM is better?

>> No.2561095

>>2561090
What kind of signal? Honestly internal ADCs aren't good for much more than 8 bits of resolution. You're often best off using external ADCs.

>> No.2561100

>>2561095
>What kind of signal?
Photodiode or phototransistor. I guess both output High or Low, for me is the timing important.

>> No.2561102

>>2561100
How many bits of resolution are you after? The RP2040 has some pretty decent specs as far as sample-rate goes.

>> No.2561106

>>2561102
To be honest I don't know, never worked with ADC. The photodiode does recognize pulses of light about 20 nanoseconds long, as far as I understood. So I would like to catch them at those speeds. And the signal should not be covered in noise, but I have no idea how to check this before buying everything.

>> No.2561124

>>2561106
>20 nanoseconds long
Look at your photodiode datasheet to see how quick its signal will be. If it can respond to that, then you'll need an ADC on the order of 100MS/s, which is getting expensive and definitely requires an external ADC, like a TVP7002. Do you actually need to see the pulse amplitude? Of course you'll also need a microcontroller with fast enough clock and DMA to handle the input, maybe requiring an FPGA or a bare metal SBC.

>> No.2561129

>>2561100
>>2561106

Wait, are you trying to just catch edges on a photodiode? You don't need a good ADC for that. You want an analogue comparator. Or, depending on what you're doing, an edge detector.

What is your exact application? 20ns pulses would imply at least a 50MSa/s ADC, more like 100MSa/s if you actually wanted more detail than "something happened here". A comparator or edge detector that fast would be way cheaper.

>> No.2561132

>>2561106
Sounds like you don’t need an adc, you need a schmitt trigger, a shift register and a few gates to generate an interrupt.

>> No.2561136

How does one transition from coding in the arduino framework to esp idf?

>> No.2561144

>>2561124
>>2561129
>>2561132
That's got really complicated really fast.

Alright, I'll try to explain. I have a light source, which flashes with the maximum speed of 15 kHz and transmits a code using different duration of the flashes. I need to catch it and decode. Basically like a TV remote control which sends IR signals to the TV, but much faster. Do I need a good ADC for this?

>> No.2561150

>>2561144
>15 kHz
>much faster
Mate that's slower than a normal IR transmitter. If you just use a standard frequency you can use an off-the-shelf IR receiver.

>> No.2561157

>>2561150
15kHz means one flash in 66 nanoseconds. So I found myself a photosensor with does this possible (20 nanoseconds) and asked here. People above said it's too fast, and now it is too slow. I'm confused... Really want to make this project work, before it I basically just flashed LEDs and used standard arduino examples.

>> No.2561164

>>2561157
no it's 1 flash in 66µs
microseconds
1E-6
that's easy

>> No.2561171

>>2561164
Fuck me it really is microseconds...

Alright then I guess it's easy and I use basically any microcontroller with 10 bits ADC resolution and connect it with resistor to a analog input?

>> No.2561187
File: 32 KB, 636x372, TSOP34838.png [View same] [iqdb] [saucenao] [google]
2561187

>>2561171
Yeah but as the other guys are saying, a fully analogue approach isn't exactly ideal. Look into IR modulation techniques and how they eliminate ambient light from interfering with them. They output an IR square wave at a set frequency (e.g. 40kHz) for a unit of time as a logical 1, while no square wave for that same period of time makes a logical 0. That way you can just band-pass filter that frequency to avoid ambient light and 120Hz flicker from mains lighting. They also usually need an AGC of some sort, since the strength of the signal will change a lot as a function of how far away the transmitter is.

Read this:
https://datasheet.octopart.com/TSOP34838.-Vishay-datasheet-10317854.pdf
Looks like they recommend at least 10 cycles per symbol, which at the maximum 56kHz is only 5.6kb/s. But you may well be able to push that bitrate higher if needed, or find a different brand of IR receiver that will demodulate at a higher frequency.
You can also see the block diagram, with its AGC and band-pass filter.

If you do it all with an MCU and ADC, you'll still want a band-pass filter, an amplifier, and possibly also AGC. You can handle some of that digitally, but that 120Hz signal can really swamp you out, so you'd need a fair bit of extra bit depth to get sufficient SNR, plus some decent DSP programming. Not saying it's impossible, but it's not cost effective and it makes the hardware and firmware a lot more complicated.

>> No.2561198

>>2561187
Thanks, that's what I need I guess. I didn't understand most of it though, I'll save the answer and try to google every term.

Unfortunately I can't get the working module, because it's not IR and not a remote, I used it as an example. I just have a light source in visible wavelength which I need to decode using this approach. I will need to construct a pcb similar to your picture.

>> No.2561225

>>2561198
Ah, not IR. I did something similar once before, making a pulse oximeter as a part of a physics lab. We just used a band-pass filter and did the rest with FFTs in python after acquiring the data onto a computer, though we were trying to extract a frequency signal so had a much lower effective signal to noise ratio than you will.

While you could ditch the band-pass filter and use digital signal processing to filter out noise, I'd recommend using an analogue filter. From there, whether you just ADC the filter's output or try to change the gain on the fly in order to use it with a comparator is up to you. The former may well be easier since AGC (automatic gain control) isn't trivial. Using an analog switch IC like a CD4053 to change the gain of an op-amp circuit isn't a terrible way of going even if you are using the ADC.

Depending on whether or not you have a higher voltage rail to work with you may or may not need rail-to-rail op-amps.

>> No.2561230

>>2561225
I don't know about AGC, but I liked the idea of filtering all unrelated lights except my flashing signal. I will try to dig into it.

Am I understanding correctly, that AGC is needed just to amplify the low signal?

>> No.2561259

>>2561225
I found such thing as a narrow band pass filter using operational amplifier. It looks with it I will able to filter rest lights and keep only my flashing light on one frequency.

The only question is, how can I transmit my signal, if the frequency stays the same lol.

>> No.2561261

>>2561259
>how can I transmit my data
Fix

>> No.2561272

ordered an arduino starter pack and an ESP32 board on aliexpress. what should i expect? i have done a little bit of electronic projects before, nothing really big though. i want to learn a bit more about how these fuckers work because it pisses me off that i don't know how the little black boxes in shit make my tool go EEEEEE or ZZTTTTGRRRRRRRRRRRRRRRRRR etc.

>> No.2561280

>>2561225

I don't know why you're getting such janky advice, but you don't need anything more than the phototransistor/diode and a resistor.

All AVRs (the chips that Arduinos use) have analog comparators built in. If you need them for some reason, they'll work as long as your pulse is longer than one clock cycle (at the 16MHz maximum of a typical AVR, this is about 60ns minimum), it will pick it up.

But you don't even need the comparator. You should be able to just hook up the sensor directly to a GPIO pin. A pull up (there's one built in that you can use, or you can use your own externally) will have the pin read high when the sensor is off, and the sensor will pull it to ground when it's on. The chip will just see it as normal digital logic, no peripherals needed.

>> No.2561288

>>2561280
Because changes in ambient light will throw your DC level all over the place, and flickering lights will introduce a bunch of noise. Those are enough of a problem at NIR levels that pulse oximeters and IR receivers have to care about them, and it's going to be even worse at visible light levels. For the former issue you need to have a running average and compare bits to that, which isn't too difficult but still a bit of a pain on an AVR. For the latter you can assume that, worst case scenario, the amplitude of flicker is greater than the amplitude of desired modulation, and so you need to implement a digital filter to get rid of it. Considering you should already have a pole or two worth of antialisasing filtration, (80kS/s maximum on a 328P) why not just have a band-pass to get rid of the 120Hz noise? Using the built-in analog comparator with no filter is just asking for trouble. Sure you can get some sort automatic control by sweeping the compare voltage in search of a signal, but ensuring you ONLY get desired transitions and no noisy transitions would basically be impossible, you'd need a lot more pulses per symbol than a system with analogue filtration, and trying to recover the actual data from the comparator stream is going to be a computational nightmare.

>> No.2561296

>>2561272
>how these fuckers work
In my opinion, the Arduino software ecosystem is such that it reduces the chance of learning how stuff really works. What you should try from the start is how to build a program with raw gcc (Makefile, or cmake if you're a homosexual), how to program the device using the command line, and maybe how to connect gdb. Then write a program without provided libc and startup asm files. Write everything yourself. Look at the disassembly output and make sure there's only code in it which you wrote. Your first challenge is writing your own UART driver to get debug output. You may need to familiarize yourself with low level shit like memory mapped I/O, the instruction set the MCUs use, maybe you even need to start with understanding how registers and stacks work. Conceptually, MCUs are not very different from desktop CPUs. There's normally no OS. Instead of making syscalls, you access the peripherals directly either by accessing registers or using a vendor specific driver or HAL that does it for you.

>> No.2561299

>>2561288
>Because changes in ambient light will throw your DC level all over the place

Gonna be real, glancing over everything else, I kind of assumed the guy had a module, not a bare sensor, that had filtering built-in.

If he's just using a straight photodiode, yeah, things get more complicated. Personally, I'd just emulate the simple modulation scheme that TV remotes use, and throw in some heavy ECC if necessary. I can't imagine that wouldn't take care of it unless the transmitter is being swamped by disco lights.

If you _are_ working with some kind of nightmarish SNR, enjoy the crash course in signal analysis, I guess.

>> No.2561308

>>2561299
Yeah he said "photodiode or phototransistor", which I assume means just the discrete part. That's why I recommended picking a standard frequency like 40kHz and using an off-the-shelf IR demodulator/receiver. But apparently he's transmitting with visible light, which won't get through the dark casing of an IR receiver. Plus the bitrate might be a little too low.

This is a tangent, but I really like the idea of a communication network based around light-bulbs modulating their brightness in order to transfer data through hallways and open doors. Be that for transmitting information directly relevant to the lightbulbs (e.g. brightness, hue), or for sending S/PDIF or whatever. My house could become one large cellular automaton.

Also Z-transforms are cool.

>> No.2561311

>>2561308
>>2561299
But how do I modulate signal in my case? I'll have constant frequency and my light source is just turning on and off without change of brightness.

>> No.2561316
File: 9 KB, 400x400, OOK.png [View same] [iqdb] [saucenao] [google]
2561316

>>2561311
Turning it on and off is called "on-off-keying" and is an extreme form of amplitude modulation. Something like this. Though honestly if you have the choice I'd just use an IR LED even if it means more parts, because you'd be able to use an off-the-shelf receiver.
Also if your light flashes bright enough compared to the surroundings, you can ditch all the filtering and stuff and just feed the photodiode output to the MCU. Watch for seizures.

It's not like you can't do other forms of modulation like FSK or PSK or whatever, but generally they're more complicated.

>> No.2561323

>>2561316
Thanks.

>> No.2561329
File: 68 KB, 1080x520, Screenshot_2023-02-12-04-22-29-19_4641ebc0df1485bf6b47ebd018b5ee76.jpg [View same] [iqdb] [saucenao] [google]
2561329

>>2561316
I kinda feel adventurous and think I will try filtering approach, the circuit doesn't look too bad. At leqst for now.

>> No.2561350

I have an teensy and the audio board for it because I wanted to do audio stuff with it. Now I'm severely regretting purchasing it. Digital shit is fucking gay as fuck. It could either be a wav player or a shitty sampler worse than a ripoff casio. An interface would be decent but it's so much trouble it's not really worth it.

>> No.2561506

>>2558577
Fixed point numbers are a great, low cost way of getting fractional precision without mess of floats or need for an FPU.

Most fixed point conversions can be done through shifts and adds only which makes them very fast

>> No.2561528

>>2561329
>the circuit doesn't look too bad

sorry to be a spoil-sport, but dont place too much trust in op-amp filter circuits.
they never ever remove enough of the bad stuff unless you got like a 10-stage filter.

>> No.2561539

>>2561528
Btw maybe you can confirm my idea. Let's say it's a broad daylight, sun is shining, nice houses and green yards around. Somewhere down the road there's a pulsing bright light (15kHz pulses). Let's say on my side of the road I've put a photodiode which operates in the same wavelength and connected my photodiode to the filter above which I calibrated to the narrow band pass (let's say 14.9kHz-15.1kHz).

Does it mean my sensor will sense only pulses in said frequencies? Or you mean this filter will not do that?

>> No.2561552

>>2561539
>this filter will not do that?

the filter will definitely filter. but it's a question of degree.
there will be all kinds of noise present, much bigger than the 15Khz signal, which will get through unless you have a super-duper filter.
so your circuit will trigger on the noise instead of the signal.
also, if you do make a super-duper filter, it'll have a tendency to CREATE a 15Khz signal even if IT'S NOT PRESENT, because some of the the noise is white noise, which contains ALL frequencies.
so, other means are needed such as
- photo lenses to focus in on one single spot
- plastic color filters to remove unwanted wavelengths
- modulation that's a much higher frequencies, like 100 megahertz, coz there's less noise there
- alternate means of sending signal, like radio (LoRa for instance)

>> No.2561566

>>2561552
Is it possible to simulate this with noise etc?

>> No.2561570

>>2561566
>simulate

dont expect you'll find a ''cosmic noise'' source in any simulator.

>> No.2561575
File: 48 KB, 460x303, new_par_solar-radiation-1.jpg [View same] [iqdb] [saucenao] [google]
2561575

>>2561570
I've never done the simulations, but I assumed there's a way to generate random noise in known frequencies.

>> No.2561596
File: 83 KB, 1000x1000, 61Gramd54GL._SL1000_.jpg [View same] [iqdb] [saucenao] [google]
2561596

It seems like hardly anyone has ever used esp32cam.
Have you used it and how?
I just use it to monitor my oven when pizza is cooking and for time lapse photographs.

>> No.2561709

>>2561596
It was a hot topic in the last thread.

I've a few of them around monitoring the 3D printers and serving as a doorbell cam.

>> No.2561914

>>2561596
The thing is, are there any alternatives?

>> No.2561918

>>2561596
>only usable high speed interface is radio
Useless unless you really want to transfer video over wifi.
>needs 5V 2A
Really?

>> No.2561921

>>2561596
>esp32cam
as with all the esp devices, trying to make it useable without hardcoding in the wifi settings is humbug.

>> No.2561963

>>2561918
>needs 5V 2A
To be fair, that's only if you're pushing it.
There's no reason you can't run one as low as 500mah if you don't require good quality or an framerate.

>> No.2561969

>>2561963
Wait you are saying fps depends on the current? And I'm wondering why the fuck my fps are so low comparing to specs.

>> No.2561992

>>2561969
Running higher XCLK speeds, usually required for higher resolution or framerates, does increase how much current it pulls. The overall power consumption can vary a SHITLOAD depending on the features you're using and how you're using it.
For most practical applications, 1.5A is the minimum, 2A is safer, below that you can start causing brownout resets just trying to tweak the settings. The actual average current consumption is way, way lower, but it can spike past 1.5A.

>> No.2561993

>>2561992
>1.5A is the minimum, 2A is safer
Lol I was running it off my laptop USB

>> No.2561994

>>2561993
Yeah not gonna have a good time that way.

>> No.2562038

>rp2040s went out of stock a few days ago on LCSC
>back in stock again soon
woo

>> No.2562378

I'm looking for an MCU with ~80 GPIO's and a clock speed of >400Mhz with SPI & UART. Can you program these arm M7's with platformio or do you need a super expensive software suite?

https://www.mouser.co.uk/ProductDetail/NXP-Semiconductors/MIMXRT106ADVL6B?qs=sGAEpiMZZMuI9neUTtPr7zc5WdCD0vKlFOpJ%252B55oxM7CCgbDbXQFkQ%3D%3D

>> No.2562384

>>2562378
>Can you program these arm M7's with platformio
you've linked a bare MCU; platformIO works in the context of assembled devices (devboards/carriers) with fixed clock speeds, pin assignments, and so on. If you can find this chip as part of a devboard, protoboard, or something like that, there may be a PIO definition that will work.

Either way, you certainly don't need an expensive suite, there will be a foss or mfg toolchain somewhere but it might be a baremetal mess rather than a cozy VSCode plugin. You will obviously also need a board to connect to it surfacemount, along with the necessary external components of that particular MCU line.

>> No.2562386

>>2562378
https://docs.platformio.org/en/latest/platforms/nxpimxrt.html

>> No.2563312

What's the best way to interface a microcontroller with an LTE chip like a SIMCOM 7600? A lot of the breakout boards provide UART pins & a USB port, but UART is way too slow for LTE speeds and using a USB cable to connect an IC to another IC/microcontroller is ridiculous. How would you do this with an ESP32 for example?

>> No.2563403

>>2563312
the trick is you dont. those "modules" utilise a microcontroller inside them that interfaces with a qualcom rf chip through some parallel fifo interface, which itself is capable of what you want. this is analogous to "camera module" vs "camera cmos". the module has a controller on it that has limited functionality, despite the cmos being very capable. anyway, some brands of these LTE modules have a developer api/programming suite that will allow you to directly program the mcu inside the module and utilise this API. this will achieve what you want.

tldr. you need to get access to proprietary development tools. you can get access, but as far as im aware you need to be a professional in the industry working on a legitimate product and sign NDAs and all that shit

>> No.2563515
File: 104 KB, 800x800, 7600.jpg [View same] [iqdb] [saucenao] [google]
2563515

>>2563403

I think you're describing boards like the A9G which do in fact have their own MCU. However, I'm talking about breakout boards like pic related (SIMCOM7600), where there's little more than the main IC and some support caps & resistors. There's a micro USB port on the back of this board, but I don't even see a USB transceiver IC so I think the USB communication logic is handled directly by the IC. If I connect a device via that micro USB port I can LTE speeds but over the UART I'm limited to the 14.4kb/sec implied by the 115200 baud. I can increase the baud but the communication is not stable above 115200. To be fair, that that may just be an issue with my circuit, but it still seems UART is not the optimal way to interface with this module at high speed. The USB port apparently provides the access I need, but a USB cable is ridiculously bulky for my application.

>> No.2563517
File: 121 KB, 790x741, 7600_2.jpg [View same] [iqdb] [saucenao] [google]
2563517

>>2563515
posting pic related for clarity.

Why don't they provide access to the USB TX/RX lines via GPIO pins, like they do with the UART?

>> No.2563726

>>2563515
nope. im not describing that or another module. im describing all of them at their core. they ALL use a microcontroller (of some kind, usually stm32) that handles all the uart, usb, and modem comms directly. ill try and explain it differently. you know how these modules can be uploaded with new firmware over the usb? well thats what you want to do, you need to upload your own firmware to the board. to be able to do this though you need to have proprietary software. this will allow you to program the mcu and use the api for the modem, and also bypass any security locks on the chip. contrary to popular belief its not just one huge RF ic under the shield, its that, plus a controller and some rf and digital passives bundled nicely so that you can just attach an antenna and go. talk to the manufacturer and ask them to give you access to the software

>> No.2563734

>>2563726
Ok, that makes sense; I had suspected as much after I posted my previous reply. That said, I don't think I need to change the behavior of the IC or change the firmware; I just want whatever interface is currently exposed via USB to be accessible over GPIO pins. It's an issue with these breakout boards; they could make it available, but they don't. On a related note - I can change the baud rate of the UART (there's an AT command for it) but anything above the default 115200 doesn't seem stable. Not sure if that's an inherent issue with the IC or EMI interfering with UART lines, though.

>> No.2563786

I want to do an LCD project, I know that I could just develop a program on the micro controller directly, but I haven't even bought it yet.
I have a aruduino uno r3 with a ssd1306 display (with i2c or spi, I will probably use).
I could use the uno, but I want to use the pico because it has a better ADC.
so is there any software to simulate a pico and display?
I plan on using C++ (but I could use python if it's really the only option for simulation).

>> No.2563789

>>2563786
>simulate a pico and display?
LTSpice

>> No.2563801

>>2563786
I think I can work with wokwi
it has a vscode plug that has certain features for paid users, but I guess I will just stick to the web client since it supports the pico, C and my display.

>> No.2563856
File: 420 KB, 1425x1014, 1676504827136.jpg [View same] [iqdb] [saucenao] [google]
2563856

>> No.2563858
File: 191 KB, 1423x1010, 1676504845588.jpg [View same] [iqdb] [saucenao] [google]
2563858

>> No.2563870

>>2563734
no the hardware lines for the rf modem, qspi or fifo or whatever are not available. the usb lines are, but not on certain shitty breakout modules. my recommendation is to make your own board using the module. you can expose any and all pins that are available, things like the uart, gps, usb, pcm etc should be available if its supported by the chipset. as for the high speed uart. thats a problem with emi, impedance, matching, stray capacitance. you could use a rs485/rs232 translator to turn it into a nice twisted pair differential comms. that will alow for increased speed and fidelity

>> No.2564266

>>2557052
anyone have the pasta/rentry for SBCs comparing with the atomic and chink knockoffs and others

>> No.2564593
File: 97 KB, 698x523, index.jpg [View same] [iqdb] [saucenao] [google]
2564593

Guys, i have a UV sensor, i want to get the uv index, pic related is supposed to be the values, the analog read gives me some crazy values that can go to 3000, am i suppose to multiple the analog value by 3.3 and then divide by 4095 and compare with the Vout values?

>> No.2564639

>>2564593
what sensor and post schematic

>> No.2564645

>>2564593
datasheet. might even have an example application circuit in it

>> No.2564717
File: 235 KB, 2560x1707, proxy-image.jpg [View same] [iqdb] [saucenao] [google]
2564717

>>2564639
>>2564645
guva-s12sd
board is pic related

>> No.2564726

>>2564593
>analog read
the readings you have are the Voltage, either in millivolts or 0.00-100.00% of VCC.

>> No.2564746

In the current year, is there ever a reason to use STM32F4 over G4?
DSP and FPU capability of F4 are heavily advertised, but as far as I can tell, G4 has the same

>> No.2564769

>>2564593
There are multiple steps to debug
>test output voltage with multimeter to ensure shit works properly
>double check your connections
>check if analog read works as it should - pullup/pull down resistors or potentiometer

Values in that chart are based most likely on 5V supply and 10bit (1024 values) ADC converter.
Also there seems to be multiple variations of board with different feedback resistors, so something to watch out for as well

Without knowing what specific board you have it's pain in the ass to debug remotely

As for converting analog value to actual voltage
> (ADC value) * VCC / (ADC resolution)
For example, 12bit ADC with 5V supply
> 3000 * 5.0 / 4096 = 3.66V Vout

>>2564746
it has it's use cases. A lot of flash, ram, some higher pin count packages etc.
I see G4 more as replacement for F0-F3 series and some lower end F4.

>> No.2564780

>>2564769
>output voltage
looks ok, never goes over 0.5V, constantly changes between 0 and the 0 to 0.3V range. It's night here.

>For example, 12bit ADC with 5V supply
>3000 * 5.0 / 4096 = 3.66V Vout
Forgot to mention, i'm using an esp32, so it'll be 3.3V.
Using that formula, the Vout is constantly giving me 0, idk if it should be a float value.

>> No.2564786

>>2564780
>idk if it should be a float value.
do you mean your Vout calculated that way is an INT?

>> No.2564789

>>2564780
If you're converting ADC to actual voltage in ESP32, then yes you need float variable
But generally do not recommend converting to actual voltage as it's irrelevant information, calculate it on paper and don't waste CPU cycles

As for ESP32 itself, ensure that it is configured correctly. It has configurable attentuation, adc bits etc.
Without knowing parameters hard to say if ADC is correct or wrong.
If you're using arduino code - I don't know shit about it

>> No.2564790

>>2564786
float or not, Vout values are too low, something in the math is not right, analog read gives me values like 1420, 2660, 490, 22, while
>sensorVoltage = (analogvalue*3.3/4096)
gives me 0, 1 and 2. I think i need to multiply by 1000 somewhere?

>>2564789
the board makes that convertion, suposedly.

>> No.2564799

>>2564790
If sensor is working fine - just connect voltage divider to ADC pin with something like 10k/10k

You'll get multiple things from this test
>adc resolution
>adc vref
>adc stability
>if code is performing correctly

>> No.2564803
File: 38 KB, 838x520, guva_schematic.jpg [View same] [iqdb] [saucenao] [google]
2564803

>>2564789
>>2564786
pic related is schematic, i'm manually checking the values.

R2 = R6 = 1k
R5 = 5.1k
then there's one resistor that is either r4 or r1 that is 3.3k

more on the sensor: http://www.arduinoprojects.net/sensor-projects/arduino-uno-guva-s12sd-uv-sensor-example.php


opamp is mv358l

>> No.2564814

>>2564790
>float or not, Vout values are too low, something in the math is not right, analog read gives me values like 1420, 2660, 490, 22, while
>sensorVoltage = (analogvalue*3.3/4096)
>gives me 0, 1 and 2.
no shit. That's the integer floor of your actual voltage (0.x-3.x). If that variable is an INT it will be calculated as one.

>> No.2564816

>>2564803
Further developments.
The sensor is working, i uploaded the code from the link and it works, now, to get the index, i have a bunch of if statements with the values from >>2564593 compared with analog read, now i just don't get the logic behind this, because if i have a flashlight really close to it, the maximum analog value is 4095 and the graph says that index 11 it at 240?

Same if i use voltage, the sensor goes to 3.3V, but the graph only shows 1170mV, is this due to the datasheet?

>> No.2564834

>>2564816
this doesnt look like a true uv sensor. looks like a basic photodiode which will give you output for any type of light

>> No.2564994
File: 21 KB, 338x556, 1676660678690.jpg [View same] [iqdb] [saucenao] [google]
2564994

might need a uv pass filter

>> No.2565052
File: 382 KB, 1920x1050, Untitled1.png [View same] [iqdb] [saucenao] [google]
2565052

Any ideas what causes this?
When serial printing country-specific characters, every 16th character comes out like this.
Printing normal characters works fine.
I tried different baud speeds, made no difference.

>> No.2565054
File: 317 KB, 1920x1050, Untitled2.png [View same] [iqdb] [saucenao] [google]
2565054

>>2565052
Pic 2/2

>> No.2565059

>>2565052
>>2565054
Those are wide characters but you are using the standard character type. wchar_t[] and cast.

>> No.2565093
File: 30 KB, 709x383, file.png [View same] [iqdb] [saucenao] [google]
2565093

This is just annoying. I really want to use the AI text generators instead of google because they save me so much time having to read stupid datasheets and clicking through stupid google results.
But the problem is that shit like this happens all the time.
It will give me a truth sandwich where 80% of the information correct and then it puts wrong piece of infomration there and makes it sound like it's completely correct, where unless you actually know it's wrong, you end up using it when designing your pcb and then when it doesn't work you are fucked.
Here is a good example, it tells me wrong info, so i call it out on the bullshit and it instantly agrees with me, so if it fucking knew that, why did it lie to me?
We are so close brehs to ditching gay ass datasheets, but it's just not quite there yet.

>> No.2565096
File: 13 KB, 317x379, 1346714204644.jpg [View same] [iqdb] [saucenao] [google]
2565096

>>2565093
whoops, i accidentaly cut the part above where it told me to set gpio35 as internal pullup.

Anyway, i'm posting it as a warning to anyone who tries to use the gpt this way, it's often makes these small mistakes that can fuck you up. I now have 5 pcbs on the way that i will have to solder 5 external resistors to by hand, because i got tricked by a robot ;_;

>> No.2565107
File: 63 KB, 763x743, file.png [View same] [iqdb] [saucenao] [google]
2565107

>>2565096
okay thats it.. i'm back to googling and reading datasheets this thing is fucking useless

>> No.2565131

>>2565093
>having to read stupid datasheets

what kind of arduino fag are you. if you can't read a data sheet you need to forget about electronics.

>> No.2565140

>>2565059
>wchar_t[] and cast.
What the fuck am I reading.

>> No.2565221

>>2565140
something something underscore t: a specific type in c++ with fixed size. wchar stand for "wide character" which are ones beyond ASCII (any accented char or symbol). Coded and passed to the USB interface like that, they only ever allowed to use one byte each, you can't ever represent Æ or Ö with a byte for example. So instead of a string, which is array of char_t or uint8_t, he must have and transmit using array of 2-4 byte wide characters. Array is designated with [] in c++ so n[] is an array of n's. wchar can use anywhere between 2-4 bytes of it allocation

Cast, this basically just means interpret one thing as another. so interpreting the regular character as wide character essentially just pads it with zeroes, interpret the wide character as normal means to ignore those extra bits.

>> No.2565222

>>2565221
Sorry not char_t . Just 'char' which would be "uint_t" underneath.

>> No.2565224

>>2565221
You're all over the place. I've never seen an UART which uses 16 bit characters. UARTs normally use a 8 bit codepage or UTF-8 (the latter is to be recommended). You don't send wchar_t over UART. wchar_t is not actually standardized in the first place. On Windows, it's UTF-16, on UNIX it's often (but not always) UTF-32, in general it can be anything. USB descriptors and text strings use UTF-16, sure.

>>2565222
uint_t isn't a standard thing either. char is a C type. uint8_t is usually typedefed to unsigned char.

>> No.2565227

>>2565222
Sorry meant uint8_t

>> No.2565229

>>2565096
>>2565093
Sign up for the bing ai chatgpt
It can pull data directly from datasheets

>> No.2565230

>>2565224
> don't send wchar_t over UART. wchar_t is not actually standardized in the first place. On Windows, it's UTF-16, on UNIX it's often (but not always) UTF-32, in general it can be anything.
Yes thats what I meant with
>array of 2-4 byte wide characters
not to lock OP into 16bit necessarily.

As for char: char actually can be different from 8 bits more easily than unit8. Some system use a non octal byte. On those uint8_t is still 8 bits but 'char' is varied, always one local arch byte (the smallest addressable/queryable block of bits, no relation to ASCII or Unicode really)

>> No.2565234

>>2565230
char is defined to be at least 8 bits minimum. There can be no type with less bits than char. So either uint8_t is (unsigned) char, or it's not defined (which must happen on standards compliant platforms with CHAR_BIT>8).

>> No.2565237

>>2565234
That is interesting. I hadn't considered that it'd be UB on a 9+bit system.

Regardless I think the problem is still the same. He is passing nonascii characters all around as if they were. His arrays won't line up or their length will be off. Wherever it's going from that to serial, UTF etc, or vice versa, is goofing up as a result. It's exactly every 16 chars.

What else is a likely explanation? I thought clock skew at first, but seems like that would evaporate at low baud. If it's really the way arduino and *its own* s first party serial monitor are handling encodings, well, that'd be retarded. Maybe test with putty or another OS. Seems like bug report would be huge if so.

>> No.2565244

>>2565237
UTF-8 is fully ASCII compatible, and will work, as long as the 8th bit is passed through, and the receiver side interprets it as UTF-8. Either his UART is configured for 7 bit, or there's some legacy codepage bullshit happening.

>> No.2565249

Anyone have much exp with hooking esp32/arduinos up to unity/unreal?

>> No.2565253

>>2565244
>UTF-8 is fully ASCII compatible
Not arguing with this. But are we really sure that compiler is handling the string literal that way consistently? All the way to the uart 'HAL'?

>>2565244
>7-bit UART
Again, I'd hope not. Surely Arduino itself would be internally consistent if so. Serial.begin would default to that incoding with no NXM parameter.

>>2565052
Sorry we taking so much time. Maybe try using the UART one at a time as number and see what is happening coding wise.

if I'm understanding arduino, something like
"Serial.print((char)theString[n],HEX);" for all n.

Also setup the uart manually as 8N1 or whatever, in the call to begin(). Doubt that's it though.

>> No.2565264

>>2565253
I don't know what the Arduino code is doing either, but you're right, it might mess up the encoding. Our poster should try to send character bytes to the UART manually or using the lowest level function available.

>> No.2565296

I set CONFIG_ESP_CONSOLE_USB_CDC=y in sdkconfig.defaults in my project based on the esp-rs/esp-idf-template. stdout of the program I flash to the wemos s2 mini ends up in minicom. But std::io::stdin().read_line blocks and also nothing I type in minicom is echoed. The original micropython put a repl in minicom, but for some reason it was no msc_device so I couldn't upload a main.py. What did micropython do that I'm missing?

>> No.2565332

>>2565052
>using chars or strings in the first place
>let alone anything other than ascii
Too much hassle, I convert them to uint8_t before shoving them in progmem.

I wonder though, is it getting those accented characters crammed into some (mostly) common 8-bit encoding? Or is it sending UTF codepoint or whatever in the first byte, such that the second byte is called upon to imply a character outside of ASCII? Be easy to tell with a logic analyser, or just looking at the underlying print() code to see how it converts a char* or str or whatever that is into integer(s).

>>2565093
Yeah I tried it once because I was trying to find a difference between a couple of ICs (PCM2902/2903 IIRC) and couldn't be bothered cross-referencing everything. Came up with a different difference each time I ran it. It can definitely parse text well, but it's not all the way there in determining truth. But once we do have a tool that can read legal documents and datasheets and scientific papers without bias and even look for errors contained within them, humanity will be in a much better position.

>> No.2565715
File: 163 KB, 1920x2100, Untitled3.png [View same] [iqdb] [saucenao] [google]
2565715

>>2565253
On top, printing one character at a time in hex
On bottom, same thing without hex
What I don't understand is, why is it a different character each time? Why does it keep shifting like that?

>> No.2565717

>>2565059
>>2565221
Supposedly there's some L macro that saves a string as 16-bit, but I have no idea how to use it and can't find documentation on.
And apparently it's not as easy as:
>Serial.println(L"ěščřžýáíéúůóňť");
>Compilation error: no matching function for call to 'println(const wchar_t [15])'

>> No.2565737

>>2565715
If you look carefully, it's also messing up other characters in your original post. I didn't notice before;
>>2565052
On the first couple, Ä becomes A and some of the capital C also lose their accents. It stops after the first time. Your new code probably does the same thing but it's scrolled too far for me to see.

I suspect from this, it's gotta be a problem with the Arduino serial monitor. Try using putty

>> No.2565739
File: 97 KB, 1920x1080, Untitled3.png [View same] [iqdb] [saucenao] [google]
2565739

>>2565737
Putty is even worse.
I give up, I'll just use unaccented characters.
Thanks anyway.

>> No.2565744

What's the best way to control the rpm of a 230vac fan motor with a microcontroller?
>zero-crossing detection + triac
>pwm + two anti-series mosfets
>something else entirely
Which one and why?

>> No.2565746

>>2565739
You'll need to adjust putty to the same baud rate and encoding as your Arduino (8 data bits 1 stop bit) or it'll be misinterpreted .

>> No.2565748
File: 45 KB, 1031x720, Untitled4.png [View same] [iqdb] [saucenao] [google]
2565748

>>2565746
I did.

>> No.2565749

>>2565746
Wait, is there a way to set anything else? I only looked at the speed setting.

>> No.2565750

>>2565749
Yes. Down at the bottom in "data" or "serial" I believe.

>> No.2565751

>>2565750
Looks correct. 8 data, 1 stop, no parity.
Also I tried unaccented characters and those show up fine in putty too.

>> No.2565753

>>2565751
Might be another option for encoding, choose UTF-8 or unicode. I don't have a clue otherwise.

>> No.2565757

>>2565751
look im a bit late to the party but, in my experience, anything thats not ASCII will give undefined results. faguino is retarded anyway as im pretty sure it only handles ascii "strings". in any case i dont see any use case or advantage to serial print accents. this is also a good example of "picking your battles". ask yourself this, why battle premade systems designed for basic ascii? when instead you could make your own c++/c# program that will read and display correctly your accented characters

>> No.2565760
File: 405 KB, 1080x1710, Screenshot_2023-02-19-12-11-08-35_4641ebc0df1485bf6b47ebd018b5ee76.jpg [View same] [iqdb] [saucenao] [google]
2565760

>>2565052
It's not about serial monitor, it's about retarded arduino IDE devs from the US, where people can't expect others to use something except english.
Apparently they fixed it in December 2022.

>> No.2565761

>>2565751
Hi again,
After some more searching it appears this is a very recently-resolved bug in the Arduino IDE. You should be able to fix it by updating to the latest version/snapshot. https://github.com/arduino/arduino-ide/issues/589

>> No.2565762

>>2565760
Yeah, what he said. Lmao

>> No.2565764
File: 67 KB, 1266x713, Untitled4.png [View same] [iqdb] [saucenao] [google]
2565764

>>2565760
>>2565761
>>2565762
Well that was a waste of time.
I downloaded the nightly version and it works fine.
Thanks to everyone involved.

>> No.2565786
File: 220 KB, 1439x927, ali vfd.jpg [View same] [iqdb] [saucenao] [google]
2565786

>>2565744
>control the rpm of a 230vac fan motor

it uses an induction motor coz they're quiet.
speed is determined by frequency and number of poles.
you generally cant change either, so it's considered fixed speed.
(the speed buttons rewire the motor, so it's actually 3 fixed speeds)
anyway, you can get a VFD machine to change the frequency.
these are complicated/expensive.
but Ali sells some that are super cheap, like $50.
i wouldnt trust those to work.

>> No.2565791

>>2565786
So just changing the effective voltage wouldn't work?

>> No.2565799

>>2565791

not on this kind of motor.

>> No.2565803

>>2565799
Alright, fuck it then. It'll spin at constant rpm.

>> No.2565809

>>2565715
You're printing it as char, which is signed (in your case). char is promoted to int, which is 32 bit (in your case), when it prints hex it converts it to unsigned int. UTF-8 uses the 8th bit, which makes the char value negative, which is why you see these FFs.

>>2565717
L makes string literals wchar_t. wchar_t is a bad idea, stay away from it. UTF-8 is superior.

>>2565764
Did the Arduino garbage really fuck up this simple shit? I suspect the serial monitor simply didn't interpret the UART output it as UTF-8.

>> No.2565817
File: 210 KB, 800x1200, 2626925[1].jpg [View same] [iqdb] [saucenao] [google]
2565817

>>2565786
>>2565799
This is the type of fan in question, I have no idea what's inside.

>> No.2565859
File: 246 KB, 1831x837, induction motor regulator oc donut steel.jpg [View same] [iqdb] [saucenao] [google]
2565859

>>2565786
>change frequency
So the simplest way to do that is a rectifier + full bridge inverter making a modified sine, with the MCU doing some math to calculate the width of pulses and gaps to set both the required frequency and rms voltage, right?
Would that work?
Pic related, don't laugh.

>> No.2565860
File: 251 KB, 1831x837, induction motor regulator oc donut steel.jpg [View same] [iqdb] [saucenao] [google]
2565860

>>2565859
Also forgot a diode bridge between the ac and caps.

>> No.2565880

>>2565809
> char, which is signed (in your case).
I'm calling the cops

>> No.2565881

>>2565880
I don't get it, please explain the joke.

>> No.2565887

>>2565809
>You're printing it as char, which is signed (in your case). char is promoted to int, which is 32 bit (in your case), when it prints hex it converts it to unsigned int. UTF-8 uses the 8th bit, which makes the char value negative, which is why you see these FFs.
This would mean the same characters trigger it every time. It wouldn't be every 16th character regardless of what is there.

Why I'm the world you'd imagine it converts to unsigned int is beyond me. It prints a char as hex, simple as that. Serial.print prints chars lmao. You maybe thinking of serial.write.

>I suspect the serial monitor simply didn't interpret the UART output it as UTF-8.
Explain how any character works then lmao. Not a single one in his string is a part of 7 bit ASCII.

>> No.2565890

>>2565715
Does arduino not support C++'s std::string? (I am a tourist).
I think you need to use .getbytes instead of length.

>> No.2565899
File: 46 KB, 637x579, 1351036973002.jpg [View same] [iqdb] [saucenao] [google]
2565899

>>2565890
>STL
>on a microcontroller
oh anon, you so funny

>> No.2565902

>>2565890
by convention, Arduino only supports the worst parts of c++ (if it supports anything)

>> No.2565904

>>2565899
Not unheard of nowadays. The ESP32's toolchain actually has excellent STL support. Maybe not ::thread . Certainly I wouldn't use Arduino/Atmel's

>> No.2565905

>>2565887
I was too lazy to actually analyze the screenshots of the output.
>Why I'm the world you'd imagine it converts to unsigned int is beyond me.
I tried to explain why there are FFs in the output, because it's char being signed and the effects of it might be confusing. In the end, converting to hex and converting to unsigned are the same thing.

>>2565890
I don't know. std::string is probably too bloated and requires dynamic memory allocation. You need a lot of stack and memory for it to make sense. I avoid any uses of malloc in firmware. If a firmware needs malloc, it's shit.

>> No.2565914

>>2565904
>just throw an almost complete computer at it, bro!

>> No.2565955

>>2565914
t hat is nothing
take a look at the Parallax Propeller 2 lmao

>> No.2565961

>>2565904
>Maybe not ::thread
ACKSHEWALLY yes, yes it does.
The implementation is built on top of FreeRTOS xTaskCreate, it's nice for portability, but if you're writing something specific it may be better to forgo it and use xTaskCreate directly.

>> No.2565963

>>2565961
thanks, I hate it

>> No.2565973 [DELETED] 

>bought some linear hall sensors
>plug into arduino
>wave some N45 neodynmium magnets at it
>no response
>output just flickers around 120
>test each one, one by one
>nothing
>try a potentiometer
>scales from 0 to 1023 just fine
Did I get a whole batch of duds or are magnets not strong enough for this sensor?

>> No.2565974

Checking the captcha functionality.

>> No.2565987

>>2565973
What sensors?
The common KY-024 you find all over Aliexpress and eBay can output both an Analog and a Digital signal, but sure you're hooked up correctly and pins are assigned correctly. You can also adjust their sensitivity.
The cheaper 3-pin modules like the KY-035 are pretty self-explanatory.

If the sensor has an open drain output, you need a pull up resistor, which the Arduino can provide internally.
pinMode(69, INPUT_PULLUP);

>> No.2565989
File: 98 KB, 911x512, hall.jpg [View same] [iqdb] [saucenao] [google]
2565989

>>2565987
these

>> No.2565997

>>2565989
>>2565987
> open drain output
> you need a pull up resistor

>> No.2566001

>>2565989
Oh also, those are not analog hall effect sensors.
They're hall effect switches.
Do not expect a useful analog output, it does not do that, you only get a logic high or low.

>> No.2566003

>>2566001
(It's a solid-state reed switch.)

>> No.2566010

>>2566003
Doesn't a reed switch imply movement in insulating vapor/fluid/vacuum

>> No.2566011
File: 23 KB, 335x332, confused-unga.jpg [View same] [iqdb] [saucenao] [google]
2566011

>>2566001
ok thanks.
I thought linear hall effect switch was the one that gave an analog output.

>> No.2566012

>>2566011
sorry. you want hall effect sensor or magnetometer

>> No.2566025

>>2566010
A reed switch only implies a mechanical switch actuated by a magnet. A common relay is a SPDT reed switch.
Similar to the way that an SSR can replace an electromechanical relay, a hall-effect switch can replace a reed switch, and offers similar advantages.

>> No.2566026

>>2566025
>mechanical switch
is a solid-state device mechanical??

>> No.2566027

>>2566011
Try A1302, iirc those are pretty popular for 3d printer endstops and such.

>> No.2566030

>>2565859
>Would that work?

generating sine waves or fake sine waves is easily doable.
the tough part is creating those at 230V and capable of many watts.
i suspect the cheapo $30-$40 VFDs are just square wave units.
which might work but probably badly, and noisily.

>> No.2566031

>>2566026
>is a hammer a chainsaw?

>> No.2566036

>>2566031
So it's either a reed switch or it's solid-state, but it can't be both.

>> No.2566043

>>2566036
A reed switch in inherently mechanical.
A "real" reed switch is literally a flexible piece of metal, a reed, that when magnetized touches another piece of metal, thereby closing the switch.
As a general term, "reed switch" doesn't strictly refer to actual reed switches, but any electromechanical switch actuated by a magnet.

Solid state implies non-mechanical, no moving parts. A reed switch is inherently mechanical.
A hall-effect switch is able to accomplish the same task as a reed switch, but without any moving parts, it is a solid state device that's actuated by a magnet.
So, in effect, it is like a solid-state reed switch.

In the same way, relays are electromechanical parts, they have physical components that move when actuated.
A solid state relay is able to accomplish the same task as a traditional relay, but without any physically moving components, hence "solid-state" relay.

>> No.2566045

>>2566043
Gotcha thanks. Lots of stuff I use works that way too, the old, simpler term is still popular even though it's not strictly correct.

>> No.2566057

>>2566043
>without any physically moving components, hence "solid-state" relay.

actually, since we're having an autism party (you keep saying solid state reed switch. stop. now.), I need to chime in here and point out that "solid state" was not to differentiate vs. mechanical relays:

The term "solid-state" became popular at the beginning of the semiconductor era in the 1960s to distinguish this new technology based on the transistor, in which the electronic action of devices occurred in a solid state, from previous electronic equipment that used vacuum tubes, in which the electronic action occurred in a gaseous state

>> No.2566058

>>2566045
Exactly, it can make things weird or confusing sometimes, especially if you're new to the subject.
Happens in every industry I'm sure.

Also makes me think of boats, where every term is some fucking archaic mispronunciation of 1400s English and Dutch sailing terminology.
"as we tack against the port-bow, the sheet taught and the jib furled, whilst the crew belays the main brace and tends the leeward rail."

>> No.2566060

>>2566057
>"solid-state" became popular at the beginning of the semiconductor era in the 1960s to distinguish this new technology based on the transistor, in which the electronic action of devices occurred in a solid state, from previous electronic equipment that used vacuum tubes
Here I'll copy-paste from the same Wikipedia article:
>The term is also used as an adjective for devices in which semiconductor electronics that have no moving parts replace devices with moving parts, such as the solid-state relay in which transistor switches are used in place of a moving-arm electromechanical relay, or the solid-state drive (SSD) a type of semiconductor memory used in computers to replace hard disk drives, which store data on a rotating disk

Keep going, the pedant in me has a pedantry boner.

>> No.2566069

>>2566057
>you keep saying solid state reed switch. stop. now.
Sorry, the manufacturers do it too when they sell hall-effect switches meant to replace existing reed switches.
They call them "solid state reed switches," and refer to them as reed switches in their own diagrams.
If you don't like it, let them know: https://www.smc.eu/en-eu/contact-us

>> No.2566098

>>2566057
>>2566060
the only modern requirement for a solid-state device is, no moving parts and no fluids. The only mass that moves ever are the electrons.

the term solid-state is also used a lot to distinguish things from older models which were not that way. For example no one says solid-state transistor, even though every one is. They might say solid-state amplifier though

>> No.2566200

>>2566098
>no moving parts and no fluids.
>The only mass that moves ever are the electrons
But that applies to vacuum tubes too. People still make VFDs and CRTs for some uses, so I wouldn't exclude these from being modern.

>For example no one says solid-state transistor
But they would say "solid-state triode". It's just a matter of which terms are holdovers from the days of non-semiconductor electrical components.

>> No.2566541
File: 398 KB, 960x1280, 1572115575408.jpg [View same] [iqdb] [saucenao] [google]
2566541

>>2565989
>>2566011
I ordered the WRONG FUCKING ONES AGAIN!
IT SAID IT WAS A SENSOR

>> No.2566593

>>2566541
they are both sensors. It's just that one is Analog and the other digital. make sure part says Analog (and not digital or "switch" either)

>> No.2566594

>>2566541
Which ones did you order?

>> No.2566600

I like digital solid state reed switches. You can even operate them with 2 wires. I tried classic, glass tube ones before, but must have exceeded some maximum ratings, and either welded them shut, or magnetized them.

>> No.2566613

>>2566541
why arent you doing a parametric search on digikey or similar to find the correct part in stock and reading the datasheet to confirm. then if you need it cheap, search exactly the part number on aliexpress. or hell, those things are so fucking cheap anyway, buy it from an authorised distributor. fuck man this is like electronics 101 - how to search and buy the correct part. im not even sympathetic, your entire story is just retarded and bordering on fake and gay

>> No.2566789

>>2566613
> why not digikey
You’ll never use 20 of them in your life.
With all the fake components out there, if you’re starting out, get real parts and save the hassle.
You probably don’t need to give the ccp any more money. Plus, I wouldn’t be shocked if it turnes out stuff like esp32s have remote kill switches on them (that could be triggered from a ballon)
We’re still angry about the FTDI bricking incident.

>> No.2566796

>>2566789
>I wouldn’t be shocked if it turnes out stuff like esp32s have remote kill switches on them (that could be triggered from a ballon)
You could have that in much more important chips.
>We’re still angry about the FTDI bricking incident.
But FTDI is European.

>> No.2566799

>>2566796
> FTDI == eurobeans
Yeah, but they bricked them because of the fake chinese clones. Bad decision, sure.
but now private companies cant fly anything in north american skies because it will get shot outta the air.
It’s all about who caused the underlying issue and who you least upset about.

>> No.2566827
File: 20 KB, 600x450, 1-317990687-wio-e5-wireless-module-_bulk_-for-long-range-application-45font.jpg [View same] [iqdb] [saucenao] [google]
2566827

I am too lazy to do the research myself, and I probably will buy an iphone for air tags, but if anyone knows anything about the IoT lora network, I only watched half a video, and stopped on the part where you need a "thethingsnetwork" account.
But my question for anyone who knows about the lora network, or better alternatives, can I combine this with GPS and create my own airtag for free?
I just don't want my ebike to get stolen (and people stealing them get get alerted by airtags, but it still does it's job well enough), and I feel like there is going to be some sort of cost or some problem I can't see due to not doing enough research, and one of you guys already know better.

>> No.2567000

>>2566827
better of using a cellular module with gps embedded on it. that way you dont have to be in range of lora gateways, only mobile towers which are more far reaching should some nog take it for a ride in the middle of bumfuck no where

>> No.2567010

Anyone know why devboards powered by c-port, with serial on c-port, programmed over c-port, can't fucking host a single peripheral or hub on c-port?

>> No.2567019

>>2567010
It's a cent or two cheaper.

>> No.2567024

>>2567010
Because USB-C is so complicated that manufacturers never get it right. So far, at least.
https://hackaday.com/2023/02/07/all-about-usb-c-manufacturer-sins/

>> No.2567029

>>2567010
ESP32-S2/S3
Power with C-Port, Serial with C-Port, Programmed over C-Port, USB Slave and Host.
It's USB1.1, but it works.

>> No.2567031

>>2567029
I use this, but it can't power anything really, and 1.1 isn't supported by even the oldest stuff I can find, except keyboards (which it can't power)

>> No.2567033

>>2567031
also I've tried using a hub with its own power supply (input from a PD wallwart, separate from the data unput), it still doesn't see the hub or anything plugged into it.

>> No.2567049

>>2567000
I think I might consider just getting a invoxia LongFi which is 1/4th per year cost of invoxia price of going cellular.
But if I can find a cheap used iphone I would go for airtags.

>> No.2567105

>>2566789
don't esp32s have an analog hall sensor inside them?

>> No.2567163

Why is there nothing closed up and "safe" to switch mains power on and off with a low voltage input? While I'm pretty sure that I could built it myself using relays, I want something pre-built and foolproof, so nobody can sue me if it catches fire or electrocutes somebody. All I see are "smart" wifi wall plugs for consumer, and expensive boxes with ethernet for professional use.

>> No.2567214

>>2567163
because to get it "safe" you have to jump through a million hoops and waste thousands of dollars on certification. also, each country has its own regulation thay you conform to, so multiply that out by each continent

>> No.2567216

>>2567163
edit to
>>2567214
if its "safe" it shouldnt be catching fire or electrocuting anyone. it should have circuit protection to prevent that. in any case, id be using SSRs not mechanical relays for this. also, people will sue you into the ground anyway

>> No.2567379
File: 217 KB, 640x419, 1639336095195.jpg [View same] [iqdb] [saucenao] [google]
2567379

>>2557052
Throwing together something larger, a controller for escape rooms and I want a small discussion about what chip to get. >What would you use, why?
I was thinking something ARM, but I'm not sure.
Requirements as what I need to be able to do with it:
>Ethernet/RJ-45 (as a way to communicate with a server so the GameMasters can interact with the room)
>HDMI out, maybe multiple (to display information on a screen or similar)
>AUX out (so we have audio in the room. I know, not the best solution, it is what it is, I'm working with what I got)
>AUX in (we have multiple mics in the room that get pooled into a single AUX that I want to send over Ethernet to the server so we can listen in on multiple locations)
>SD-Card / M.2 SSD (to play the audios and videos off of it)
>Lots and lots of GPIO pins like an Arduino Mega or similar (need pins that can go high to switch mosfets and read voltages)
>Doesn't break from sudden power losses (room is shut down after closing hours by pulling the breaker, I don't want something that needs a complex shutdown sequence like a windows machine, no power, no problem)
>Optional: Passive cooling if any (thing is sitting inside an airtight, fireproof box on a wall, but not having it isn't a dealbreaker)

>> No.2567384

>>2567379
Will chad use the vaseline on his cock and fuck my ass?

>> No.2567387

>>2567384
No, you just hold the camera while Chad goes at the cryptid.

>> No.2567390
File: 117 KB, 600x450, sneed_studio.png [View same] [iqdb] [saucenao] [google]
2567390

>>2566827

>> No.2567547
File: 78 KB, 1203x472, arm mcu boards.png [View same] [iqdb] [saucenao] [google]
2567547

>>2562384
>>2562386
I got one of these GHI arm boards. So far it's been very nice to code with. It's all done in C# using visual studio and looks to be very well put together

>> No.2567548

>>2567379
Sounds like you want a laptop with a controller connected over USB or wifi for the GPIO's

>> No.2567566

>>2567548
No. No, I absolutely do NOT want that. Because that's what he have right now and I'm going to snap if I have to redeploy laptops for the rooms.

>> No.2567576

>>2567379
>all those peripherals
Just pick something high level/expensive like RPI.

>> No.2567579

>>2567566
Switch to desktops.

>> No.2567598

>>2567379
sounds like you want a micro-processor not a micro-controller

>> No.2567599

Has anyone been able to use nodered to upload code (bin) to an esp?

>> No.2567616

>>2567579
That's the plan, but you cannot have 40+ pins that switch mosfets or read voltages reach from an ASUS ROG Mainbord in the control room 200ft to the escape room, that's retarded. You need an intermediary per room that controls the room and talks to the single desktop that serves as the server.
>>2567576
RPi has not enough GPIO.
>>2567598
Yeah, looking at the Cortex R52 rn. Thanks Anon.

>> No.2567619

>>2567616
If that's not enough GPIO, you probably need to get dirty, and add some GPIO "extender" chips (that just means you add a chip that can do GPIO over I2C or SPI).

>> No.2567623
File: 49 KB, 600x500, esp32_d1_mini.jpg [View same] [iqdb] [saucenao] [google]
2567623

The perfect general-purpose compact microcontroller doesn't exi ---

>> No.2567625

>>2567379
You just described a raspberry pi with a battery backup power supply

>> No.2567627

>>2567623
Does it have USB3?

>> No.2567639

>>2567619
Noted. But is that going to run for years on end with no maintenance whatsoever, without dying on me?
>>2567625
I think I didn't state it clear enough, the system can shut down, that's not the issue, I don't need an UPS.
I just want it to not take issue in being killed, similar to a microcontroller doesn't give a fuck if you pull the plug and juice it up again.
My 3D Printer comes to mind, it does have an ARM Chip (think some ancient V2) and doesn't give a fuck when I pull the plug on it and boots in like 2 seconds.
On the other hand, my PC would go into absolute meltdown mode if I were to just kill the power and boot it up.
I am aware that my PC runs a high-level operating system and my 3D Printer just a small firmware, but I still thought I'd add the point just in case.

>> No.2567642

>>2567639
>Noted. But is that going to run for years on end with no maintenance whatsoever, without dying on me?
I would guess that depends on whether you're always within at least the maximum ratings. My worry with as RPI would be whether the software holds up, or maybe whether the SD card dies from the continued write accesses.

>> No.2567653

>>2567623
> ESP32 is not dogshit
It still needs power.
More perfect would be one that uses PoE, then you can skip that jamable wifi/bluetooth nonsense.

ESPs are just hobbiest things on a non-standard instruction set (like, fucking, why?)… no real world stuff mcu stuff is gonna be written in python

>> No.2567660

>>2567653
Who the fuck uses python with an ESP32? It's not a Pico.
Plenty of RISC-V ESP32s if you don't like Tenselica.
There are also several ESP32 dev boards with PoE if that's how you'd like to use it.

>> No.2567662

>>2567660
> use RISC-V
Yeahbut…
Capability and speed-wise the TIE core stomps on (while simultaneously twisting and smearing) the RISC-V core.

>> No.2567668

>>2567653
>ESPs are just hobbiest things on a non-standard instruction set (like, fucking, why?)… no real world stuff mcu stuff is gonna be written in python

You clearly have some misunderstanding. I've worked on a couple dozen projects involving ESP32's and written some tens of thousands of lines of code for it and it's never been anything but C.

>> No.2567682

>>2567639
>>2567642
It seems like the SD card as your only drive is a weak link for raspberry pi longevity and reliability.
There are fairly cheap eMMC modules available to replace the microSD card though.

>> No.2567684

>>2567668
> Whuttabout C

I’m talking about some of the ESP32 boards that come with python and other such crap. I realize that, for example, someone has to compile python (written in C) to put it on the latest PyChoad offering from spunkfun.

I’ve just never heard of it being used in any products that I’m aware of, so it seem a bit like a toy.

It’s also more of a SoC class device rather than a microcontroller in my opinion (i.e ×1000 overkill).

>> No.2567702

>>2567684
>It’s also more of a SoC class device rather than a microcontroller in my opinion
>Espressif offers integrated, reliable and energy-efficient wireless SoCs, including the ESP32-S Series, ESP32-C Series, ESP32-H Series, ESP32 Series, and ESP8266 Series.
Source: espressif

>> No.2567720

>>2567163
Closest thing is a smart plug. I'd buy cheap ones if just for the housing. Shouldn't be hard to modify them to just have a 3.5mm jack or whatever as an input. I agree that such a thing should be sold on aliexpress.

>>2567684
>SoC
Doesn't that imply you run an operating system on it? While I think you can put some sort of RTOS on one, usually they're used bare-metal with C programmed directly into the adjacent flash memory chip. Same for a Pi Pico.
>×1000 overkill
Not if you need 500kB of RAM and two cores and DMA for I2S audio and short-time-fourier-transforms.

>> No.2567721

>>2567720
>Doesn't that imply you run an operating system on it?
I don't think this is necessarily true. I'd consider the hardware the deciding factor, & user could run (free)RTOS or not. imo a SoC includes everything it needs to do its 'advertised' job without any other hardware (except maybe power and some discretes, incl. antennas). And SoC, versus SoM (module) etc., would imply it's in one surface-mount package

>> No.2567757

>>2567721
In that sense, the only thing separating a halfway modern MCU from being a SoC or not would be whether it has a single intended purpose (e.g. wifi) in the first place. Heck, an ESP32 requires more external components to use (external progmem) than an AVR or PIC does. I suppose I'd consider the WROOM modules to be a "SoM" as you say, though I prefer the term System on Board.

>> No.2568630

i have a question regarding people who've built volume mixers. i'm currently building one and i want to integrate a macropad, too, but deej is only for potentiometers. do i just use autohotkey or whatever for it or would i need a separate controller for the macropad?

>> No.2568656

>>2568630
Deej doesn't support anything but potentiometers, but there are numerous other versions built by the community that do.
https://github.com/omriharel/deej/blob/master/community.md
Look at some of the examples that have buttons. You can use lots of modern MCUs as HID devices, makes a lot of things easy.

>> No.2568762

>>2568630
use digipots lmao

>> No.2568899

I have a Pi Zero, non-W, without WiFi. Can you link me to a guide on how to bootstrap a system on it just through USB? I suppose there exists something like SSH-over-USB or such.

Every guide I could find online starts with "connect to wifi" and those that acknowledge the existence of a non-W Pi Zero just go "connect a monitor and keyboard".

>> No.2569070

>>2568899
May be easier to communicate to it via serial?

>> No.2569127
File: 3.57 MB, 3428x4739, bing_ai_microcontroller_chat.png [View same] [iqdb] [saucenao] [google]
2569127

I used bing AI to give me some parts recs for a project. I'm pretty new to microcontrollers and am trying to fabricate a prop chainsaw. How do you guys think it did?
Most annoying thing for me was needing to restart the chat multiple times.

>> No.2569128

>>2569127
I should mention that I went in with some prior knowledge that I almost definitely wanted to use a brushless DC motor, but I wanted to see what the AI would recommend.

>> No.2569648

>>2569127
You don't need high power nor speed control for that. A brushed DC motor should be fine.

>> No.2569722

>>2569648
So do you think the "outrunner" type was a good rec then?

>> No.2569868

Does anyone know if it's possible to use libraries <WiFiClient.h> and <WiFiClientSecure.h> at the same time? I'm trying to setup a telegram bot, but the Secure library doeesn't seem to work with pubsubclient.

>> No.2570040

>>2569868
https://forum.arduino.cc/t/problem-with-using-pubsubclient-and-wificlientsecure/955986

>> No.2570209

I'm thinking of doing some sort of a open door detection system for my garage, initially i was thinking of having an infraredsensor just pointing at it, but i've seen those sensors used on door where you have one on the door and the other on the side of the door, is there anything like that for diy?

>> No.2570215

>>2570209
Go to a big box hardware store like Home Depot, you can find plenty of garage door sensors there.

>> No.2570232

>>2570209
Put a retroreflector on the door and put the receiver right next to the emitter

>> No.2570244

>>2570209
if youre gonna use IR, make sure you use 940nm emmiter because the sun doesnt affect that particular spectrum as much. that way your shit cam work during the day. you dont need "retroreflective surface" whede the sensor is, just something like white tape of sowe kind. depending on what the sensor is pointing at you might not need this either, as metal is very relfective anyway

>> No.2570314

>>2570244
Modulating the IR at _kHz and using a _kHz IR receiver prevents ambient light being an issue basically altogether, and increases your SNR a bunch too.

>> No.2570329

>>2570314
well for one i said "sun" not ambient light. because op was talking about a garage door which is likely to be affected by sunlight. it absolutely gigantic 850nm light intensity. so much so that even modulating a 1W 850nm IR LED has basically zero effect beyond a 10cm range. so to give op an easier time, i suggested a 940nm ir because the sun has less intensity there. modulation then will give even better results than before.

>> No.2570361

Do ESP32 suffer from poor performance in apartment blocks? i.e. lots of wifi traffic?

want a couple of esp32 bulbs as well as some arduino+addressable LED set up. Was living in a detached house (share) so never really cared, but curious if I'll get a lot of interference in an apartment block which might effect home assistant stuff.

>> No.2570368

>>2570329
Isn't 950nm more common anyhow?

>>2570361
Probably not.

>> No.2570405

>>2570368
no. most sunlight (in the IR spectrum) falls in <900nm wavelengths. if by common you mean in like tv remotes and such ill say no again because 850nm ir leds are cheaper.

>> No.2570444

>>2570215
But I need to integrate it with some mcu to then transmit it over RF
>>2570244
The garage door is made of steel, I was wondering how heel it could work with IR. It
doesn't have any sun tho, the garage is completely closed.
>>2570329
There's also the distance, I would leave it on a shelf, how far can those things go? I might need 30cm or so.
>>2570232
Something like that

>> No.2570452

>>2570444
how big is the distance? a lidar will reach like 12 metres

>> No.2570459

>>2570452
Not that much, i need to measure it but shouldn't exceed 1 meter.

>> No.2570547

>>2570459
ultrasonic or or any light tof sensor would do well enough. ultrasonic does need to be pointed pretty straight at the object where as light tofs dont need to be. look on sparkfun for some ready made modules

>> No.2570565

>>2570547
>ultrasonic
I thought of it, but didn't consider due to the reasons you mentioned.

What would be the difference between using a tof and a ir?

>> No.2570856
File: 132 KB, 1088x1038, topsecretplans.jpg [View same] [iqdb] [saucenao] [google]
2570856

>>2570855
>Still trying to waste extra shit that's laying around unused. Today, an peephole camera.
>Here's yet another ESP32-CAM, with a little 1.3" 240x240 display, a USB-C port for power, a piece of copper tape as a capacitive button, and 3 magnets for easy install/removal.
>Stream's accessible via WiFi, or touching the face of it will show the feed on screen until it's been released for 10 seconds.
>It'll push 25FPS easily, but adjusted for much better quality I've dragged it all the way down to 15FPS, which is split between the screen and the stream if both are active simultaneously.

>> No.2570968

>>2570565
well normal ir (unmodulated or modulated) uses the reflection intensity as the measure of whether something is there or not. you cant really tell distance because the reflection intensity will change per material/time of day/incident angle.

light (usually ir) tofs measure the "time of flight" of the light as it bounces back and hits the receiving photodiode array some fraction of a nank second later. this means you can measure of many different surfaces at different angles and get really accurate measurements of distance. this makes it easy for things like what you want to do. but these parts are way more complex than just using an ultrasonic or ir reflection for object detection.

choice is yours m8. id give ultrasonic a go because its really cheap, easy to use and works well for anything < 2m in distance. because of how sound waves work, they can work okay when the incident angle is a bit off from 90 degrees

>> No.2571311

>>2557052
>trying out a new microcontroller family
>take a look at the example SPI code
>code about interfacing with some obscure ass chinese LCD
>a custom library to send commands to the LCD and draw the image
>using DMA, interrupts, auto CRC check, every single feature available
>complex as fuck code, can't make heads or tails
Why do they do this? I just want a simple example to send and receive a single byte
What could they possibly gain from making their examples 1500+ lines and hard to understand?

>> No.2571319

>>2571311
Link to the code? Are you an Arduino baby?

>> No.2571336

>>2571319
>Link to the code?
https://github.com/espressif/esp-idf/tree/master/examples/peripherals/spi_master/lcd

>Are you an Arduino baby?
I'm a hardware engineer by trade but I've programmed NXP LPC83X series ARM MCUs for work and played with 8051s back in the day as a hobby. I'm kinda a beginner programmer

>> No.2571348

>>2571336
spi_master_example_main.c? Initialization looks like a big mess, but it always is. The real work seems to happen in send_lines, which just starts a couple of SPI transfers (per frame setup + pixel data). Not bad, considering there's no separate LCD driver code, it just uses a generic SPI driver. I guess I would prefer an interface, which distinguishes data and commands by an extra GPIO line, which would be simpler if you need it to be simple.