[ 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: 1.36 MB, 1200x1200, 64034_W3.png [View same] [iqdb] [saucenao] [google]
1938160 No.1938160 [Reply] [Original]

Arduino, Teensy, Atmel, ESP32, FPGAs, bluepill, Raspberry... All microcontrollers welcome!
old: >>1924652

>> No.1938166

>>1938160
Waaay too soon...

>> No.1938167
File: 9 KB, 340x170, logo.png [View same] [iqdb] [saucenao] [google]
1938167

>>1938160
to be fair, you have to have a very high IQ to understand EFM32. The interrupt handler system is extremely subtle, and without a solid grasp of interrupt routines msot of the interrupts will get lost in a typical embedded developer's firmware runtime. There's also Silicon Labs scalie gecko mascot, which is deftly woven into their product line- their personal branding draws heavily from the prior work of e621.net culture, for instance. The programmers understand this stuff; they have the intellectual capacity to truly appreciate the depths of these design choices, to realise that they're not just efficient- they say something deep about MCU design. As a consequence people who dislike EFM32s truly ARE idiots- ofcourse they wouldn't appreciate, for instance, the automatic code generator in EFM32s existential IDE "Create a new MCU Project", which itself is a cryptic reference to avrdude's infamous quip "avrdude done. Thank you.". I'm smirking right now just imagining one of those frontend simpletons scratching their heads in confusion as Silicon Labs genius wit unfolds itself on their terminal screens. What fools.. how I pity them.

>> No.1938174

>>1938167
zero substatnce

>> No.1938178

I finally got my FPGA in (Basys 3 with an Artix 7). We've been doing simulated labs in my Digital Systems class, but I'll be honest, they haven't taught me anything about FPGA programming or FPGA applications. We've just been simplifying boolean algebra expressions and implementing them in verilog.
The most concrete, applicable thing we've done so far is implement a 3 bit adder, but that's it really.

With that being said, does anyone know where I can find some good introductory projects so I can actually learn verilog and the nuances and applications of FPGA programming?

>> No.1938181

>>1938178
inb4 "design your own cpu"

>> No.1938184

>>1938181
Why? Something like a simple MIPS is a genuinely useful introductory project and often used by CompEng courses.

>> No.1938197
File: 1.92 MB, 1920x1080, 1593679059973.png [View same] [iqdb] [saucenao] [google]
1938197

>>1938160
Reminder FPGA devboards that work with open stack can now be had for cheap from the usual /csg/ sites.
>iCESugar: iCE40 UP5K (project icestorm)
>Sipeed Lichee Tang Nano: GW1N-1 (project apicula)

>> No.1938199

>>1938167
µCs are easy mode.
Try FPGAs.>>1938197

>> No.1938213

i wanna take shit apart to see whats goin on in there.
are there any logic analyzers you guys would suggest? whatever i can use to turn electrical blips into binary.

>> No.1938219
File: 440 KB, 1080x2340, Screenshot_20201026-103417.png [View same] [iqdb] [saucenao] [google]
1938219

Hi guys. This thing is out of stock. What is my alternative for key controller?

>> No.1938222

Doing a M.Sc. in Data Science and Engineering, my field is machine learning and my thesis is in deep learning, however I have an interest in electronics and microprocessors/microcontrollers (have used arduinos before and now getting into STM32s and ESP32s). I took a postgrad class called embedded systems and IoT and it calls for a big ass project.
I was thinking voice or gesture recognition to control appliances, using an STM32 board to gather and preprocess the data and then that would stream (real time connection) the cleaned up data to an edge device (Raspberry Pi probably) which would run inference and send an interrupt to the node to do something (eg make me my fucking coffee or turn on the sexytime lights idk).
Anyway, I am strongly considering mbed for this, although zephyr and other frameworks seem promising as well. As I never plan to work in this field but would like to make shit on my own, is mbed better/worse than other RTOS? What's your opinion on that?

>> No.1938232

>>1938219
>considering a latency-adding dongle
>unironically

>> No.1938233

>>1938222
Wanted to clarify, I don't know mbed, so what I'm asking is should I learn that or sth else?

>> No.1938234

>>1938222
If you have some balls, consider seL4.
Else, look at nuttx.
Not a fan of mbed, personally.

>> No.1938244

>>1938234
Looked those up and they look great if you wanna do some hardcore stuff, but they seem overkill for a class project/hobbyist usage. Don't think I can learn them fast enough.

>> No.1938247

>>1938244
seL4 is indeed awesome and hardcore.
But I honestly believe NuttX should be both easier and better than mbed.

>> No.1938368

>>1938232
my job requires me to reply "wow", "yes", "clear", "good to go" every 2 mins in a zoom chat. This controller could save me from insanity.

>> No.1938373

>>1938219
>>1938368
You could use an open-source hardware keylogger like EvilCrow and adjust the firmware.
Or build one yourself with an USB HID capable dev board like the bluepill and one of those USB Host shields.

>> No.1938382

>>1938373
cool, these are what i'm looking for

>> No.1938401

>>1938373
>Or build one yourself with an USB HID capable dev board like the bluepill and one of those USB Host shields.
Just don't get one based on STM32F104. They're all using chink fakes for the CPUs.
F4, L0 and G0 recommended. Else, GD32VF104, RISC-V with STM32-like peripherals :-)

>> No.1938419

>>1938233
did you consider bare metal? do you really need an RTOS for this project? maybe just a bunch of timers etc.

>> No.1938430

>>1938419
not him but in my experience with RTOS' it is really helpful when you're working on a project and you don't know all the features you will add at the end. working with multiple sensors and real time data processing with said sensor data it gets really cumbersome to make your own state handlers what is essentially becomes an RTOS to manage all the resources effectively.
Plus process context switching in main context is god tier for managing async transfers of synchronous protocols like spi and i2c. You got a task that depends on a i2c transfer done but a uart thread needs to process data? suspend the i2c task and let the uart thread work. when i2c is done transferring, an isr resumes the i2c task and it can process the read data without sleeps.

>> No.1938433

>>1938222
I've only ever used freeRTOS since all the mcu platforms vendor code came with a port of it ready to go.
Certain RTOS' are made with certifications to be used on things like cars and planes or come with support from a company. Since you don't have those requirements just use whatever is easiest/better supported I guess.

>> No.1938519

>>1938368
I don't see why you need such a thing to be inline with another keyboard, you can't just plug it into another USB port? The hard part is being a USB host since there's so much crap to deal with even if you decide fuck hubs. But remember that more than a few keyboards have built-in hubs.
>>1938401
Isn't it the F103 that's got the fakes? Was there even an F104? Anyhow the fakes presumably got USB right or everybody would be screaming about it. I've never heard what parts of the chip are wrong in the fakes other than muh fakes reeeeee. It's also possible to read the chip ID info to look for obvious fakes, and I really should try that.
>>1938430
Yeah, an RTOS is important in a complicated project. I use mbed but I've never really gone far enough to use the MBED 5 stuff that I think has RTOS support or something. What I really want is to set up an off-line toolchain first, and the few times I tried I got nowhere.

>> No.1938544

What are the cannon books for embedded systems? Besides K&R is there a book on embedded thats got the following SICP does?

>> No.1938635

>>1938419
Did not consider it because I figured I'll need an abstraction layer to develop faster.
>>1938430
Didn't even think of this, the project requirements will likely change throughout since it's out of my field of expertise and I'll be going in blind. Also I think libraries for all the sensors come for specific frameworks.
>>1938433
Exactly what I was thinking - easier is better in this case. The professor used to work in research for ARM so mbed is what he showcased in class, but he said use whatever you want.
>>1938519
The fakes supposedly have issues with ST-Link debugging.

>> No.1938636

What's the best GNU/Linux IDE for SMT32?

>> No.1938676

>>1938636
VSCode with PlatformIO. Don't let the sweaty neckbeards convince you otherwise. I'm a professional developer (not embedded systems) and since I started using VSCode it's been a game changer.

>> No.1938678

>>1938636
>>1938676
You can also go with Vim and makefiles and compile everything from scratch so you can post here and impress other sweaty neckbeards, but know that the time spent being actually productive will be a lot smaller thhan if you used a normie IDE/editor.

>> No.1938699

>>1938676
>VSCode
>VS Code uses 13% CPU when focused and idle, draining battery. This is likely due to the blinking cursor rendering. I think CPU usage when focused-and-idle could ideally be near-0%.
https://github.com/Microsoft/vscode/issues/22900
lmao

There are a ton of choices between doing everything from the command line and using a full-featured browser instance to edit plain-text. Even fucking Eclipse is better than this shit.
Or use an actual good IDE like CLion which has PlatformIO as well plus STM32CubeMX integration.

>> No.1938720

>>1938635
>The fakes supposedly have issues with ST-Link debugging.
Not an issue if you're using an IDE like Arudino or mbed that doesn't support debugging, and not an issue with a project that's already debugged. But good to know, eventually I'll get it working, and I've got extra genuine chips from where I used to work if it becomes a problem.
>>1938699
wtf are they constantly drawing the cursor instead of only when it changes?

>> No.1938726

>>1938699
An issue that was closed in 2017, nice.
As I said, I actually use it professionally for years now and nothing comes close for me. Of course anyone is entitled to their opinions and you can use whatever you like. I agree that CLion might be better depending on the person using it.

>> No.1938754

>>1938636
Your favourite editor, together with
https://stm32-base.org/guides/setup

>> No.1938768
File: 49 KB, 160x600, 55e113e9dc52a06b4a7ec9e9d1ec6b64.jpg [View same] [iqdb] [saucenao] [google]
1938768

>>1938699
>https://github.com/Microsoft/vscode/issues/22900
>let's build our IDE in a web browser with Javascript
>it's totally cross-platform, bro!
>we can even bundle a full web browser into the app
>now we can use cool stuff like node.js
>who cares if it includes stuff 10 levels deep
>we can even use CSS to blink the text cursor, isn't that so coooooool?
>what do you mean the web browser is going nuts updating a 1fps blinking cursor at 60fps?
>it's draining your battery?
>but it works fine on my i9-9900K
>hey at least it doesn't crash!
>let's throw it over to the GPU and let it update at 60fps instead
fucking millennial coders
At least someone fixed it to blink from Javascript in the normal case.
The abnormal case is that someone thought it would be cool to have "smooth" blinking and other crazy stunt shit, and that's why it used CSS in the first place.

>> No.1938804

>>1938768
>>1938754
>>1938726
>>1938720
>>1938699
>>1938678
>>1938676
Thanks guys. I use Emacs so I just followed the official guide you linked and thins are working

>> No.1938820

>>1938768
I'm 27, use it professionally for 3 years now, and you're dumb for not understanding that something with as many drawbacks (of course a JS-based editor will draw more resources than one written in C in most cases) would have other significant advantages. Integrated terminals, the millions of extensions you can add to make developing software so much easier it's hard to describe. For example git integration and line or file history inline, shortcut for pasting currently selected text as a print statement on the next line, clip history where it remembers what you copied and you can access stuff you copied after you copy something else, the best linting I've seen (maybe intellij comes close), libraries and stuff to show documentation while hovering, ctrl-click to peek source/headers where a variable or function was named and so much more shit.
Stay mad about it using more RAM or CPU, I had it on a 2010 11" thinkpad and it worked flawlessly (using vscode, server and client open, mysql workbench, postman, chrome/firefox and some other shit), until I upgraded 4 months ago because I needed a GPU.

>> No.1938823

>>1938820
Most of these are pretty much standard features for an IDE.
Did you only use notepad before?

>> No.1938828

>>1938823
I've used most of the bigger ones, and most have a terminal (not as good as vscode with splitting etc, not at the time I switched anyway) and the code peeking, which the only IDEs that had it then were language-specific (Java, Python and C from those I tried).
I need to work using Python for ML projects, C for embedded projects, JS for work, LaTeX, markdown and all that shit for other stuff and sometimes Octave and other shit like that. VSCode is the only one that does it for me, and believe me, I fucking hate Microsoft.
As I said, not for everyone.

>> No.1938831

>>1938828
>JS for work,
No surprise there lol

>> No.1938847

>>1938831
I think being elitist about programming languages makes you seem kind of salty.
I've implemented parallel algorithms for AI using pthreads and processes in C, all the way to doing research in deep learning using python. I enjoy using JS (node/react) just as much if not more than those.
I guess if you're having fun with something you become passionate about it, so I understand where you're coming from - I used to talk shit about JS too when I was younger.

>> No.1938856

>>1938847
Dude, you're recommending web dev shit for your web dev job.
And trying to create some authority with 3 years of doing web shit and bragging about being 27 in the most boomer-heavy board on this site. Even I'm older than you even though I'm younger than a lot of users here. Get a grip.

>I've implemented parallel algorithms for AI using pthreads and processes in C, all the way to doing research in deep learning using python.
Wow you used multithreading? What a fucking genius. I know JS can't into multiple threads but is something that mundane really something to brag about?
Or using a Python AI library?

>> No.1938858

>>1938856
Never bragged, and you don't want to get my point. It's ok. I used those as examples to make a point. Don't stay salty, have a good day.

>> No.1938865

>>1938858
>and you don't want to get my point.
Now I'm curious.
What is your point except for "I'm soo old and experienced you gotta listen to me" and "u mad"?

>> No.1938870

>>1938865
Didn't say I'm experienced dude, just mentioned it because it was relevant, we're talking about a text editor and experience with a text editor is pretty relevant.
My point about the editor was that it's suitable when working with multiple languages and frameworks, and the extensions for me make it worth taking up more resources.
Then you ignored that and went for JS, and again I just made a point that I've worked and still work with multiple languages, extensively, and my experience with JS has been as good if not better. It's a great tool for some applications.
If I wanted to "create authority" I'd talk about projects and degrees, which you'll notice I didn't. I used relevant information to explain why I think a text editor is good. I even explicitly said it's not for everyone.

>> No.1938876

>>1938865
>>1938870
oh and mentioned I'm 27 'cause you called me a zoomer, not cool.

>> No.1938894

>>1938870
>we're talking about a text editor and experience with a text editor is pretty relevant.
Your experience doesn't mean anything to me. I don't know what your requirements are, I don't know what other IDEs you used. It's just a worthless "it works for me(TM)". Too many people are all too happy to use absolute garbage - just ask some Arduino IDE user.

And you act like extensions are a thing you can only have VSCode and need JS for some reason even though extensions are such a common feature for IDEs. Which makes me suspect that you never really got into any alternatives. Hell, you mentioned Vim, which has like a billions extensions.

>>1938876
I didn't call you a zoomer. One guy said something about millennials and you literally are one with 27.

>> No.1938902

>>1938894
Alright dude, whatever you say. Anyone looking for a text editor can read both sides and decide for themselves pretty easily.

>> No.1938912

>>1938876
>ctrl-F
>zoom
Literally only match was "zoom chat".

>> No.1939035

PIC seems to get shat on a lot in hobbyist circles, why exactly is that?
For background I'm looking to move on from 8 bit AVRs

>> No.1939081

>>1939035
incompetence, probably
also
>muh open source compiler

>> No.1939107

>>1939035
because it doesn't have any hobbyist dev boards or programming environments

>> No.1939137
File: 1.34 MB, 1200x800, new technique?.png [View same] [iqdb] [saucenao] [google]
1939137

>>1938160
Is this some sort of new soldering technique I have yet to be made aware of? Some IPC bullshit or something?

>> No.1939152
File: 121 KB, 620x1004, 1482289082339.jpg [View same] [iqdb] [saucenao] [google]
1939152

>>1939137
Here's how you hold the soldering iron when you do that.

>> No.1939204

Are there any PICs with multiple ADCs? I don't mean a single ADC you can multiplex to different pins and measure one at a time. I mean multiple ADC cores that can run in parallel.

>> No.1939266

1. Why are debuggers for Atmel chips so stupidly expensive? Do they not want their shit to be accessible and easy to develop for?

2. Why does nobody make clones? If someone can DIY it just like this
>https://hackaday.io/project/162372-xplained-yourself
it seems like a nobrainer for chinks to manufacture it

>> No.1939268

>>1939137
That's a photoshop smoke effect, anon.

>> No.1939433
File: 184 KB, 600x839, 4.png [View same] [iqdb] [saucenao] [google]
1939433

>>1938847
>I think being elitist about programming languages makes you seem kind of salty.

>> No.1939457

>>1939266
Marketing
IP laws
so fucking Do It.

>> No.1939555

>>1939107
To be honest, the dip chips are so simple to wire up and run you don't really need an evaluation board.

>> No.1939558

>>1939035
In my experience, I had a Pickit3 and a bunch of DIP chips (PIC16 or PIC18) and I'd just make my own boards and it was fine. I also had PIC24 on an evaluation board for a project but I ended up getting tired of it and gave it all away to my friend. I think the positives of Pickit3 and the PIC chips are that they are simple to build into a circuit (they run on 5V) and are very simple to program (as I recall, they run without any startup code). Lots of other chips need a lot of startup and don't run until you turn on a bunch of clocks/power in registers so you have to read a lot of datasheets before you can get anything to work right (you can always just copy over their example startup if you don't care about this). PICs also always had good sleep modes and low current draws in sleep mode. The downside for me was that PICs are pretty slow and low performance which doesn't matter too much when you are doing hobby stuff but sometimes I have a little math to calculate and I also got tired of having multiple chips and programmers so I just upgraded to better products. You say you are looking to move on from 8bit AVRs but Microchip PICs are 8bit too. There's not much difference in the end result. I don't get it?

>> No.1939559

>>1939035
No free decent C compiler.

AVRs exploded in popularity when GCC got AVR support - even before Arduinos (they wouldn't be possible without avr-gcc) were a thing.
Before that hobbyists accepted that they had to program their micros in assembly (or get a BASIC Stamp). Now with AVRs and all those ARM-based micros there's little reason to bother with that.

>> No.1939560

>>1939204
I've not seen an MCU with multiple ADCs ever in my career. Usually, you just concentrate on sampling multiple inputs as fast as possible. The most complicated ADC I ever used had something like 2 different bursts of inputs and you could sample one string of inputs while the second string was being processed and vice versa (you could repeatedly ping-pong between the two). The chip was TI TMS320F28335 (Delfino), it was referred to as a DSP by TI.

>> No.1939561

>>1939559
I remember using MPLAB to program my hobby C stuff about 10 years back and it was all free. I checked their website and it still says free download. Am I missing something?

>> No.1939563

Microchip's C compilers won't let you use the higher optimization settings without a paid license.

>> No.1939564

>>1939563
this was a reply to >>1939561

>> No.1939590

>>1939204
>PICs with multiple ADCs?
The PIC16LF15XX (54/59/66/67) has two separate ADC's on board that can run at the same time.
8-bit PIC quick reference: https://ww1.microchip.com/downloads/en/DeviceDoc/30010068G.pdf
16 bit PICs and dsPICs are a whole different animal: https://ww1.microchip.com/downloads/en/DeviceDoc/30010109G.pdf
Depending on your application, a dsPIC with parallel SAR conversions my be better.

>> No.1939591

>>1939035
>PIC seems to get shat on a lot in hobbyist circles, why exactly is that?

>>1939081
>incompetence
>>1939107
>it doesn't have any hobbyist dev boards or programming environments
>>1939558
>PICs are pretty slow and low performance
>>1939559
>No free decent C compiler.

That is the reason, lack of knowledge. Most people who shit on PICs are doing so from what they knew almost 10 years ago.
Microchip released the Mplab IDE a long time ago, and back around 2012 launched the Mplab X IDE with the XC8/16/32 *free* compilers. You can also get a programmer/debugger for $20, and there are multiple development boards for pretty cheap. Some even have programmers/debuggers built in.
a decade ago, PICs may not have been the best/easiest choice. Its 2020 and things are much different.

>> No.1939598

>>1939591
>back around 2012 launched the Mplab X IDE with the XC8/16/32 *free* compilers.
They are not Open Source and they are known to generate shitty code.
>PICs may not have been the best/easiest choice.
Indeed.
>Its 2020 and things are much different.
The main way in which they are different is that there's plenty of choice, and absolutely no reason to suffer PICs.
They are just a relic from another era.

>> No.1939604

>>1938178
Design your own hardware multiplier.

>> No.1939613
File: 1.93 MB, 1920x1080, 1572913410211.png [View same] [iqdb] [saucenao] [google]
1939613

>>1938178
https://www.fpga4fun.com/
https://www.nandland.com/verilog/tutorials/index.html
https://zipcpu.com/tutorial/
https://lawrie.github.io/blackicemxbook/
https://github.com/Obijuan/open-fpga-verilog-tutorial/wiki/Home_EN
Also: I advice you don't limit yourself to the Artix7 you got for class.
Here's some dirt cheap stuff you can get, I have and I recommend:
* iCESugar: Cheap iCE40 LP5K devboard
https://www.aliexpress.com/item/4001201771358.html
Works with the open stack (project icestorm).
* Tang Nano: Dirt cheap GW1N-1 devboard
https://www.aliexpress.com/item/4000366030520.html
Works with the open stack (project apicula).
And not as cheap, but still never seen before value at the price:
* ULX3S: Small yet feature-dense, ECP5 devboard.
https://ulx3s.github.io/

>> No.1939614

>>1939613
Forgot: ECP5 works with the open stack (project trellis).

>> No.1939616

>>1939613
thanks a lot for all of those links, extremely helpful.
I bought one of those iCESugar boards from ali a few weeks ago but like a retard I sent it to the wrong address and didn't notice until after it shipped. So all I have for now is that Artix7.
I don't plan on limiting myself, but is there a particular reason as to why I shouldn't be limited to the Artix7?

>> No.1939620

>>1939616
>I sent it to the wrong address and didn't notice until after it shipped.
Eek. I hope you can eventually get it.
>is there a particular reason as to why I shouldn't be limited to the Artix7?
Single family of FPGAs means bad habits forming.
Project Xray exists, but (similar to apicula, but note the Tang Nano I suggested is less than $10 and explicitly supported) it is early stages, only works with a few chips, and doesn't enable all the hard parts.
Thus, in class, you're likely using a proprietary stack from the vendor. Thus there's a huge risk of getting locked in into a fully proprietary ecosystem.

>> No.1939626

>>1939620
>there's a huge risk of getting locked in into a fully proprietary ecosystem.
*shivers*

>> No.1939630

>>1939626
>>1939620
that's what I thought. Yeah, they're making us use Xilinx's "Vivado" which is an absolute migraine unto itself.I really hope developing with FGPAs isn't as painful as their software makes it. I still don't have a single clue what anything does.

Luckily it's just being sent to my parents' house so I'll pick it up around Thanksgiving if I can't get them to just forward it to where I am now. It's a shame I can't get one from amazon. I have a gift card and wouldn't mind having two of the boards.

>> No.1939641

>>1939630
Rather than another iCESugar, grab a tang nano if you're bored. Mine arrived yesterday, it cost 6€ shipped.
I haven't yet soldered its headers or tested it, but basically, this GW1N thing is "the ch1nk iCE40".
https://cn.dl.sipeed.com/TANG/Nano/HDK/GW1N-Datasheet(English)/GW1N%20series%20of%20FPGA%20Products%20Data%20Sheet.pdf
Instead of 40nm, it uses some chinese 55nm process, and has internal flash (10-100k cycles!) for configuring the FPGA, whereas iCE40 usually have a flash chip onboard.
Else, similar amount of LUT4s and similar overall architecture.
I'm not feeling alright today (horrible dizzyness) , so I'm not up for soldering today, but I hope to try it this week.
If I manage to make it work, I'll add support to dbus_ti_link_uart_verilog.

>> No.1939786

>>1939457
Why does marketing not want their shit to be accessible and easy to develop for?
Since when did chinks care for IP laws?

>> No.1939797

>>1939786
...Atmel is doing the marketing, ding-dong. Cheap devices don't have marketing budgets.
You seem really confused, why not just build one yourself? What's the difference between buying it and building it? there's plenty of open source solns out there.

>> No.1939840

>>1939797
>...Atmel is doing the marketing, ding-dong. Cheap devices don't have marketing budgets.
There's no way the cost of marketing is what drives the price that high.
>You seem really confused, why not just build one yourself? What's the difference between buying it and building it?
I can make it myself, but why do you think anyone ever chooses to buy a basic tool instead of building it themselves?
>there's plenty of open source solns out there.
I know, I posted a link to one. Holy shit, anon, learn to read and stop posting useless replies just for the sake of feeling smug.

>> No.1939853

>>1939786
All I know is ST must be making bank by chinks keeping them from having to sell ST-links at cost. Holy shit I love their silicon, I'd never use one of those Atmel cortex M ARMs.

>> No.1939859

>>1939266 >>1939457 >>1939786 >>1939797 >>1939840
The chinks understand AVR8 is the past, and are making STM32 clones instead.
Not just fakes, but they even have their own brands like the GD32 series, with proper datasheets and where the tradeoffs are clear.
And innovation, such as GD32V, which is RISC-V based with STM32-like peripherals.

>> No.1939866

>>1939859
Similar exists for AVRs. Like the LGT8f328p which is a ATMega328p clone.

>> No.1940140

we finally touched upon modulators/demodulators and ROMS in my digital systems class
and wow, I never would have guessed FPGAs would be so theoretically straightforward to implement

>> No.1940143

>>1940140
>modulators/demodulators
uuuh... you mean multiplexors/demultiplexors?

>> No.1940145

>>1939840
due you understand marketing at all? the marketing DRIVES the price that high. If you only recouped the cost of marketing from marketing, it wouldn't be profitable to use marketing.
How much more do you need this explained? You don't seem to understand much. How about you stop complaining?

>> No.1940146

>>1940143
no I mean multiplexers and decoders, I'm retarded twice over

>> No.1940156

I bought a raspberry pi 4 recently and am interested in making an Rc Car. I want to use some extra beef and cheese motors that I can order from china like a 12v drill motor but I've been having trouble finding a controller or header to use that could support that high of amperage.

>> No.1940157

>>1940156
you'd use a motor driver like an h-bridge and supply the motor power separately.

>> No.1940422
File: 219 KB, 611x835, 1580719845206.png [View same] [iqdb] [saucenao] [google]
1940422

>>1939560
>I've not seen an MCU with multiple ADCs ever in my career.
I've used this before. 2 ADC samplers with 12 input channels shared between them

>> No.1940427

>>1940156
the motor driver at high amperage uses external fets connected to the controller chip.
>Raspberry Pi Rc Car
I can tell you're new to electronics but Raspberry Pi might not be able to do what you think it can. it's a mini SBC with linux. Motor controllers and anything realtime (linux is not realtime) is in the realm of microcontrollers.

>> No.1940429

>>1940427
A Pi should work for an RC car. The one hardware PWM it has, you use for the steering servo. And the motor's h-bridge can be done with software PWM since that doesn't need any accurate timing.

>> No.1940466

>>1940156
For what reason would anyone use a RPi for that project?

>> No.1940519

>>1940146
Generally mux/demux for short.
>>1940466
Bandwagoning.

>> No.1940530

>>1940427
you don't need realtime to drive an RC car. I've done it. You don't need the most accuarate PWM, you just need a pwm that mostly accurate. That's fine for a preemptive OS.
and you can put an rpi into realtime mode with just a config change.

>> No.1940534

>>1940530
>and you can put an rpi into realtime mode with just a config change.
Realtime mode? Can you elaborate on this?

>> No.1940566

>>1938160
>ops pic

hes dead jim

>> No.1940576

>>1940534
wait, i'm wrong, it's not directly an rpi option, it's an option on the framework we use which triggers a RT kernel build.

It can be done, but you need a kernel with RT enabled.

I'd not suggest doing this if you aren't familiar with kernel compiling, or at a minimum updating your kernel, but here's more info:
https://lemariva.com/blog/2019/09/raspberry-pi-4b-preempt-rt-kernel-419y-performance-test

>> No.1940606

>>1940576
So you just meant linux-rt?
Could have said that, instead of "RT MODE". Left me wondering if there was some function in the rpi SoC for realtime bias I'd never heard of.

>> No.1940846

>>1940606
rpi doesn't refer to the SoC.

>> No.1940847

>>1940846
What else is there which could have a RT mode?
Just asking for a friend.

>> No.1940855

>>1940847
"RT" is an OS concept.
https://en.wikipedia.org/wiki/Real-time_operating_system

>> No.1940864

>>1940855
It is also a hardware concept.
See ARM Cortex-R series for instance.
In x86, disabling SMM could be a "RT Mode" feature.
In the broadcom SoC used in the rpi, the GPU plays a huge role. A RT mode could e.g. ensure the GPU doesn't delay interrupt response, at the expense of performance.

>> No.1940872

>>1940864
I'm well aware.

>> No.1940878

>>1940872
Your "rt mode" simply threw me off big time, because of how unnatural a way to refer to PREEMPT_RT it is, I thought you must have been talking about something else actually rpi-specific.

>> No.1940882

>>1940878
Whatever

>> No.1941265

I'm learning how to actually work with FGPAs though I haven't started any of my actual signal processing classes yet.
How many PHDs do you guys think I would need to be able to implement a rudimentary SDR with an FPGA?

>> No.1941285

>>1941265
0

>> No.1941291

>>1941265
>PhD
>Piled Higher and Deeper
the more you get the less you can do
>>1941285
correct!

>> No.1941298

>>1941265
>>1941285
>>1941291
forget PhD's, even a woman can do it:
https://www.youtube.com/watch?v=50tjWLiAkKw

>> No.1941301

>>1941265
To implement SDR on FPGA is a little pointless.
You'd have to implement a DSP, and then write SDR software for it.
With an FPGA, you can implement "HDR" (hardware defined radio). Since it's a fucking FPGA.

>> No.1941311

>>1941301
I imagine that's what he meant.

But its still not quite radio since its all digital and radio is inherently analog - hardware implementation of SDR algorithms

>> No.1941314

If you want to use FPGAs for SDR, treat FPGA like a hardware accelerator. You should run SDR software ontoo of FPGA, with FPGA doing most of heavy lifting for fast computations etc.

Trying to implement everything in hardware will just give you a digital radio circuit, which will be very inflexible and defeats purpose of SDR

>> No.1941316

I just want to make something like the rtl-sdr but with done on an FPGA instead so it'll hopefully be better/not limited to the RTL's constraints since it wasn't designed to be a radio in the first place

>> No.1941317

>>1941316
there's a lot of work involved in that FYI.
You'll also have to build design to interface with dac/ADC and antennas.

Have you ever architected stuff on FPGA before?

>> No.1941319

>>1941317
I haven't, I'm completely green when it comes to FGPAs. I never figured it would be easy and I doubt I could get anything off the ground, but exploring the concepts that goes into designing these kinds of things is what's gotten me this far in other fields of electronics

>> No.1941331

>>1941316
Do you have a FPGA devboard? Which?
Do you know Verilog? VHDL?
What was the most complex digital design you made?

>> No.1941337

>>1941331
see
>>1938178
most complex thing I've done is a 3 bit adder, and an 8-to-1 multiplexer; both done in Verilog.
Let me be clear - I don't expect to be able to make this thing any time soon. I just want to get an idea of what all would go into it, so I have goals to aim for.

>> No.1941344

>>1941337
It looks like a really hard goal for a beginner.
For now, I'd focus on tutorials like suggested here >>1939613.
What I did was write dbus_ti_link_uart_verilog from first principles, which got me a lot of experience.
If you don't yet have a board, I recommend iCESugar (aliexpress muse shop), BlackICE MX and ULX3S, depending on your budget.

>> No.1941353

>>1941344
I see a github with dbus_ti_link_uart_verilog in it, and I have the exact model of ti-89 featured in the picture.
That sounds manageable and I have an FPGA on hand. Was that your own project, or is that a pretty standard beginner FPGA project?

>> No.1941371

>>1941353
My own project.
It does have some parts that are pretty standard, sometimes walked through step-by-step in tutorials:
- Clock generation.
- Serial port implementation.
- FIFO implementation backed by dual-port memory which can infer iCE40's EBRs.
But I didn't follow a tutorial for any of these, I just bruteforced my way through from first principles. Much more fun, much more rewarding, much better for learning. And watching tutorials for these after the fact allowed me to gather insights I wouldn't have if I hadn't implemented it on my own first.
I don't think the dbus (TI link physical protocol) had been done before, but it's not like I did more than a cursory search.

>> No.1941385

>>1941353
>That sounds manageable and I have an FPGA on hand
It will likely work no matter the FPGA. It really is flat verilog, and the LUT count is low.
At most, if your FPGA doesn't have much in terms of dual-port RAM and your serial-ttl adapter (built in on your devboard or otherwise) doesn't wire hardware handshake, you'll have to lower the speed a little so that the calculator is faster. 57600 is plenty slower than my TI-89, and still faster than any adapter TI ever made.
And, ahem, you'll need to patch libticables either way because *shrug*. See my readme for details.

>> No.1941438

>>1941319
To design a large project in vhdl/verilog you need to architect from top down.

Start with too level pinout and a short summary of functionality of the IP. Then one level of hierarchy down, you break it into major subblocks based on functionality, and wire up signals from top level into each of your major subblocks.

Then recursively repeat it for all of blocks until you have a fully fleshed out hierarchy planned.

Individual RTL modules should be short enough, you don't want to create any large spaghetti modules, they're very difficult to maintain and debug.

Also don't write any code until you have full architecture done.

>> No.1941443

>>1941353
If you try it, let me know.
I'm yet to hear about anybody doing so. Having one of these calcs, a FPGA and a clue is a very small niche.

>> No.1942099

Was disappointed to find out that my Nano Every with its fancy new 4809 can't generate phase shifted PWM signals without some kind of hack. Can any of the cheap STM boards do that in hardware?

>> No.1942124
File: 61 KB, 810x710, 5-phase_buck_interleaved.png [View same] [iqdb] [saucenao] [google]
1942124

>>1942099
Yes. Look for STM32 with HRTIM timers
Without HRTIM you can do it with setting up master/slave timers but generally not worth the hassle to do only in hardware so combine with some minor interrupt routine adjustments

>> No.1942135

>>1938178
I've thought about taking the open source plans from ettus and trying to build an sdr around the ad9364 using the fpga to control it. I never have time to do anything though.

>> No.1942139
File: 2.79 MB, 1920x1080, 1585961873555.png [View same] [iqdb] [saucenao] [google]
1942139

>>1942099
>Nano Every
>avrmega 0
AVR8 stuff isn't competitive in performance or power efficiency, and is excessively overpriced.
It looks like you're stuck in the Arduino ecosystem, which you've already outgrown.
I'd suggest moving on to stm32.
https://stm32-base.org/guides/getting-started
G0, L0, F4 or F7.
Avoid F1 as those are deprecated and their popularity is exploited by abundant lower-quality fakes.
You should be able to grab devboards for the good, newish families mentioned above for next to nothing @ aliexpress.
There's also GD32V, by gigadevice of GD32 fame (those were stm32-compatible chips that did not pretend to be stm32). Basically, it's stm32 peripherals but RISC-V CPU. Cool stuff, also dirt cheap.

>> No.1942156

>>1942139
wow, you didn't even answer the question.

>> No.1942159

>>1942156
Anon at >>1942124 told you about HRTIM already.
But I forgot to link you this: https://www.st.com/en/development-tools/st-mcu-finder.html
That should help you narrow the list.

>> No.1942170

>>1942099
It's not the "board" that does it, it's the chip, and particularly the features of its timer units. Chip manufacturers usually make a wide range of chips with more or less features so you can save money in a Q10K+ quantity product.
Back in the good old days, Arduinos had a socketed chip; if you wanted a better one you could just drop it in. Or you could take out the chip and drop it into your project without the rest of the Arduino hardware. Then the chips had too many pins for DIP, and boards started having soldered LQFP chips. (except for the occasional TI MSP-430 board with a ZIF socket)

>> No.1942175

>>1942159
>>1942139
that guy wasn't me >>1942156
thanks for the advice Elaina-sama

>>1942170
I know, the point was that right now, I would prefer to buy a board with a chip that has the capabilities I want

>>1942124
cool, thanks

>> No.1942192

why do CS people have such a hard time with comprehending HDLs

>> No.1942193

>>1942192
theirs is an inferior strain of autism

>> No.1942222

>>1942192
Different paradigm - they don't understand true concurrency

>> No.1942256

>>1942222
here, CS folks done understand they only care about order, not time. They THINK they care about time, but they never actual deal with time, only the number of operations and their order.

>> No.1942607
File: 3.55 MB, 4608x3456, IMG_20201101_101908.jpg [View same] [iqdb] [saucenao] [google]
1942607

My first PCB design, guess what it is.

>> No.1942614

>>1942607
nipple electrostimulation controller?

>> No.1942821
File: 717 KB, 723x806, Screenshot 2020-11-01 124653.png [View same] [iqdb] [saucenao] [google]
1942821

Any recommendations on circuit analysis textbooks? (Other than Fundamentals of Electric Circuits by Alexander and Sadiku because their first chapter was so confusing that I actually couldn't understand it).

>> No.1942829

>>1942821
I found a circuit textbook on ebay, "Fundamentals of Analog Circuits" by Floyd and Buchla. I bought it for shits and giggles because it was only $5, but it's actually a really solid book that isn't overwhelming for a beginner.
I'd recommend it, especially for the price.

>> No.1942831

>>1942821

Digital Design and Computer Architecture is really good for the digital stuff and has side by side VHDL and Verilog examples.

https://www.amazon.com/Digital-Design-Computer-Architecture-Harris/dp/0123944244

Computer Organization and Design is my also really popular
https://www.amazon.com/Computer-Organization-Design-MIPS-Architecture/dp/0124077269

>> No.1943063

>>1942192
HDLs are fundamentally different than programming languages, I wouldn’t expect CS people to know much about how digital systems are actually designed

>> No.1943083

>>1943063
>I wouldn’t expect CS people to know much about how digital systems are actually designed
CS depends on the country and university.
In mine, making a CPU was part of the curriculum. First there were subjects about physics (FETs etc), then asm with simulators in a subject, digital design (up to making an ALU) using a logic simulator in another.
Later, we made control unit, learned verilog, used an actual FPGA.
But yeah, some universities are absolute shit. I've worked with graduates who didn't learn c, asm, osdev, much less how a CPU works. Apparently they did "webshit stuff, that is what matters these days."

>> No.1944009

Do dip memory ICs exist anymore? Like RAM chips that are through hole like the 7400 series? Like I want to do something with the arduino that I read vaules from external memory chips...not like in an SD card.

I've even thought about magnetic tape memory using a regular casset player like how those texas instrument computers from the 80s worked.

Like I wanna take a shot at a hand built memory but that looks like a job for tiny hands.

>> No.1944013

>>1938197
So with FPGA boards...I watched some youtuber called electroNOOBS go over what they were and my understanding of them was just seeing them mentioned in DIY in a sperate thread and all I knew was they were used in the DreamCast.

So after the video explained that FPGAs are basically just programmable mosfets that you can create any kind of logic circuit in Ihad thought Could you then take some kind of xray of the Fpga chip and have some company make a dedicated chip out of that program design? Like that doesn't seem to me possible.

>> No.1944038

>>1944013
not necessarily mosfets. While the underlying circuitry is built on mosfets, the true "unit" of the FPGA is something called a "programmable logic array". Essentially, if you have a bunch of AND gates and a bunch of OR gates, and some way to dynamically connect them together (a programmable logic array), you can create any arbitrary boolean logic function (digital circuit).

So, if you get a bunch of *those* and stick them together, you have an FPGA.

then, what's actually written to the FPGA is based on something called an HDL, a Hardware Description Language. Now, the HDL doesn't care where it's going. You can write the "program" to an FPGA, or you can send out your HDL "program" to some chip manufacturer to have it made into a dedicated chip

>> No.1944047

>>1942607
its a caculater....

>> No.1944057

>>1942607
I just lost NNN because if this imagine thanks...asshole.

>> No.1944072

>>1944009
How much memory do you need?
DIP EEPROM chips are common.

>> No.1944084

>>1942821
I dont have it front of me but there's a text book that has an astronaught on the front cover is a good one.

>> No.1944085

>>1944072
I dunno I was gonna see how far I could strerch 16kilo bytes

>> No.1944087

>>1944085
EEPROMs would work then. 128kbit (=16KB) are common.

>> No.1944104

>>1944087
Arent EEPROMS one time use? Are these the ICs that have the glass window on them?

>> No.1944106

>>1944104
Those are EPROM as in Erasable PROM, who need to be exposed to UV light to be erased.
EEPROM are Electrically Erasable PROMs and can be erased without the use of UV light so they don't need a window.

Both can be erased and rewritten many times.

>> No.1944108

>>1944106
Do they even make the window type anymore? Last time I saw them was in my colleges eletrical/electronics lab.

>> No.1944109

Has anyone conceptualized a LoRa based chan system? Techincally how much data minimally do you need to Tx to make LoRa chan?

>> No.1944112

>>1944108
Don't think so. Last I've seen them in use where the BIOS ROMs for 486s.

>> No.1944127

>>1944085
Just 16k? SRAM chips tend to come in powers of 4, so they go 2K/8K/32K/128K, and you can get the smaller sizes in narrow DIP. But after 128K they mostly went to smaller packaging.
Do you really need the parallel bits broken out for some reason? SPI SRAM goes up to at least 128K bytes in DIP-8 and only needs 3 signals.
https://www.microchip.com/design-centers/memory/serial-sram-serial-nvsram
Or you could just get a CPU with more RAM. A blue pill has 20K of RAM built in, and that's not even a big chip. Bigger Cortex M chips will have at least 64K.
>>1944108
The window shit is annoying as fuck, now that EEPROM and Flash technology have gone off-patent there's no reason to use anything else. If you're messing with old stuff you still need them, but a 28C64 is under-rated for retro stuff. But they've stopped using DIP for new stuff too.
>>1944112
After a while when they stopped needing to patch stuff, so they switched to EPROM with no window because it was a lot cheaper for production stuff. Same silicon, just no window to erase it.

>> No.1944129

>>1944009
you could always just do an smd-to-DIP breakout board if need be

>> No.1944133

>>1944129
You can get the boards from fucking Amazon even.

>> No.1944135

>>1944133
they only provide a limited selection of footprints. I couldn't find an SMD-dip breakout board for a lot of the TSSOP SDRAM chips.

>> No.1944138

>>1944135
TSSOP is hard to solder with an iron, but more importantly it's a fucking lot of pins to break out that take up edge space on the breakout board, and there may be signal quality/trace length issues from breaking them out like that too. And there's worse stuff, I wouldn't want to do QFN or BGA by hand ever.

>> No.1944145

>>1944038
Most FPGAs aren’t made like this anymore. Generally each block of logic consists of an LUT (implemented using SRAM), a flip flop, and a mux to select the out our either straight from the LUT or from the flip flop for sequential designs. The LUTs are loaded with the logic table of whatever function the user is trying to design, and as you said individual logic blocks are connected. There are also other more “coarse grained” components in FPGAs such as blocks of RAM, multipliers, I/O, serial communication, DSP units, and more.

>> No.1944163
File: 1.69 MB, 1920x1080, 1579726851136.png [View same] [iqdb] [saucenao] [google]
1944163

>>1944013
FPGA are often thought about as a bunch of flipflops and logic gates interconnected in a way that's configurable. In reality, logic gates aren't accessable. Instead, there's "logic blocks" made of LUTs (look up tables), with typically 4 inputs, and a flipflop that can be bypassed between LUT and output.
The logic block's configuration (truth table, flipflop initial value, whether to bypass it) and the interconnects between blocks (logic blocks, I/O ports, embedded memories, clocks...) are what's "programmed" into the chip.
This "programming" depends on the chip design. On some chips it is SRAM, and needs to be done in power-on, on some other chips it is "flash", and thus the design is immediately available on power on.
While at the start, in the 80s, it was sometimes done that way, nobody designs the FPGA configuration directly. Instead, what is done is writing your design in an HDL. The most common are Verilog and VHDL.
Then a synthesis tool turns the HDL into something much simpler, similar to how a compiler turns c code into assembler. The primary open stack tool for synthesis is Yosys.
This simpler hardware description or netlist then goes through placing and routing, which is very specific to the target chip, which can be an FPGA or an ASIC. The primary open stack tool for PNR is openpnr. This is basically a process of allocating physical logic blocks to what's described in the netlist, considering the constraints of the hardware. For FPGAs, this includes where blocks and wires are physically placed. For ASICs, it's more like what constraints the fabrication process imposes to where they can be physically placed.
To answer your question: Yes, the same HDL can be programmed into FPGAs or made into ASICs. No, it doesn't work by taking an xray of the FPGA, but the process I described above.
If you want to learn more about FPGAs, your best bet would be to grab a iCESugar from Aliexpress (cheap!) and/or an ULX3S from elsewhere (powerful! featureful!).

>> No.1944230

How many 4-input look up tables would, say, an 8- or 16-bit adder consume? multiplier? Is there a reference that lists the footprints of common logic units?

>> No.1944257

>>1944129
>>1944127

I have thought taking some spare Ram sticks and seeing if I could work with but seeing how small a simple arduino program is and the fact that the lunar module used iron core (hand wound) ROM memory and was 14 bytes if I remeber that correctly...so I wonder what in the hell and how long would it take to make a good use of just 1mB of data?

>> No.1944269

>>1944257
>the lunar module used iron core (hand wound) ROM memory and was 14 bytes

Yes, that 14 bytes did most of the control during approach and landing, and then redevous and docking, with the astronaut doing some of the work as well. Amazing how much code you could pack into a byte back then.

>> No.1944271

>>1944257
>Ram sticks
Dynamic RAM is much harder to use. You don't even know what refresh means, do you?

>> No.1944273

>>1944271
Well in some video I saw about how ram is ultimately a bank of capacitors that are slowly draining you have "refresh" or top up on the electrons...that was a computerphile video I believe.

>> No.1944332
File: 1.51 MB, 1920x1080, 1601989412804.png [View same] [iqdb] [saucenao] [google]
1944332

>>1944230
>adders using luts
I didn''t mention, but LBs do support carry logic between luts.
You might enjoy this:
https://www.coursera.org/lecture/intro-fpga-design-embedded-systems/5-luts-for-logic-design-0AV8f

>> No.1944339

Has anyone used ESP8266 or ESP32 in the AT mode? These chips are so weird, they are fully fledged micros but I don't feel like switching to a different exotic platform just to use WIFI. I want to connect to it via serial port from my code that runs on STM32. So I was wondering if that was a common approach. I looked at some Arduino projects just as an example and found some Arduino library for esp8266 which I thought would be some wrappers around the AT commands. But the code is actually a wrapper around the espressif SDK so it is compiled and flashed and runs directly on esp8266, not what I need.

>> No.1944357

>>1944257
>14 bytes
no

>> No.1944391
File: 52 KB, 354x272, 90005Kit[1].jpg [View same] [iqdb] [saucenao] [google]
1944391

Just started a microcontrollers class and we've been using these to learn. I've done some projects on arduino too, but it's always been a step-by-step guide.

Are there any microcontroller projects or books I could look into to understand real-world applications of microcontrollers? I think they're really cool but I don't see how I can make money with it.

>> No.1944435
File: 6 KB, 263x191, rsl10.jpg [View same] [iqdb] [saucenao] [google]
1944435

>>1944391
motorized dildo with a bluetooth MCU inside. the MCU advertises itself as a "speaker", but really just does an FFT over the incoming audio stream, and uses the low/high/whatever frequencies to drive the motor.

RSL10 should be a good candidate: https://www.onsemi.com/products/connectivity/wireless-rf-transceivers/rsl10

Would be a big hit in the sissy hipno market. Remember, you didn't get this idea from me.

>> No.1944519

hey since the ohm thread seems dead at almost 9 days and it hasnt switched over to a new thread can i ask a question ?

why are diodes restricting voltage in some circuits? not the volt drop it seems they are acting like a voltage regulator. why make voltage regulators if you just need it to pass through a diode to break the electricity in the circuit so that it only reaches the voltage needed to pass the resistance ? so passive draw no longer applies in these cases. a 3.7 lithuim ion cell that can do many amps and kill a led easy no longer threatens to kill the led and instead you get both a volt drop to the minimum threshold and a current decrease to what is needed to cross the circuit.

why bother with shunts or voltage regulators. why by over voltage protection circuits/ how does audrino stay in business if i only need 1 generic 1n4007 diode 1kv 1amp

>> No.1944546

>>1944391
What degree are you taking to get a course that offers course with something running basic code...I feel cheated slightly now.

>> No.1944551

>>1944519

I will take a shot at answering this.

Yes. you are correct that they seem like voltage regulators hence why you could typically use one as a crude voltage reference signal. Thing is power dissipation in a silicon package.

You understand what the diode symbol on the mutlimeter does right. It tells you if the diode junction is brunt out but it also can tell you what the actual voltage drop is rather than the standard 0.7v.

Whats confusing is your saying restricting voltage in some circuits..what circuit do you see this in?

>> No.1944552
File: 408 KB, 624x345, 1596161530844.gif [View same] [iqdb] [saucenao] [google]
1944552

>>1944546
Really... Basic Stamp was the shit before Arduino, long before microcontrollers had erasable flash memory. I got one cheap when Radio Shack closed out, I wonder how old the dust on it was.

>> No.1944554

>>1944546
telecomms technician, I've been enjoying it.

>> No.1944619

>>1944435
Not that anon, but cool idea. I salute your creativity.

>> No.1944622
File: 10 KB, 225x225, 876458764865487r76576.jpg [View same] [iqdb] [saucenao] [google]
1944622

i need help anon. I designed a simple sound amp for the tpa2005. I followed the datasheet and for some reason I am unable to get the sound to output. Sound goes all the way in , attenuated to spec but no sound whatsoever. any help would be greatly appreciated

>> No.1944625

>>1944435
Not too sure about this but I'll try to learn something from your advice, and the RSL10 is really cool so I appreciate telling me about it.

>> No.1944709

>>1944622
post the circuit that you made
as in the actual board

>> No.1944746

>>1944622
Have you checked that anything is coming out on the output pins?

>> No.1944807

Been playing around with STM32s with USB capabilities but want to expand a bit with PC <-> STM32 communications
Does anyone have any suggestions or example projects?

At the moment it seems like for custom PC software I need either libusb or winusb so I can implement custom class (fuck me if i'm using virtual com)
But so far haven't managed to find any projects for reference.

>> No.1945129

>>1944807
>fuck me if i'm using virtual com
what's wrong with a virtual com device.
USB bytes are bytes. it doesn't matter how you get them, COM, HID, or read the raw packets and parse it yourself.

>> No.1945203

I want to connect a bunch of rotary encoders to a slave mcu. I've used them before but never more than one. If It's a slave MCU solely deticated to monitoring their output, do I still need to hook them up to interrupt pins? Also, can I get away with using the same clock signal for all of them?

>> No.1945216

>>1942099
Buy a Bluepill STM32. Also a cheap STLink dongle off Amazon. They're pretty powerful and work with the Arduino IDE with STM32Duino.

>> No.1945223
File: 1.41 MB, 2560x1920, 20200927_233701.jpg [View same] [iqdb] [saucenao] [google]
1945223

Rate my code
https://github.com/Zipdox/STM32_Interrupter/

>> No.1945237

>>1945129
nothing wrong with vcom
But reading up some resources it implicates that data rate is somewhat limited
Further reading it looks like libusb might possibly be usable with higher data rates when using standard usb drivers

Essentially I'm trying to achieve about 10Mb/s speed from STM32 to PC as well learn some more about PC usb interface
Worst case I'll just process data on STM32 and send later to PC

>>1945203
By saying rotary encoders do you mean incremental encoders?

>> No.1945244

>>1945237
Incremental, yes.

>> No.1945298

>>1945244
then no issues.
You can set GPIO to input mode and just check logic level, interrupt pins are not required.
With interrupts you can simply implement some debounce time and easier check for leading contact so you know direction.
With regular inputs you have to check often enough to make sure you do not miss start/end of encoder switching

As for
>Also, can I get away with using the same clock signal for all of them?
Not sure what you mean by clock. If you mean connecting all encoders to same pins - then no, you can't. You would need to create matrix so you could multiplex and check each rotary encoder.
But definitely fun project
>keeping track of each rotary encoder

>> No.1945317

>>1945298
>clock signal
For a second, I forgot that the square wave signal was made by the contacts and the rotating band and though it was an external clock signal.

Now that I think about it, I'll probably try using two shift registers.

>> No.1945330
File: 83 KB, 600x585, lewd.jpg [View same] [iqdb] [saucenao] [google]
1945330

>>1945317
>cock signal

>> No.1945363

>>1945330
Speaking of which; I'm having trouble finding a bidirectional counter with decoded outputs. Would the speed loss be negligible if I use a shift register instead?

>> No.1945379

>>1945223
It looks like it's about time for you to get:
- Rolls of wire.
- FR-4 prototype boards.
- Soldering iron.

>> No.1945590

>>1944552
Deal is my dad used to fuck around with BASIC coding on the texas instruments computer they had in the 80s..i understand that if you couldnt encode to cassette the program was one time.

>> No.1945671

>>1944552
I used avrs and pics before the arduino, heard about the basic stamp but never touched one.
I was wondering how micro devs worked in the 80s/90s and according to "the art of electronics 2nd ed." they used external SRAM. Makes sense!

>> No.1945740

>>1945379
It's still WIP. I have all of that, I will make a board later.

>> No.1945767
File: 510 KB, 1000x1000, Basic Stamp.png [View same] [iqdb] [saucenao] [google]
1945767

>>1944552
>>1945671
Parallax's Basic Stamp is literally a PIC with external components. Your code would go on an EEPROM on the board and the PIC would load the program to run.
Pic related: the PIC16F57

>> No.1945904
File: 417 KB, 1597x1873, eagleboard.ga_5741 (1).jpg [View same] [iqdb] [saucenao] [google]
1945904

23 grams of lead-free 95/5 tin-antimony solder
69 grams of leaded 50/50 solder.

>> No.1945907
File: 753 KB, 1556x1993, eagleboard.ga_5742.jpg [View same] [iqdb] [saucenao] [google]
1945907

Some plywood-beercan-torch magic

>> No.1945909
File: 364 KB, 1351x1723, eagleboard.ga_5743.jpg [View same] [iqdb] [saucenao] [google]
1945909

A bit of cutting action, and there we go, a fantastic solder:
61% tin, 37% lead, 1% antimony. Melts at 189C, solidifies at 183C.
Better than melting at 240C (95/5) or 216C (50/50) while being more stronger than both of those.

Fuck asian solder jew, I made it from locally made solder, and shit is good, and like 3 times cheaper.

>> No.1946798

How is the open source scene in FPGAs?

From what little I've looked at it seems like quite a bit of vendor lock-in with Xilinx and Intel/Altera and other companies in the space.

The iCEBreaker stuff is only a few years old but is it having an impact?

>> No.1946812

>>1946798
Status:
iCE40 is VERY good. HX/LP/UP well supported. Other subfamilies aren't yet.
ECP5 is good.
Xilinx family 7 is experimental but usable if you build relevant branches of yosys/nextpnr and use specific supported chips.
GW1N (project apicula) is early stages, but logic blocks, global buffers and i/os work. Just a mess to get running, and not ready for serious use.
If you want to play with this stuff, get an iCESugar @ aliexpress 11.11 sale. Best iCE40 bang/buck, with UP5K chip, which is the fanciest/newest iCE40. ~25€
Else, ULX3S is a very good ECP5 board with good support, but will cost you ~140€.
Tang Nano is ~6€ with GW1N-1, and it works (got leds blinking), but it's a clusterfuck for anybody but apicula devs at the moment.

>> No.1946829
File: 419 KB, 1079x1181, Screenshot_20201108-114652_Google.jpg [View same] [iqdb] [saucenao] [google]
1946829

>>1939152
Additionally you can use hotair to remove parts

>> No.1946854

Need a sanity check for my code (Arduino Pro Mini @ 16MHz).
I think it should print 16382 but for whatever reason it atually prints 3275

void setup() {
Serial.begin(115200);

long relPosSum;
int rawPos[] = {16382, 1, 16382, 16382, 16381};
int relPosAvg;

relPosSum = 0;

for (int i = 0; i < 5; i++) {
relPosSum += ((rawPos[0] - rawPos[i] + 24576) % 16384) - 8192;
}
relPosAvg = int(relPosSum / 5);
Serial.println((rawPos[0] - relPosAvg) % 16384);
}

void loop() {
// nothing
}

>> No.1946858

>>1946854
Ya know, if you have constants like 16384 and 8192 that are important binary numbers you might should use the 0x4000 0x2000 versions so people don't have to shift gears every time.

>> No.1946860

Hmm, also protip: type the code into VC (minus the Arduino specific crap) and you can single-step debug it and examine numbers at your leisure instead of begging others to do it for you.

>> No.1946861

>>1946860
well I ran it in Processing and got 16382

>> No.1946868

>>1946854
just print data out with steps
Learn to use IFDEF for in-depth debugging purposes

>> No.1946876

>>1946861
What is the size of int?
(This is why it's maybe better to use &0x*fff for masking instead of using %)

>> No.1946880

>>1946876
16Bit for Arduino
32Bit for Processing

>> No.1946883

>>1946876
>>1946880
Well thanks rawPos[] needs to be long. I dont realy understand why though

>> No.1946885

>>1946876
>>1946880
That's why you should use fixed-width integer types like int16fast_t, etc.. Less confusion and more portability.

>> No.1947024

>>1939035


I love pics , hobbyists want the easy copy and paste, install the library route, wham bam

pic is too hard for them even thou with MCC it is real easy to setup pic's once you spend some time learning

>> No.1947084

>>1939859
>The chinks understand AVR8 is the past
AVR8 is still the king of commonly available low power draw / price per unit

>> No.1947102
File: 57 KB, 473x587, 1604422488740.jpg [View same] [iqdb] [saucenao] [google]
1947102

Gotta get a real power supply for a pi and not a cellphone charger. Learned that one the hard way.

>> No.1947118

>>1947084
It is, if you look at the size of the community around it.
It isn't, if you otherwise want a competitive microcontroller.
I use avr8 for quick hacks, since it has libraries for everything.
I use msp430 or stm32 for real projects, where I need performance, better peripherals or power efficiency.
esp32 for wireless/bluetooth.
gd32v I'm just playing with, but is seems to be a very workable stm32 alternative.

>> No.1947157

>>1946883
>I dont realy understand why though
google the valid range for an int16 type then look at your loop when i=1.
Then when you finish with that look at the difference between unsigned and signed and decide whether you need your data one or the other

>> No.1947184

What is the smallest capacitor that will give me a noticeable shock? I can't remember ever getting an electric shock and want to get a feel for it.

>> No.1947217

>>1947184
Lick a 9v battery

>> No.1947222

>>1947217
discharged ones are like fizzy candy simulators

>> No.1947243

>>1947102
Even the "good" rpi supplies aren't actually good.
There's supercap-based UPS solutions that can hold the rpi for a few seconds. These actually work wonders as a buffer for dealing with current peaks from the rpi4.

>> No.1947361

>>1947157
>google
You think some tarduino who doesn't understand bit lengths or know the difference between signed and unsigned will actually google anything other than a new library or pre-made code?

>> No.1947371

>>1947118
I never understood brand whores.
When Atmel was still independent, AVRs were the best thing in existence. Once Microchip bought them out, almost everyone dumped them and went looking for an alternative. Even though Microchip still offers all the exact same hardware and software that Atmel offered.
I've seen people throw away all of their Atmel hardware (that was purchased well before Microchip acquired them), simply because they hated Microchip.

>> No.1947372

>>1947371
That's indeed comical.
I had both avr8 and pic12/16/18 stuff to begin with.

>> No.1947483

>>1947361
It's safer dealing with commodities.

>> No.1947489

>>1947184
My computer in 90s had a huge ass 1 farade capacitor just standing there with wires open, the size of 1L bottle. When discharged with a screw driver it gave a shock alright.

>> No.1947893

>>1939560
TI's C2000 controllers can also sample both ADCs simultaneously
source: I work with them on a daily basis

>> No.1947896

>>1942607
prostate stimulator

>> No.1947899

>>1945223
>https://github.com/Zipdox/STM32_Interrupter/
bout 3.50/10

>> No.1947950

>>1945223
>Rate my code
Haven't looked closely, but it seems ok. Codebase that short, and that isn't shit, tend to look like that

>> No.1948683

>>1945223
Are there any practical benefits to using a transparent breadboard over a regular white one?

>> No.1948697
File: 6 KB, 762x139, Capture.png [View same] [iqdb] [saucenao] [google]
1948697

>>1938160
I am trying to write a shift register using C for an 8051, am a brainlet and dont want to use assembly.

I am trying to use a call variable to have a function set a series of output pins if some condition is met.

This is the output i get.

WTF?

void SHFTREG(unsigned int J)
{
unsigned int j; j=J;
{ if(j==0);
{Cbit0 = 0; Cbit1 = 0; Cbit2 = 0; Cbit3 = 0; }
if(j==1);
{Cbit0 = 1; Cbit1 = 0; Cbit2 = 0; Cbit3 = 0; }
if(j==2);
{Cbit0 = 0; Cbit1 = 1; Cbit2 = 0; Cbit3 = 0; }
if(j==3);
{Cbit0 = 1; Cbit1 = 1; Cbit2 = 0; Cbit3 = 0; }
if(j==4);
{Cbit0 = 0; Cbit1 = 0; Cbit2 = 1; Cbit3 = 0; }
if(j==5);
{Cbit0 = 1; Cbit1 = 0; Cbit2 = 1; Cbit3 = 0; }
if(j==6);
{Cbit0 = 0; Cbit1 = 1; Cbit2 = 1; Cbit3 = 0; }
if(j==7);
{Cbit0 = 1; Cbit1 = 1; Cbit2 = 1; Cbit3 = 0; }
if(j==8);
{Cbit0 = 0; Cbit1 = 0; Cbit2 = 0; Cbit3 = 1; }
if(j==9);
{Cbit0 = 1; Cbit1 = 0; Cbit2 = 0; Cbit3 = 1; }
if(j==10);
{Cbit0 = 0; Cbit1 = 1; Cbit2 = 0; Cbit3 = 1; }
if(j==11);
{Cbit0 = 1; Cbit1 = 1; Cbit2 = 0; Cbit3 = 1; }
if(j==12);
{Cbit0 = 0; Cbit1 = 0; Cbit2 = 1; Cbit3 = 1; }
if(j==13);
{Cbit0 = 1; Cbit1 = 0; Cbit2 = 1; Cbit3 = 1; }
if(j==14);
{Cbit0 = 0; Cbit1 = 1; Cbit2 = 1; Cbit3 = 1; }
if(j==15);
{Cbit0 = 1; Cbit1 = 1; Cbit2 = 1; Cbit3 = 1; }
if(j<0 || j>15);
{Cbit0 = 0; Cbit1 = 0; Cbit2 = 0; Cbit3 = 0; };
}}

//————————-
// Main Program
//————————-
void main()
{


SHFTREG(3);

}

>> No.1948724

>>1948697
1: learn how to use a damn switch statement
2: why does every if statement have a semicolon after it? That's an empty "then" part.
3: wtf are the cbit things?
4: that's not a "shift", that's splitting up the low four bits of j
5:
cbit0 = j & 1;
cbit1 = !!(j & 2);
cbit2 = !!(j & 4);
cbit3 = !!(j & 8);

>> No.1948729

>>1948724
ty;

>> No.1948730

>>1948724
1. Yes a switch satement seems good. I am a hurr-dur Matlab person that codes when i need to.
2. Fuck if I understand this syntax.
3. Cbit are the control bit pins i am using for the microcontroller to access the hardware mux.
4. I say shift register because in "idle" mode I want the thing to probe through the mux which is attached and if there is a fault from the mux output then stuff needs to be done.
5. not sure I follow.

>> No.1948732
File: 47 KB, 637x579, cirno++-1351036973002.jpg [View same] [iqdb] [saucenao] [google]
1948732

>>1948730
If you're going to program in C then you better fucking learn it.

>> No.1948864

>>1938197 >>1938160
11.11 sale, my selection. I've ordered all this shit and some more unrelated.
attiny85 devboard digispark: https://www.aliexpress.com/item/32971847940.html
atmega32u4 devboard arduino pro micro: https://www.aliexpress.com/item/32833347030.html
atmega2560 devboard arduino mega 2560 r3: https://www.aliexpress.com/item/4000946054205.html
stm32 programmer/debugger st-link v2: https://www.aliexpress.com/item/32719963657.html
stm32 STM32F401CCU6/11CEU6 devboard: https://www.aliexpress.com/item/4000103610226.html
stm32 (fake) STM32F103C8T6 devboard bluepill: https://www.aliexpress.com/item/32885663343.html
ch340g usb uart 3.3v/5v w/rtscts: https://www.aliexpress.com/item/33020575987.html
gd32v devboard longan nano: https://www.aliexpress.com/item/4000505297604.html
esp8266 devboard nodemcu v3: https://www.aliexpress.com/item/4000055280006.html
esp32-s2 devboard nanoESP32-S2: https://www.aliexpress.com/item/1005001403045642.html
esp32-s2 devboard ESP32-S2-WOOR V1.1: https://www.aliexpress.com/item/1005001562674526.html
ice40 up5k oshw FPGA devboard icesugar 1.5: https://www.aliexpress.com/item/4001201771358.html
nanodla sigrok-compatible oshw logic analyzer: https://www.aliexpress.com/item/4000931572965.html
multimeter an8009: https://www.aliexpress.com/item/4000135799981.html
breadboard kit: https://www.aliexpress.com/item/4001195588484.html
lm2662 charge-pump voltage inverter: https://www.aliexpress.com/item/1005001639598862.html
txs0108e logic level translator 3.3v<>5v: https://www.aliexpress.com/item/4001278995191.html
ft232h usb jtag uart spi i2c gpio bridge: https://www.aliexpress.com/item/32903296960.html
cp2112 usb i2c bridge: https://www.aliexpress.com/item/1005001546685651.html
1602 16x2 lcd hd44780 w/i2c bridge: https://www.aliexpress.com/item/32763867041.html
ssd1331 96X64 oled spi: https://www.aliexpress.com/item/4000574446702.html
sensor module kit: https://www.aliexpress.com/item/4001174032556.html

>> No.1948897

>>1948697
https://www.tutorialspoint.com/cprogramming/if_statement_in_c.htm

>> No.1948900

>>1948697
Tarduinos trying to code is as bad as /diy/ trying to discuss household wiring.

>> No.1948908

>>1948697

You had too many semicolons. This broke the if statements. I reformatted the code slightly so it is easier to read for you use, and more like a standarad if formatr..

You didn't need both uppercase and lowercase J. I removed the extra variable. The remaining j is only ever read so you can use the argument of the function directly.

The lower case j is unsigned and so will never be less than 0.

void SHFTREG(unsigned int j)
{
if(j==0) { Cbit0 = 0; Cbit1 = 0; Cbit2 = 0; Cbit3 = 0; }
if(j==1) { Cbit0 = 1; Cbit1 = 0; Cbit2 = 0; Cbit3 = 0; }
if(j==2) { Cbit0 = 0; Cbit1 = 1; Cbit2 = 0; Cbit3 = 0; }
if(j==3) { Cbit0 = 1; Cbit1 = 1; Cbit2 = 0; Cbit3 = 0; }
if(j==4) { Cbit0 = 0; Cbit1 = 0; Cbit2 = 1; Cbit3 = 0; }
if(j==5) { Cbit0 = 1; Cbit1 = 0; Cbit2 = 1; Cbit3 = 0; }
if(j==6) { Cbit0 = 0; Cbit1 = 1; Cbit2 = 1; Cbit3 = 0; }
if(j==7) { Cbit0 = 1; Cbit1 = 1; Cbit2 = 1; Cbit3 = 0; }
if(j==8) { Cbit0 = 0; Cbit1 = 0; Cbit2 = 0; Cbit3 = 1; }
if(j==9) { Cbit0 = 1; Cbit1 = 0; Cbit2 = 0; Cbit3 = 1; }
if(j==10) { Cbit0 = 0; Cbit1 = 1; Cbit2 = 0; Cbit3 = 1; }
if(j==11) { Cbit0 = 1; Cbit1 = 1; Cbit2 = 0; Cbit3 = 1; }
if(j==12) { Cbit0 = 0; Cbit1 = 0; Cbit2 = 1; Cbit3 = 1; }
if(j==13) { Cbit0 = 1; Cbit1 = 0; Cbit2 = 1; Cbit3 = 1; }
if(j==14) { Cbit0 = 0; Cbit1 = 1; Cbit2 = 1; Cbit3 = 1; }
if(j==15) { Cbit0 = 1; Cbit1 = 1; Cbit2 = 1; Cbit3 = 1; }
if(j>15) { Cbit0 = 0; Cbit1 = 0; Cbit2 = 0; Cbit3 = 0; };
}

Please read about C more.

Get yourself a decent editor, the Arduino IDE is not the best.

If this is bait, it's sad.

>> No.1948911

>>1948900

> Tarduinos trying to code is as bad as /diy/ trying to discuss household wiring.
Don't be a needless cunt. We have enough cunts.

>> No.1948921

>>1948911
Not him but awful code deserves to be mocked relentlessly.
It's the only way you learn.

>> No.1948947

>>1948908
I'm using uVision and testing in multisim 14.2.

What is your preferred editor that outputs a '.hex' file

>> No.1949028

>>1948697
>girls_who_code.jpg

>> No.1949039

>>1948697
Maybe we should adjust Dijkstra's classic quote to suit the modern era:

“It is practically impossible to teach good programming to students that have had a prior exposure to MATLAB: as potential programmers they are mentally mutilated beyond hope of regeneration.”

>> No.1949042

>>1948921
I hear you, but there needs to be some guidance mixed in. Not to coddle but point them towards the light.
And yes, it was fucking awful code.

>> No.1949052

>>1948947

Your C code is really bad.
uVision can be configured to work with PC-Lint, that would help you catch the worst mistakes.
https://www.keil.com/support/man/docs/uv4cl/uv4cl_ut_pclint_config.htm
A 30-day eval of PC-Lint is available.

>> No.1949054

>>1938160
Say I have a microcontroller that has 2 8-bit DACs and I want to deal with 16-bit audio samples. Can I send the low 8 bits of the sample to DAC1 and the high 8 bits to DAC2, and then mix both DAC outputs together, and expect the resulting output to be the same as if i'd used a 16-bit DAC?

>> No.1949064

>>1949054
No. DAC has non-linearities plus you need to make sure high signal is 256 times stronger than low.
So DAC error, op-amp error, combined signal error will give you somewhat similar to 16bit dac value but sure as hell won't be the same

If you just want to combine dac outputs together you'll just have two completely separate signals of same level to form some completely new signal not resembling original at all

>> No.1949137

>>1948900
>as bad as /diy/ trying to discuss household wiring.
if they would just use russian glownuts everything would be fine

>> No.1949153

>>1938178
https://www.realdigital.org/
Go through the courses tab. Most code examples arent the best but it will give you some expanded projects from beginner to lower intermediate range.

>> No.1949417

Who has the most concise soldering tutorials on YouTube?

>> No.1949437

>>1949153
Any tuts for hobbyist embedded systems (in C or C++, not ASM) - don't wanna go bare metal

>> No.1949441

>>1949437
>>Embedded
Maybe buy some devboards first. >>1948864

>> No.1949442

>>1949441
I have a bunch of them (arduinos, stm32, esp32, a raspberry pi 3B) but only worked with arduino code. Now I'm getting into more advanced projects and I want to get away from the arduino abstractions and program in mbed or freertos or something like that.

>> No.1949443

>>1949442
obv. will program using those, but the same code will be used when I design the PCBs to use just the MCU and any other parts I need, and not the whole devboard

>> No.1949445

>>1949442
I recommend ditching the Arduino IDE, and attempting to use microcontroller family specific SDKs.
avr-libc for avr8
esp-idf for esp32
stm32-base or libopencm for stm32

>> No.1949447

>>1949445
Yeah, I wanna ditch the Arduino IDE for sure.
I've seen people always suggest using the stmcube thing for programming STM, but wouldn't it be better to go for something that I can use with multiple MCUs? Meaning, something like mbed that I can use with all those boards and more (if I get into MSP430 for example, I wouldn't need to learn a lot of new stuff)
I understand that using the SDK designed for that specific board is probably the best solution performance wise but for a hobbyist like me (I can't devote too much time to learn new things every time) is the performance worth the learning curve?
This probably won't make sense to you and I've confused stuff in my head

>> No.1949448

>>1949447
mbed and stmcube are very closed environments you should avoid.
Above everything, focus on reading the datasheets for the microcontrollers you're using.
Most people can't even do this much. They want their SDK to abstract everything for them, and in doing so they lose most of the power their µC provides.

>> No.1949460

>>1949448
OK, thanks for the help, I really appreciate it.
So say I want to build a simple device, let's say one that reads a sensor, processes/aggregates the data, streams it to some other device (let's say already that one already exists) using RF (or wifi) and then while doing that it might get a signal/interrupt to turn on a relay. My understanding for working with that is:
1. Find what MCU to use based on sensor compatibility, target power budget, processing power that is needed, maybe ADC resolution etc. - here is where I'd read the datasheets
Let's say that device is a Blue Pill for now (and later the bare processor)
2. Find an SDK for that board with a large-ish community (stm32-base for example, based on what you said)
3. Learn/Google it enough to make it work (read data, process data, send data, and have an external interrupt that turns on a relay)
4. Once it works design the minimum system (pcb with just the MCU and any other components needed
5. Program the MCU

>> No.1949463

>>1949460
>>1949448
I don't really understand how this example works though https://stm32-base.org/guides/changing-template-code the banks thing confuses me.

Do you know of any tutorials to get me started?

>> No.1949465

>>1949460
That's waaaaaaaaay too waterfall.
Instead, with power budget in mind, you decide which family among the families you have devboards for and have some familiarity with.
Then you implement your prototype. You'd use breadboards for this, and write code to do the reading, processing, streaming, and so on.
Once you have your prototype (or prototypes as your project has two halves separated by radio for some reason) and all the knowledge you've gained from it, that's when you try and find the ideal parts and design the final boards, should you need to actually make PCBs. Which you can often get away with not doing, most of the time. Soldering and hotgluing some shit together with protoboards can be sufficient. PCBs are useful when you want to do things at a scale, or when implementing whatever with protoboards would plain suck.
Of course, YMMV.
>I don't really understand how this example works
stm32-base has a nice "guides" tab. Lots of reading to do there.
>RCC_AHBENR_GPIOCEN
If that sorta shit sounds alien, you should probably try reading the datasheet.
I'd usually spend hours reading a datasheet before even attempting to do anything with some chip family that's new to me.

>> No.1949467

>>1949465
Thanks again bro. I think you're setting me on the right path little by little.
The radio/wifi/bluetooth separation is because for the project I have in mind you might have a bunch of nodes all talking to a local raspberry pi or even to the cloud for inference. I know how to do that on the pi since it runs linux and I can use TF lite or Pytorch mobile so that's why I consider that implemented - I have a long way to go before being able to make a good implementation for the node part though.
You're right about prototyping of course, I always go breadboard and then maybe protoboard if I need a permanent thing. I was thinking of wearables in the future so I'd have to make PCBs for that and have them assembled because I can't solder smaller SMD parts for shit.
The reason I was thinking of using mbed is because the guides are really easy to get started with and it works with a bunch of different ARM boards, plus it has an online thing I can try shit on without actually compiling and flashing a board every time. I still don't understand what you mean by it being a "very closed environment"

>> No.1949468

>>1949467
>mbed
mbed IDE and rtos somehow rub me the wrong way. Lots of bias here, you can ignore me on this.
>I have a long way to go before being able to make a good implementation for the node part though.
The node part looks like the fun part, from your description.

>> No.1949472

>>1949468
Yeah no shit. It being a long way to go for me is the actual fun. I love learning new shit, I love the challenge, and I like working on a breadboard.
I wouldn't be using the mbed IDE, just the libraries for each board/microcontroller. I don't know if I *need* an RTOS for this project (I probably don't, although idk if the interrupts part would work easily without one) but I feel like it'll be easier to debug and work with.

>> No.1949474

>>1949472
also the sensors I need are probably easier to use with mbed since it has drivers for so many

>> No.1949475

>>1949472
>do I need RTOS
If you just need to handle interrupts, do it baremetal. Generally, the simpler you go, the better.
If you actually need multitasking, an RTOS can help you a great deal at that point.
>drivers for sensors
It all depends on what you're working with. If it's e.g. a camera, then existing code will be very useful.
If it's something trivial like a thermometer or an RTC, writing your own code isn't necessarily a bad idea.

>> No.1949476

>>1949472
>(besides mbed) which rtos
https://www.osrtos.com/
The list is long. You should probably at least do a little research before jumping into anything.
I favor NuttX in terms of convenience, whereas seL4 is the most serious and trustworthy thanks to formal proofs, but also relatively hard to use.

>> No.1949481

>>1949475
Sensors are mostly in the camera ballpark, which is why data needs preprocessing before sending - radio/wifi transmission would eat up the battery if I sent it raw. Extracting some features from it and sending those would be way cheaper power-wise.

>>1949476
I don't feel like I know enough to make an educated decision on RTOS. I can read descriptions but that doesn't help at all. The only obvious thing is NuttX supports many more MCUs, whereas mbed only supports ARM. If I only plan to work with ARM, that doesn't help me a lot.

>> No.1949485

>>1949481
>If I only plan to work with ARM,
You mentioned radios, do you have some specific controller in mind? (e.g. nRF5340)

>> No.1949489

>>1949485
I'm not sure yet. I think the prototype will use either wifi or just wires, but at some point if the range is right I was thinking NRF, yes. Honestly I don't know enough yet so I'll look into WiFi, BLE, LoRa (although I won't need more than 20 meters range probably), NRF24, or even those cheap 433MHz ones if it makes sense when I have a few numbers I can work with.

>> No.1949493

>>1949467
>plus it has an online thing I can try shit on
Online is the normal way of using mbed. I've tried and failed many times over the years to get a local build working. (Maybe part of my problem is wanting to do a completely offline build including compiling my own libraries, rather than downloading a project with binary libraries for the selected platform, I dunno.)
The thing I like about mbed is how it uses C++ classes as an API, and C++ objects as representations of actual I/O devices. I found that to be a really good way to get abstraction of your board without a bunch of messy or custom code.
The main problem I have is when you declare objects as global, C++ doesn't have a way to set the order of constructors, and a lot of mbed classes simply lock up if you try to use them from another constructor before they're constructed. The only reliable way I've found is to declare your objects as local in main().
>>1949468
>mbed IDE and rtos somehow rub me the wrong way
I never got to the point of using its rtos, but I think there's things about it that kind of rub me wrong too. I think I remember that it was doing stuff mostly as co-routines, so other than real interrupts, you could be sure of no context switches until you were ready.
And the IDE is moderately annoying, but the big problem of course is no debugger (it's a problem with Arduino too), since it's probably hard to access a debugger from JS, and you would have to set up a GDB server for your board too.

>> No.1949499

>>1949493
>the big problem of course is no debugger
Well if you want to debug embedded stuff you should probably have a hardware probe. Those work fine with mbed from what I've seen.

>> No.1949503

>>1949499
How do you think you're going to talk to a debug probe from a web IDE?
But now that I think of it, even though I'm doing STM32 blue pill with ST-link, other platforms may not even use a debug probe for downloading. After all, mbed was originally designed download to a flash filesystem over USB, and except for the first generation, most of them even use a fake filesystem.

>> No.1949740

>>1949437
C is still "bare metal" you are working with physicals memory addresses and registers. no virtual memory or OS.

>> No.1949748

>>1949460
>So say I want to build a simple device

>reads a sensor
>processes/aggregates the data
> streams it to some other device
>using RF
>signal/interrupt to turn on a relay.

>simple device

that's not simple for your skill level if you don't even know what a memory mapped register is >>1949463
you're looking at an RTOS at the least (either download one or make your own) to read and process sensor data, handle interrupt processing and whatever RF transfer stack you choose to use. Keep in mind that for sensor processing it needs to be don asynchronously to get any sort of usefulness out of it.

>> No.1949754

>>1949468
>>1949493
> rtos somehow rub me the wrong way.
what exactly is bad. or is it you don't understand the abstraction/never bothered to look under the hood.
when you are working on embedded projects that manage multiple hardware communication interfaces reading and writing multiple sensors and devices all processing and requesting data at different rates. all of which need to be done async you quickly learn the benefit of an rtos.

At the base level, all the RTOS does is use a isr to switch out register and stack frames between "processes" at a scheduled time or when a process is waiting on a state. Really interesting when you dig into the meat of the code.

>> No.1949771

>>1949754
Why would I need an RTOS for async stuff?
Synchronous stuff is where I'd want an OS that offers me multiprocessing/-threading.

>> No.1949772

>>1949754
There's nothing wrong with RTOSs in general, just mbed.

>> No.1949943

>>1949771
>Why would I need an RTOS for async stuff?
It's for async reads on hardware devices/sensors that have sync code dependencies.
Any time you read any type of sensor, which 99% of people using a MCU will do, you call a read data function then you wait for the transfer to be completed.
For HW implementations, they either write individual bytes to a HW register, or setup a DMA transfer and wait for a DMA_DONE flag in another register to be set.
For each of these and every other implementation of peripheral reads that I've seen that doesn't use an RTOS they wait using blocking while loops.
if you do any kind of data processing you'd benefit from an RTOS. Instead of a wait loop you can call a RTOS_wait_for_event() which tells the RTOS that this task is idle waiting for an event and a new task can be switched in to the current execution frame.
When the data read transfer is completed the I2C/SPI transfer complete ISR fires and you can call a RTOS_notify_event().

>> No.1949972

>>1949943
Why would you ever busy wait on a single flag unless it doesn't matter?

Just have a main loop where you check all the various flags of your different peripherals sequentially at each iteration.

>> No.1949986

>>1949972
Yea sure until you're working with a complex sensor array like an IMU that requires multiple read/writes for data to be available to even read out of the built in FIFO. The code quickly grows into a huge state machine where you have to juggle the various states and responses.
It can be done, and I've written them before which is why I prefer RTOS since instead of copy-pasting the same state machine for each sensor I need to manage the code execution frame becomes linear and isolated from each other.
The whole point of an RTOS is to make it easier to program complex things but you don't have to use it, it just makes your life harder.

>> No.1950144

>>1949748
Yeah I guess simple is not the correct wording - by definition this is a "smart" node, and it's not simple to implement for me. I think I meant simple in terms of explaining what it does.
The parts of reading from a sensor and preprocessing I have done before, and the transmission part I will probably use a library for (leaning towards BLE instead of RF after a bit of reading). I've used interrupts but only on Arduino so I'll probably have to work in that a bit more to get it to work with mbed but should be doable.
I don't know if you're this guy
>>1949772
but what's wrong with mbed? Someone told me last year it sucked but everything I've tried this past week worked first try, and the documentation is excellent.

>> No.1950209

>>1950144
When they added the official RTOS to mbed (I think it was "mbed 5"), I seem to remember they changed things so that a lot of the callback stuff wouldn't work the simple way like it did before, even if you didn't use the RTOS. You had to add a lot of extra crap that I never figured out. So I just stayed with the "mbed 3" codebase.
I'm not even sure how I would do it with a new project. I just keep cloning my old projects, from a Blinky if I have to.

>> No.1950215

>>1950209
That sounds like bad practice in general, but if they only introduced breaking changes once in order to get to the next level I can understand it.
Same thing happened with python 3 and it's much better to work with than 2, but existing python2 code was hard to port and some people hated the breaking changes. Sometimes you have to make a big drastic move though.

>> No.1950317

>>1949972
Using a round-robin style scheduler for your system works, but it gives no priority to anything.
You may have 5 different flags that you cycle through to handle processing, but if one or even two of those are very high priority, you will leave them sitting if something else has tripped a flag.
Some mcus allow for setting interrupt priority so that if you are handling one interrupt and a higher priority interrupt trips, the mcu will go take care of that before returning to the previous interrupt.
Imagine a whole system like that with dozens of interrupts. Some of us are sadistic enough to enjoy the pain of programming that, but for most an RTOS is a good fit.

>> No.1950331

Bros every time I try to find code for something it's always in C++ instead of C, and C++ makes my eyes bleed. I just like the C syntax. Am I missing out?

>> No.1950336

>>1944138
TSSOP and QFN are both doable with a soldering iron
you might just be shit at soldering, brev

>> No.1950462
File: 80 KB, 1318x701, img_FgZw6mVBo8WgigH_r.jpg [View same] [iqdb] [saucenao] [google]
1950462

I have no idea where else to go with this question. I have two giant sansui 3-way speakers. I moved into my gfs house recently and found an old stereo receiver, technics 'SA-GX710'. I hooked them up and they sounded really good for a couple weeks. Then something strange started happening. Without changing any of the channels, tuning or cables, ect. Basically the issue started slowly but then got progressively worse over time, a dull and quite 'fuzzy-buzzy' sound started coming through. It started soft but now it's really strong and completely ruins all enjoyment. It almost sounds like 'clipping' but it happens continuously and it's not as much of a sharp snapping noise, which usually comes from clipping but rather a more dull and fuzzy sounding buzz. I have no idea how to start debugging this issue, can anyone point me into the right direction. One interesting thing I noticed is when I unplug one of the white/red aux leads, the issue gets considerably better, the buzzing noise almost goes away completely, but I'm not going to just settle for one speaker. The issue also comes and goes, sometimes it completely goes away without messing with anything during the duration of the same audio track, it's very strange. Can someone please help me.

>> No.1950469

>>1950462
It's an analog hardware problem, and most definitely NOT anything to do with microcontrollers.
So off to /ohm/ with you.

>> No.1950521

>>1950469
I feel like a fucking dipshit, I didn't notice there was an /ohm/, sorry, I never come here.

>> No.1950597

>>1950144
if you want to transmit data over BLE or zigbee i'd recommend the NRF52 series of MCU's. the SDK has a bunch of examples to get started quickly.

>> No.1950599

>>1950331
always in C++ instead of C
stop looking at arduino examples. C++ has no benefit over C on a micro anyways.

>> No.1950600

>>1944135
>I couldn't find an SMD-dip breakout board for a lot of the TSSOP SDRAM chips.
then make one, or even better learn how to use a heat gun properly

>> No.1950920

>>1950599
The problem is I'm not looking at micro specific code but general implementations of algorithms I can use without much hassle, specifically I need STFT or 1D signal to spectrogram

>> No.1950937

>>1950920
Might this help?
http://www.fftw.org/

>> No.1951060

shieeet i can't get vscode intelisense to work with arduino shit properly, it just doesn't see the libraries and shit even though compiling and uploading of sketches works fine and i did include paths to the libraries in the cpp properties and shit
arduino plugin has been out for a long time why haven't they fixed that shit yet

>> No.1951078

>>1951060
How about not using a web browser to edit code?

>> No.1951082

>>1942607
An Atmega8 with a keypad and one 7-segment display.

>> No.1951084

>>1951078
oh great another hipster to hate on shit because it's popular
vscode is hands down the best ide on the market
>noooo use this GNU ide nobody ever heard about and only 100 people use worldwide instead, it's much better
yeah sure
apart from this one thing, i have never been more happy with an ide than vscode
i bet you hate windows as well and use arch or some shit

>> No.1951091

>>1951084
Okay pajeet, Enjoy your web shit.

Don't forget to upload your code to Microsoft(TM) Github(TM) to get a free T-shirt. But add a CoC - you don't want to get banned for being an evil nazi.

>> No.1951099

>>1951091
thanks, i will

>> No.1951162

>>1950937
No, I found it when I searched but it won't fit in flash - I managed to implement it using some bits and pieces, only requiring math.h and complex.h but it still won't fit in flash.
>>1951084
Seconding VSCode best editor but never had a problem with Arduino in it. Don't work much with arduinos now but maybe you've configured something wrong.
BTW I actually use arch but mostly because of AUR, not because it's SO COOL to use it.

>> No.1951180

what is the best way to debug attinys?

I am trying to find out why my shit isn't working correctly on attiny84 but the only way i can do it is by doing something like connecting a led to one pin and use blink code like computer bios uses beep codes but this is gay and tedious, there must be a better way

>> No.1951184

>>1951180
printing to serial is a simple but inefficient way. I use that, but only used ATTiny for very simple projects.

>> No.1951195

>>1951180
If you have a scope a very useful technique is to use one or more output pins to show when things happen. Drive the line high when you enter a section of code, and lower it when you exit. It's one of the simplest ways to find out where all your cycles are being used, or to verify that interrupts and other code segments are happening when they should.

>> No.1951196

>>1951180
I suppose if you go by the way pros would do it, you would make a prototype with a CPU that had more pins, maybe using a socket adapter. Then you get to debug with a more complete version of the chip. You might have to change pin mappings for the debug version, but a lot of times smaller pinouts are the same chips with fewer pins bonded out.

>> No.1951350
File: 30 KB, 400x400, s-l400.jpg [View same] [iqdb] [saucenao] [google]
1951350

I want to make a lab power supply from an old ATX PSU. It's easy enough to wire the thing, but whats the easiest sensor types to read current and feed to an arduino that drives a lcd and inputs to control it? What about a variable output channel, I can always get a variable buck converter, but whats the easiest way to control the output digitally?

>> No.1951434

>>1938368
autohotkey (ahk) will help you if on Windows.
There's other ways to do macros / automate input on Linux/osx/whatever you use, if needed.

>> No.1951478

>>1951350
This is probably more of a /ohm/ question but
>whats the easiest sensor types to read current
easiest is a power monitor that reads current from a shunt resistor. Then read out the current over i2c. Take your pick on whichever one suits your needs.
https://www.ti.com/amplifier-circuit/current-sense/power-current-monitors/products.html#o7=Current/voltage/power%20monitors&p726max=2;48&sort=p726max;desc

>What about a variable output channel
> I can always get a variable buck converter, but whats the easiest way to control the output digitally?
you will need a buck(switching) regulator or a LDO. use a digipot over i2c to control the output voltage. Make sure you code it right and don't turn on the regulator before the arduino programs the digipot with the correct value. And don't forget feedback to make sure what you set is what you want.

>> No.1951561

i want to make the jump from arduino to stm. i got stm32-base setup and compiled some basic programs earlier today, what's the best resource for learning to work with the program? I have an ok amount of programming experience but mostly with really high level languages like C#, python, etc. Should I just start reading up on C first?

>> No.1951594

>>1951078
>>1951091
/g/tard pls go some of us get actual work done

>> No.1951628

>>1951561
Figure out what chip you have.
Once you've done that, download the datasheet and read it.
You don't need to read it top to bottom. But you need to read the introduction/features pages and use it as reference along the way, when necessary.

>> No.1951630

>>1951628
>>1951561
>datasheet
This. A million times.
It might sound silly to most of us, but not even trying to read the datasheet is a widespread problem among plebs.

>> No.1951639

>>1951561
>Should I just start reading up on C first?
Not knowing C is a huge handicap/disability.
Work on that. The C Programming Language, 2nd edition.
>what else
ARM assembly language. Try to do some basic led blinking, except in asm.

>> No.1951779

>>1951478
thanks fren, and your right I should have asked this on /ohm/

>> No.1951785

EVERYONE IN THIS THREAD IS NOW EVICTED EFFECTIVE IMMEDIATELY

>>1951783
>>1951783
>>1951783
>>1951783

>> No.1951986

>>1951078
>[autistic screeching intensifies]

>> No.1952835

8

>> No.1952882

1