[ 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: 140 KB, 923x377, stm32f401-black-pill.png [View same] [iqdb] [saucenao] [google]
2033493 No.2033493 [Reply] [Original]

Here we discuss microcontrollers and microcontroller accessories, such as Arduinos (ATmegas), attinys, ESP32, RPI, the blue pill STM32 and others

Previous thread: >>2019146

>> No.2033782

Was there ever a red pill board?

>> No.2033998
File: 1.19 MB, 809x695, 1590944755871.png [View same] [iqdb] [saucenao] [google]
2033998

>>2033493
sigh, we only just had a blackpill edition

>>2033782
yes. afaict, it's just an earlier rev of the bluepill

>> No.2034117

I want to be able to record and play a sound file at the same time. Files shouldn't exceed 3 minutes, most would be below a minute.
I only have a Raspberry Pi 3 which is overkill for that.
What do you recommend?

>> No.2034126

>>2034117
esp32. dirt cheap and has i2s with dma so you can both record, play, and run code at the same time. if you use a regular analog mic/speaker, the dac/adc can be configured to write/read through the i2s api, so you get even spacing between samples

>> No.2034140

>>2034126
>esp32
>non wifi application
absolutely retarded. Everything you listed can be done with other micros at the same or lower price point

>> No.2034147

>>2033998
There was no thread for over nine hours. Why didn't you start one?

>> No.2034171

>>2034140
Such as?

>> No.2034186

>>2034171
>asking to be spoon feed.
sure anon, atsamd21 is one answer. 350ksps adc and dac built in. USB output to PC if needed or use built in SPI with an SD card.
I2S for interfacing with codecs or microphones.
All for less than 2 dollars at single quantities at any catalog site.
Never used STM32 but you could probably do the same if you look around.

>> No.2034203

Anybody here ever write a Linux device driver for SoCs? What is the best way to learn how?

>> No.2034219

>>2034203
like a driver that runs on a linux SoC or a driver that interfaces with an external SoC.

>> No.2034259
File: 28 KB, 200x244, okay_retard.png [View same] [iqdb] [saucenao] [google]
2034259

>>2034219
I am trying to learn how a Linux device driver is done now and I have a recent book but it is slow going. I am wondering if anybody here just read /Documentation or found some other shortcut that was easier/faster. My short term goal is to just connect an RTC module or something to an RPI and write a driver for setting/reading time. That's about it.

>> No.2034264

>>2034117
how do you envision starting the playback/record process? how many bits do you need? do you need compression/decompression? how much time do you want to put into coding? low-end Allwinner H2+ boards like the Orange Pi Zero are pretty cheap and have the awesome power of Linux, and they have an acceptable built-in analog codec suitable for line or mic levels
if I had to optimize for price and fun I'd grab a bluepill from the pickle jar, learn how to FAT filesystem on an SD card, and find a cheap analog codec module board suitable for the application's analog levels. if I needed compression or decompression I'd look for something with decent hardware floating point, maybe the STM32F302 that has a nice core and a couple of opamps built in

>>2034147
it was up when I went to bed. this one was here when I got up. it couldn't have been gone for more than 7

>>2034203
it's about the same on any Linux kernel. start with a driver of the same class as the one you have, and plug in the code for your hardware
if you're using device tree, as is the ARM linux custom, you might not need a driver at all, just a device tree overlay to tell linux where to find the device

>> No.2035021

>>2034117
dsPIC33FJ128GP802
Built in ADC/DAC and is specifically designed to deal with audio.
The have a loopback demo with source code you can download:
>https://ww1.microchip.com/downloads/en/DeviceDoc/CE154_ADC_DAC_LOOPBACK%2024oct13.zip

>> No.2035022

>>2034259
there's many ways to write a driver but one of the more proper ways is something called a platform driver. you add an entry for your device in the device tree of the SoC and code the driver in such a way that the kernel auto loads the .ko when the device tree entry is present.
Here's an example using a device on i2c
https://www.kernel.org/doc/html/latest/i2c/writing-clients.html

>> No.2035185

What's the simplest way to make an embedded chip to play a sound file when a button is pressed? Some googling lead to this https://www.digikey.ca/en/products/detail/adafruit-industries-llc/1681/9553564 but I don't know how to wire it to a speaker, power and button. I have access to PCB manufacturing though my job, would be cool to build it myself from the ground up if that's reasonable

>> No.2035192

>>2035185
The simplest way is to use an off-the-shelf recordable greeting card module.
If you want to do it yourself you can use a purpose built IC... https://www.digikey.ca/en/products/filter/interface-voice-record-and-playback/733

>Some googling lead to this https://www.digikey.ca/en/products/detail/adafruit-industries-llc/1681/9553564 but I don't know how to wire it to a speaker, power and button.
It's a lot more than wiring it to a speaker... read page 16 of https://www.sparkfun.com/datasheets/Components/SMD/vs1053.pdf
If you don't understand that circuit diagram then adjust your expectations.

>> No.2035204

Hi dudes.. does anybody know of beginner resources to learn this stuff?

I know nothing about electronics, hardware and microcontrollers. I am comfortable in C but that's about it.

>> No.2035210

what is best microcontroller for ebike ?
it must be able to do 1000w and 100 amps from battery and very very fast

>> No.2035284

>>2035210
What? Do you mean a battery controller?

>> No.2035302

>>2035204
>does anybody know of beginner resources to learn this stuff?
Check the /ohm/ post here on /diy/. There is a lot of good info in the first post.

>> No.2035305

>>2035204
Electronics and microcontrollers are quite different
Microcontrollers are more programming and computer archetecture, while electronics is more similar to physics.
For electronics, I'd recommend https://www.allaboutcircuits.com/textbook/

>> No.2035400
File: 22 KB, 600x600, 1604803421959.png [View same] [iqdb] [saucenao] [google]
2035400

>>2035305

>> No.2035432

>>2035400
How so?
Digital and analog are completely different animals

>> No.2035440

>>2035432
Microcontrollers are also electronics, silly

>> No.2035450

>>2035440
Ah. I tend to think of electronics as resistors, capacitors, transisters, ect, and uC's as programming

>> No.2035484

>>2035432
>digital isn't a subset of analog
said nobody on /ohm/ or in industry ever

>>2035450
>programming
you know what lies just beyond the pins of your little autism sandbox? BIG BLACK ELECTRONS COMING TO REPROGRAM YOUR WIFE'S FLASH, that's what

>> No.2035500

>>2035204
i bought a course for children on a facebook ad

>> No.2035528

>>2035484
I learned electronics 20 years before programming.
Someone could design amplifiers and not know what a byte is or program uC's without understanding ohms law.
Sorry for triggering you with my use of words that didn't fit your definitions.
I'll try to be more careful in the future and be sure to use digital and analog, if that would be more accepatable to my sensitive fellow poster

Oh wait, 7400 and 4000 use isn't programming!
So please educate me on all the proper definitions

>> No.2035629

>>2035528
>Someone could design amplifiers and not know what a byte is
sure, but they can inductively reason a digital world from their understanding, just as von Neumann, Wilkes, and other digital computing pioneers did. thru the right lenses, logic gates look like highly non-linear amplifiers. for that matter, unbuffered CMOS gates like the CD4069 inverter are literally used as amplifiers in multiple applications. analog considerations start to impose on those digital signals when riding faster than several megahertz. given only a few meters of wire those considerations start to apply to anything faster than dc
>or program uC's without understanding ohms law
what I am arguing is that they shouldn't, because they would not fully comprehend the consequences of their own or their program's actions. and they wouldn't be able to re-derive an amplifier from their knowledge. it would be great fun to give them an oz of dude lmao and watch them try

>> No.2035635

>>2035629
>analog considerations start to impose on those digital signals
Fair enough

>> No.2035660
File: 320 KB, 800x370, vox-imperium-voice-changer-headline[1].png [View same] [iqdb] [saucenao] [google]
2035660

Hey guys since the pandemic I have been wearing one of those 3m half face respirators ,specific one I have is 6502QL, well the P100 filters are past the 5 month use now, and I would like to use one as a housing to make a voice amplifier while wearing it, I don't leave the house often, but I visit my psychiatrist once a month, and wear that to the office. I know you can say im autistic, but P100 filteration > facebook quality cotton mask, idc. But when I am in his office I have to take it off so he can hear me, I came across this tutorial, and it may suit my needs.

>learn.sparkfun.com/tutorials/vox-imperium-stormtrooper-voice-changer

As I think about making this, I keep wanting to add features, and would like to know if its possible?

In that tutorial it uses teensy 3.2, and a prop shield LC
If I switch to a teensy 4.0 and use audio shield made for teensy 4.0, can I hook up a bluetooth module, connect my phone, and play audio files off of the micro SD card? I wanted to add some funny short audio clips. If not, I'll just resort to using prop shield LC.

>> No.2035808

>>2035302
>>2035305
Thanks guys. Gonna start that all aboutcircuits book.

>> No.2035823
File: 3 KB, 211x64, Screenshot 2021-02-19 220247.png [View same] [iqdb] [saucenao] [google]
2035823

I'm trying to make a media keyboard using a digispark with buttons like play, pause, skip, volume...

I searched for the media codes on the keyboard HID table (page 56), but they don't work on windows it seems. (e.g: volume UP is 0x80)
https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf

My digispark looks just like another keyboard to my computer, and my keyboard can send those commands using the function key. What is my keyboard doing to make it work, can I emulate it with a digispark?

>> No.2035865

>>2035823
have you tried the consumer control usage page?

>> No.2035866

>>2035865
Tbh I have no idea what I'm doing, I might try adafruit's library which seems to support them.

>> No.2035892

>>2035866
you just need to edit your HID report descriptor to tell the host the correct way to interpret the keycodes you are sending. HID report descriptors are a little wonky to write from scratch but there is tooling to help. the hidrd-convert utility can take your existing descriptor and convert it to a more editable form. you can edit it so that you can make your keycodes land in the right range, then hidrd-convert it back to a uint8_t[] initializer for you to replace in your digispark C code
grab the HID spec, it's pretty short. you can skim until you get to chapter 6, where the structure of the report descriptor is elaborated

>> No.2036140

I'm a student with experience in C, Java, Assembly, Python from a computer science subject I have. I want to get hobby that I can make some money off would you reccomend microcontrollers? I'm tired of working waiter jobs for cash I feel like this will be a more productive use of my time.

>> No.2036178

>>2035892
Thanks for the explanation, I'll give it a try.

>> No.2036179

>>2036140
You don't have experience in any of those, you just used them for a class project.
If you want to make money just learn JS and get a web dev job or maybe develop some apps in Java and become a mobile dev. It's way harder to get a job in embedded systems and the subject itself is harder. I'd say learn it on your own time and if you actually like it that much you will eventually be really good at it and you'll be able to showcase projects and get a job.

>> No.2036344

>>2036140
If you don't know any digital electronics, embedded will not be for you. You don't have to be an EE grad, but if you've never even breadboarded a 555 or some TTL chips, you won't make it. Some of us were playing with that shit while still in high school as the next step up from Lego.

>> No.2036347

>>2036179
>You don't have experience in any of those, you just used them for a class project

lol literally my exact response to that anon's post.

>> No.2036463

>>2036140
The Art of Electronics isn't going to be enough, go directly to The Art of Fucking Off Because They're Full

>> No.2036559
File: 23 KB, 507x506, IMG_20210204_140529_737.jpg [View same] [iqdb] [saucenao] [google]
2036559

I managed to land a job for the summer.
It was titled embedded software intern and I've been told I will be a testing and documentation slut.
The job is a couple of months away, and I want to go full autist and prepare for it to ensure that I become a perma hire as there's a good chance.

I've already subtly asked about what I can prepare until then and was told to look into testing with python, canbus, and also codesys perhaps.

How would you advise me to prepare for the job, considering I'm not too familiar with these,
I've done projects testing spi and I2C interfaces,
used python for data science stuff.

>> No.2036565

>>2036559

HW I have:
>Arduino Uno
>Raspberry Pi 4b
>TI stellaris launchpad TM4C

I just ordered 2 mcp2515 modules for canbus.
>my plan
I was thinking to first set up and play around with the canbus.
I could use the uno and the pi as the 2 nodes, since they have a lot more info online.
After that I'd like to get the robot framework, as I think that's what's going to be used for testing, on the raspberry PI, get some easy tests like ssh-ing into it, gpio pins.
And finally trying to get some test cases related to the canbus perhaps, might be a bit hard.
the testing is python based, but the boards are in C...
any advice or suggestions appreciated frens

>> No.2036567

>>2036559
It might be worthwhile to look into the array and ctypes standard modules from Python. They're good for looking at binary data from low-level stuff.

>> No.2036573

>>2035660
kek

>> No.2036580

>>2036559
>I've done projects testing spi and I2C interfaces,
What I meant to say was just plugging them in and checking if they worked.
Not real automated testing, that's what I need to figure out

>> No.2036601

>>2036559
gj anon
read CAN specs so you understand what's going on. test cases for CAN depend on the higher-level protocol in use on that bus. there are many. it's easy to mock up failing cases with the arduino. you should get one more slave to help you understand the broadcast nature of the network
linux has a CAN address family. python has a python-can library. check them out
last but not least, lube holes

>> No.2036867

>>2033493
what if instead of sck under the gnd it was dck like dick lol

>> No.2037148

>>2036344
>recommends 555 chips instead of modulating through microcontroller pwm peripherals
Lmao, obsolete.

>> No.2037157

>>2037148
no, still active and in production in many manufacturers' catalogs
sorry, underage

>> No.2037187

>>2037157
Sure, legacy battery-powered vibrating buttplugs still use them and it's a big business to satisfy faggots like you. Woopie-fucking-doo.

>> No.2037193

Since it was mentioned in the topic maybe someone here might know. I'm not much of a programmer with these things and haven't been able to find someone to really teach me. I've been trying to figure this out for awhile now but clearly can't on my own. https://github.com/FablabTorino/tiny Matrix been using this on an attiny4313 and on every single one some leds on the matrix is constantly partially on. I've messed with it the best I could but I can't find out what's wrong. It's the code for sure doing something because I can manually control the matrix with simple test code and they turn on and off perfectly fine. I think there's some dirty waves on the switching that keep them on but unsure. I think code wise it has something to do with the timers and the multifunctionality of the pins because it's always the same pins causing this issue regardless of the attiny used. Over 20 of them and they all have this issue.

>> No.2037236

>>2037193
Do you have a hardware debugger? I'd be stepping through the code at this point.

>> No.2037251

>>2037236
I wish I did but I do not. Just a scope a func generator this knockoff arduino and the attiny I narrowed it down best I could with what I got. But I do not know enough about this stuff to go further.

>> No.2037255

>>2037148
Your arrogence isn't helpful to beginners
>>2037187
>resorts to insults

>>>/g/

>> No.2037308

>>2037236
I did find something like this that maybe could be useful. But I am basically a beginner at this stuff so this goes far beyond what I can do. What I get for not making programmer friends and only focusing on circuitry.

https://sites.google.com/site/wayneholder/debugwire

>> No.2037309

How do I get started in STM32? I prepared some project and its peripherals on STM32CubeIDE, but I opened the main file and now I'm kind of overwhelmed by everything, a shitton of functions I don't understand, should I just leave these alone and just write stuff on the main loop?

>> No.2037314

>>2037309
Can you be specific about what you don't understand?

>> No.2037339

>>2037193
>some leds on the matrix is constantly partially on
did you set the LED module type correctly? it appears there are two

>>2037309
>he thinks there's a main loop
typically, one leaves the arduino ecosystem precisely to get out of the business of single-tasking, in favor of an RTOS, or a more interrupt-driven, performant approach to peripheral access
that said, it's perfectly reasonable to start with a flashing GPIO output loop near the end of main() just to make sure everything (clocks, GPIO, etc.) got initialized correctly, to verify that you are in control of the machine. you can keep working that way if you prefer, and transition into interrupt-driven work or FreeRTOS at your leisure
fwiw, Cube is a bit heavyweight, as HALs go. it takes a bit to understand what is going on in the generated code and why it's there, but study eventually pays off

>> No.2037348

>>2037339
Yes. One is for a different module and then each setting has a forward and and backward option for setting the orientation of the images on the LEDs. Messed with it a bit. I am 100% certain I have it set right.

>> No.2037358

>>2037314
Sorry, I just got overwhelmed lmao, I should read up first.
You really never stop learning with engineering stuff.
>>2037339
Thanks dude, I guess I'll keep at it.

>> No.2037371

>>2037348
hmm. I could believe their code is buggy. "good enough for government work" is the maker ethic
dim LEDs can be caused by hardware pullup resistors or by glitches, and rarely by excessive reverse voltage. the scope will help you determine which one it is, and where to start looking and tweaking in the code to fix it

>>2037358
>You really never stop learning with engineering stuff
can confirm
at least the reference manuals for the STM32 chips and the HAL are well divided into chapters by peripheral. as you make use of the facilities of the chip you will probably want to read the relevant sections of both in detail, starting now with the GPIO-related chapters

>> No.2037688

>>2037371
Thanks for the response. I know it isn't anything to do with reverse voltage. I have measured it before but I will do it again and post some shots from my scope.My scope is analog so getting good captures is a bit difficult will update soon.

>> No.2037727
File: 1.64 MB, 1361x1103, 20210221_203100.png [View same] [iqdb] [saucenao] [google]
2037727

The top wave was measured from ground to the LEDs. It is the wave for the normal functioning ones. The second wave are what I see on the LEDs should be off. Otherwise I believe both sides of the LED should be at the same potential to turn it off. So not sure what to do from here. But as I have said before I do believe it has something to do with the multipurpose function of the pins. You might notice a collumn off. That was just me messing with the code to see what is going on. Clearly you can see that set of LEDs are off.

>> No.2037875
File: 105 KB, 1050x1050, PSoC 5LP.jpg [View same] [iqdb] [saucenao] [google]
2037875

Any PSoC chads here?

>> No.2038011

anyone know of any electronics related IRC channels?

>> No.2038389

>>2037875
>Programable Routing & Interconnect
>Configurable Analog and Digital Blocks
pretty neat. wish more vendors offered the IO mux where any pin can go to any peripheral.

>> No.2038461

I just programmed the fuses of my atmega328 to use an external clock...

>> No.2038645

>>2037875
Such fluxengine-friendly board.

>> No.2038827

>>2038389
me too. crossbars can be expensive, especially where analog precision is a selling point

>>2037688
actually, it could be reverse voltage, if you are powering the device from a 5V supply. note that the display modules have a do-not-exceed reverse voltage spec of 5V and a fairly high reverse current spec at that voltage, perhaps enough for a noticeable dim glow. the C code does impose the full supply voltage, in reverse, across some unlit LEDs in the matrix, with significant current available
a couple of easy things to eliminate first:
this design doesn't seem to be meant to run at 5V, maybe turning down your supply voltage to 3.3V will help
try adding a short delay (on the order of 20µs) between the reset_led and set_row calls in the refresh_line function
if that doesn't work, take it out and change the driver code to drive the rows or columns to their active value once at startup, then use DDRx to switch the current on and off instead of PORTx. you should only need to do that on the rows OR the columns to fix the problem

>> No.2038883

>>2038827
Thank you for the response. I'll try this out. Not much of a programmer do I'll try the easiest first. The circuit does run on 3.3 with a little button cell battery I just run a copy on a 5V breadboard for testing. I'll try that delay. Gotta setup my arduino to program it.

>> No.2039035
File: 2.63 MB, 2156x3046, sharp.png [View same] [iqdb] [saucenao] [google]
2039035

Trying to design my own 4-bit microcontroller for a calculator. I know I want 8-bit instruction size, 10 digit precision, BCD-math based. Not sure about how many nibbles of RAM do I need, how many registers do I need, what the ISA should look like.
Could anyone recommend a simple well-documented 4-bit microcontroller to draw inspiration from? Perhaps with a few example programs like square root?

>> No.2039044

>>2039035
http://www.intel4004.com/4004_original_schematics.htm
May I suggest try rolling your own and see where you end up?
Have you programmed in assembly before?
For square root, use newton's method.

>> No.2039068
File: 1.57 MB, 2550x3300, hp_journal.jpg [View same] [iqdb] [saucenao] [google]
2039068

>>2039044
>http://www.intel4004.com/4004_original_schematics.htm
##electronics at freenode suggested Saturn and TMS1802.
>Have you programmed in assembly before?
Only a PIC10F200 and some DOS programs.
>For square root, use newton's method.
There's also pic related from old HP journal, maybe that's the same but already simplified and adapted to these type of microcontrollers
>May I suggest try rolling your own and see where you end up?
I'm too afraid, haha. Maybe taking an existing design and adapting it a little bit would be nice.

>> No.2039272

>>2038827
Okay checked off basically everything on that list except that last part. Running my test at 3.3V. Also tested 20us delay and 40us delay. Neither changed anything noticeable. I am not 100% sure what you mean when changing the driver code. I know what you are referring to but not sure how to make the changes.

>> No.2039394

My ATmega328p just outputs 2 characters from serial and then it doesn't do anything else, whats going on?

> uart0_puts("SETUP READY\n");
> uart0_puts("SETUP READY\n");
> uart0_puts("SETUP READY\n");

Output:
> SE

I'm using this library:
https://github.com/andygock/avr-uart

However, I have tried with anothers and the result is the same

I've got a RX and TX buffer size of 64 and the CPU freq properly defined.

>> No.2039422

>>2039394
start with a known baseline.
load up arduino and see if the default serial example works, if it does the library is fucked and you either fix it or find a new one..
Saying other "libraries" do the same thing isn't really useful since there's more than one bad programmer in the world.
my bet is on the library being shit.

>> No.2039424

>>2039394
Got a scope? Probe the tx pin

>> No.2039426

>>2039394
>uart0_init
>uart1_init
>uart2_init
>uart3_init
>UART0_RxHead
>UART1_RxHead
>codebase is literally 4 times larger than necessary repeating the same logic on different hard coded variables.
Jesus has this dude never heard of a structure pointer. what an absolute dogshit library.

>> No.2039427
File: 854 KB, 917x604, file.png [View same] [iqdb] [saucenao] [google]
2039427

I'm dipping my toes into microcontrollers because I need something small as fuck for a project of mine and even an Arduino Every doesn't fit. Long story short, I'm trying to flash an attiny85 using an Arduno Mega using the pins circled in the pic, and it's not working, and I'm stumped why.
>check you've connected the wires correctly
I did
>add a capacitor across RESET and GND
I did that too, 47uF
>upload the ArduinoISP sketch to the Mega
Done as well
>set the proper device in the Arduino IDE
Did that too, using Konde's ATTinycore

All I'm getting is
>avrdude: Device signature = 0x000000 (retrying)
when I try to flash the thing.

Please help a dumb faggot who just wants to make something work for once.

>> No.2039428
File: 112 KB, 1000x798, 1606752812007.jpg [View same] [iqdb] [saucenao] [google]
2039428

>>2039427
>I did that too, 47uF
to large. any programmer cannot drive the signal low enough within the reset pulse period to trigger a reset.
more importantly that header is only used to flash the mega, not to program another device. all arduino ISP programing examples are done in SW using GPIO's so you need to hook it up something like pic related.

>> No.2039434

>>2039428
>too large
Fuck. Now what? I quite literally don't have ANY other capacitors I can use.
>hook it up like pic related
If that's really the only way, about half the guides I've seen are wrong, then, since a lot of them use those pins to flash (on different arduino boards, though)

>> No.2039437

>>2039434
try without the cap.
also I double checked and the icsp pins and >>2039428 are the same net signals so assuming you wired it correctly it should work.

>> No.2039442

>>2039427
>>upload the ArduinoISP sketch to the Mega
>Done as well
>>set the proper device in the Arduino IDE
>Did that too, using Konde's ATTinycore
did you also select use arduino as isp under programmer and when you program it you have to "upload using programmer"
https://www.arduino.cc/en/hacking/programmer

>> No.2039445
File: 17 KB, 503x281, file.png [View same] [iqdb] [saucenao] [google]
2039445

>>2039437
No difference, same error

>>2039442
Pic related

>> No.2039447

>>2039434
>>2039445
Also, I scrounged around in the furthest recesses of my stash and found the only other capacitor I have which just so happened to be 10uf, quite luckily... and it didn't help.

>> No.2039457

>>2039445
are you trying to burn a bootloader or flash code the attiny using the mega as a programmer.
if the latter did you use "Upload using Programmer"?
try the Ctrl+Shift+U keyboard shortcut

>> No.2039461

>>2039457
I'm trying to burn a bootloader onto a just-bought Attiny85 so I can use it on a small project instead of an Arduino.

>> No.2039469

>>2039428
Tried this wiring sans resistor and LED, still invalid signature

>> No.2039521

>>2039461
I might be misunderstanding something, but what do you need the boot loader for. Can't you just program your tiny85 with the intended firmware?

>> No.2039529

>>2035210
>>2035284
I suspect they mean an electronic speed controller (ESC) for a brush less motor.

>> No.2039543

>>2033493
When can I buy the RISC-V edition of ESP32?

>> No.2039734

>>2039521
Personally I'm not sure. From what I read it's to change initial settings of the attiny like clock speed. Though I've never had to do that. I just flash the attiny 4313 with my arduino and it all works no issue.

>> No.2039813

>>2033493
Weird question but how do I make a raspberry pi's output readable in a mirror, but unreadable straight on
I don't know how to ask this question to google because everything related to display mirroring is just copying a one screen's output to another

>> No.2039816

>>2039813
Nvm it's probably
xrandr --output --reflect-x

>> No.2040103

>>2039734
>From what I read it's to change initial settings of the attiny like clock speed.
wherever you read that from it's wrong. any code running on a micro can change any setting and access any location in memory.

>> No.2040112

>>2040103
I have never seen any code on a micro change it's initial fuses. Everything if ever used has to have those settings set initially. How would a pic16f877 change values on 2007h? That controls a lot of its starting attributes like write protect from

>> No.2040113

>>2040103
>the hacker knows as 4chan doesn't know about fuse bits or option bytes

>> No.2040122

>>2040103
Someone's never heard of security features

>> No.2040190
File: 947 KB, 916x988, file.png [View same] [iqdb] [saucenao] [google]
2040190

What are these little fuckers called? The Chinese love being wordy with their product names to catch as many keywords like they can so I can't find them except from shitty manufacturers. I bought a couple for SOICs and I can't put them in except by bending the leads to cram them in diagonally.

>> No.2040204
File: 197 KB, 2123x1375, 1593844375957.png [View same] [iqdb] [saucenao] [google]
2040204

>>2040190
test sockets, ZIF sockets, etc.
>I bought a couple for SOICs and I can't put them in except by bending the leads to cram them in diagonally.
there's two sizes of SOIC. you have the larger chips and the smaller socket. just get the wider socket and everything will be fine

>> No.2040215

>>2040204
>you have the larger chips and the smaller socket
Everybody and their uncle labels them as shit like "SOIC SOP DIP adapter universal" which, unfortunately, doesn't look like it actually is universal. Wasn't aware they came in different sizes though, thanks; can't seem to find any wide ones on Amazon though, sucks.

>> No.2040430

>>2040190
I've used them before, they were called "SMT Test Socket"
They may go by SMD test socket too.
>https://www.mouser.com/Tools-Supplies/Accessories/Adafruit-Accessories/_/N-drsu7Z1yzvvqx?Keyword=SMT+test+Socket&FS=True
There's a few hits on mouser. Unfortunately they aren't too popular, so prices will be high and they will go by various different names.

>> No.2040874

>>2033493
currently working on a nice arduino project of voltage, current, power and power factor metering with a on/off relay with soft start. metering would use power line communication using a poorly documented, unreviewed, obscure chinese module (ssc1642 chip based). I would need to reinvent the wheel for protocol features like collision avoidance/contention and forget about stacks like tcp/ip.
I thought of the naughty idea of coupling LoRaWan modules on the power line bus with adequate filtering, but impedance matching would be a pain in the ass and with that fairly high insertion loss. But if I keep the power at low levels I would not fry the module I think, and it could have an edge over free space transmission. and fuck the fcc.
what do you think ?

>> No.2041131
File: 241 KB, 940x562, 1593847540355.png [View same] [iqdb] [saucenao] [google]
2041131

>>2040874
power radiated = power lost. be careful not to build pic. or worse, hope that the electrician who wired your place left the cables and clamps irregular and thus avoided building a tiny Yagi antenna with isolated elements at just the wrong frequency, either because it is efficiently radiating your signal, or because radio signals on that or another frequency are received efficiently into your network, overloading all receivers
FCC = jannies

>> No.2041254

>>2041131
nice post. I think the power cables could work as a parallel transmission line until they reach the power meter. since it has some filtering, it may be seen as a high impedance termination. now since the neutral is some times tied to ground in some earthing schemes before the meter, that would probably unbalance the line, and radiate power away. not good for a parallel line.
Now when cables meet at busbar level, that would be a mess indeed and branch a number of transmission lines in parallel. I think each installation would have different characteristics. unless I install a mini auto tuner on each module, that is basically unmatchable.
Will do some tests with a VNA just for the lulz. if the high pass filter is designed properly, I should not fry the VNA with AC voltage. I hope so.

>> No.2041459
File: 118 KB, 1280x720, photo_2021-02-26_19-02-15.jpg [View same] [iqdb] [saucenao] [google]
2041459

>>2036565
why are electronics so comfy bros?
mcp2515 as can bus receiver done from the arduino side, pretty easy, libraries and tutorials exist.
The texas instrument one will be slightly harder, but I'm getting there.
Thinking of just getting it running first through tivaware spi library, for the gratification..
Then actually programming the board from a lower level

>> No.2041483

>>2041459
which pin do I use as an attach interrupt on tm4c123G?
From the mcp2515 INT

>> No.2041549

>>2041254
>I think the power cables could work as a parallel transmission line until they reach the power meter.
unless you're at the end of a branch circuit, what about stubs?
>it may be seen as a high impedance termination
only if it's tuned to the correct impedance at the choice of frequency
also it's not the load, it's just a speed bump on the way to the low-impedance voltage source on the other side
>a mini auto tuner
which is just what high-speed wireline modems do
>I hope so
post VNA results or smoking crater

>>2041459
>Thinking of just getting it running first through tivaware spi library, for the gratification..
not just the gratification, but to remove one variable from later work and experimentation
>comfy
you're still in the digital world tho, and not really pushing the limits you don't know are there yet. enjoy the innocence while it lasts

>> No.2041560

>>2041459
after using multiple arm micro platforms from different vendors i'd say the tiva series is probably one of the worst based on the software libraries.
CCS sucks as an IDE, GCC compiler is shit (TI compiler is still only C98 support iirc) and the tivaware library is a binary file so you can't see or tweak the inner workings to suit your application.
never, seen another manufacturer give a HAL library as a binary. usually its all source down to the register accessing.

>> No.2041612

>>2041560
oh yea, I thought the library as an .exe was rather weird lol

>>2041549
>you're still in the digital world tho, and not really pushing the limits you don't know are there yet. enjoy the innocence while it lasts
Yea I've got a long way to go, do you know of any roadmaps in terms of learning mcg development?
Or how it tends to go in general?

>> No.2041618

>>2041560
>never, seen another manufacturer give a HAL library as a binary. usually its all source down to the register accessing.
TI's application processor groups have been unusually hostile to FOSS. the Sitaras (BeagleBone Black) were a singular exception, apparently. even now they still seem to think of the PRUs as an accidental pregnancy they'd rather forget about

>>2041612
imo you're not really doing electronics until you're doing analog, explicitly, rather than implicitly through a digital lens. see /ohm/'s OP, section Principles, for some goodies that will get you started

>> No.2042120
File: 16 KB, 519x164, file.png [View same] [iqdb] [saucenao] [google]
2042120

I'm a tard, can someone help me figure out why stripColor isn't mapping and ALWAYS returns the first value it tries to map to? In this case Red, but if I replace Red with any other of the colors I have here it always gets set to that specific color and isn't interpolated.

>> No.2042128

>>2042120
Turns out I really am a tard. can't delete that post but the issue was that of course a value that's zero gets mapped to the lowest possible value.

>> No.2042191

>>2042128
You are also using an uninitialized value

>> No.2043127

>>2041618
>imo you're not really doing electronics until you're doing analog
Ah, I meant to say programming microcontrollers is comfy then

>> No.2043224

I have spent years of my life fucking about with microcontrollers. Is there anyway to make money with this or should I just be happy to settle with it as a hobby?

>> No.2043287

>>2043127
true, that

>>2043224
on /ohm/ an anon once built a light show for a girl DJ group under extreme time pressure out of PICs and a digital audio EQ chip
if you know electronics outside the controller, you can do all sorts of things

>> No.2043348

>>2043224
You can always have a dayjob in it.

>> No.2043484

>>2043287
>>2043348
But what is the dayjob?

>> No.2043578

>>2043484
Designing PCBs and programming the attached MCU. That's what I'm doing at least (the latter that is, I'm still pretty clueless when it comes to analogue, for now).

>> No.2043618

>>2043224
Junior embedded software jobs?
relevant degree + hobby projects helped me land a job for this summer

>> No.2044329

>>2043484
inventor

>> No.2045266

Are there any cool useful arduino/micro controller projects to start on to learn it. I've been wanting to get into it and learn about it but have never really had a good idea to motivate me to actually try. Every idea I have seen seems useless after actually making it.

>> No.2045542
File: 214 KB, 1250x377, 1611507813052.gif [View same] [iqdb] [saucenao] [google]
2045542

>>2045266
not unexpected. but at least you're actually making up ideas and then implementing them. that's a capability that will help you
what is useful will vary according to the person. maybe you need a desk clock but only have some weird surplus display. maybe you want an appliance monitor so you don't have to go to the basement/garage/laundry room until the washing machine is done (would you like to learn Bluetooth, Wi-Fi or nRF radio? line current monitoring, accelerometer, or an electret mic listening for the buzzer?)
/mcg/ needs a roll list like /ohm/'s I think

>> No.2045721

>>2045542
I did come up with a idea to make an antenna tracker for my fpv drones and shit, but I feel like I will never use it. I think I just need to fucking buy the shit and just try it.

>> No.2045734

>>2036140
Once you start looking to make money it ceases being a hobby and becomes a job. Another chore to grind to daily, no longer just a fun thing you do to relax.

>> No.2045737

>>2045721
Are you me?

>> No.2045744

>>2045266
I wake up at irregular times and I wanted to have coffee ready right as I was out of bed. My gf wakes up later than me so I built a voice command controlled system but during development we got an espresso maker which needs to be loaded right when you make coffee, so now I use it mostly to play/pause Spotify or initiate white noise when the kids upstairs are noisy and I wanna sleep.
Honestly just make a retro game at first or something.

>> No.2045799

>>2033998
The fucking misers removed the nice tantalum caps and the SOT-223 linear regulator. Now we get a shitty little SOT-23-5 linear regulator on the blue pill

>> No.2045843

Here's my survey of a week investigating about developing GUIs on an STM32F746 Discovery board and having a go.
>TouchGFX
Officially supported and actively developed by STM, nice graphical designer, nicely ordered development framework, encourages you to keep everything in order.
VERY basic in terms of components and widgets, you will have to spend a good amount of time rolling out custom components, documentation and tutorials in general is shit.
Won't use it because I wan't there to at least be a basic keyboard, don't want to make that on my own, these are things that you should take for granted in a GUI library for touchscreens.
>QT for MCU
Massive support, very good documentation and an awesome IDE.
But it costs a lot, 233/month, also you really can't get a license "to learn, get your hands dirty, whatever" unless you are part of a university and get into their educational program.
Won't use it because I can't afford it for my personal project and I can't be bothered to go through the hoops to get an educational license
>LVGL
Decent documentation, lots of examples, vibrant community and a decent amount of components to roll out your basic interfaces, also seems to support everything from Arduinos to the STM32F746 at 216 Mhz.
It has no IDE, one is coming out soon tho, in the meantime write your interfaces in plain code.
I will use this because it won't make me break the bank and I won't have to waste time reinventing the keyboard.

>> No.2045845

>>2045843
If anyone knows how to ge QT for MCUs for free in a more or less painless way I'm listening

>> No.2045847

Hello! I've been looking to buy an AVR Dragon as I want to start writing C. But, it's pretty hard to find.
Has it been discounted from production? Or I just had bad luck? If it's not being produced anymore, is there a successor to it, and what is its name? If it does not have a successor, what are the alternatives in the same price range and with the same functions?
Thanks!

>> No.2045869

>>2045847
>as I want to start writing C
You can get literally any micro that has a gcc toolchain for it and write C. I recommend STM32 but if you like AVR just get an Arduino. OCD will not help if you're a beginner, it will probably just confuse you. However, get one anyway. STM32s have ST-Link, AVR probably has something similar.

>> No.2045906
File: 1.79 MB, 1500x1500, 1602910228628.png [View same] [iqdb] [saucenao] [google]
2045906

>>2045799
>muh big friendly colorful plastic shapes
cercaps are superior in every way to tants, except for cost at fairly large C*V ratings, and microphony which is usually a don't care on a power supply rail
if I got my way, they would have added a 2A buck for the 3.3V supply

>>2045869
seconding your recommendation, STM32 esp the bluepill is a well known quantity with less than 1/10 the suck of arduino
AVR has debugWire, but I've never used it, only UPDI for programming

>> No.2045908

>>2045869
AVR is not a bad architecture, but it does have one annoying thing. It has separate code and data address spaces, so in C, constant strings get copied over on startup, and pork up your RAM space unless you use the PROGMEM attribute on your pointers. This was probably more of a problem in the past when chips were made with smaller RAM sizes. It's best if you don't have to give a fuck.
I first encountered AVR in 2008, and it's okay for assembly language and small Arduino stuff, but then I worked with STM32 in 2010 and it was a great improvement in so many ways.
Just use the Arduino bootloader for AVR stuff, it's so common that there's rarely any reason to not use it, and use an STLinkV2 clone for STM32 stuff.

>> No.2045933

>>2045908
>It has separate code and data address spaces
unified in some versions of the architecture, iirc
>Arduino bootloader for AVR stuff, it's so common that there's rarely any reason to not use it
but if you never program the bootloader, you never have to bend your ldscripts to deal with it, never have to wait for the startup pause, never have to restrict the usage of the two serial pins, can use it on devices without a USART, etc. there's literally no reason TO use it other than a shitty 15-year-old board support package that trained everyone into that workflow

>> No.2046223

I'd like to create some kind of VU meter for a DJ controler. I've seen some cool bar LED arrays that would do just that but I'd need to connect all their pins to my uc, which kinda sucks. Is there some kind of "binary to LED array" driver chip that would exist and free me some pins ? It's my first real big boy hardware project so I don't really know all the specifics.

>> No.2046228

Anyone have any experience with GPS breakout boards?
Are the ones from Adafruit any good?
Would be coupling it with a Precision NXP

>> No.2046230

>>2046223
There's the classic LM3914 which is specifically for VU meters. You don't even need a microcontroller.

>> No.2046300

>>2046228
I bought a Quectel L80 on ali for a very few $ and wired a pin header to it. wasn't hard to get NMEA sentences out of it

>>2046223
y tho, it's not going to be accurate or useful in DJ work
>complaining about too many wires
that's what custom pc boards are for. if you can deal without the bar graph maybe you could do something fun with a MAX7219 LED module, just talk SPI to it. still not sure what it would actually tell you in a timely fashion, I hear latency is important in digital audio production
do what other anon suggested, find an LM391(4|5|6) VU meter application example and build it

>> No.2046372

How do I know which FPGA to choose from?
I'm thinking of getting this one along with the programmer (does it work as an logic analyzer?):
https://aliexpress.com/item/1005002121650778.html
My questions are:
How do I know whats the operating frequency of the FPGA? Lets say I want to implement a decimate + average filter from a parallel signal, additionally, is there any change if I want to implement an LCD controller apart from the previous stuff?
Is the ice40LP better than the model i'm planning to buy? why? From what I've read, the devboard I'm planning to buy works at a higher speed than the ice40LP one.
Thanks.

>> No.2046429

hi friends. i just got an esp32 and right now i want to see if i can do an https post request.

right now ive only seen examples for posts on arduino, but on esp-idf (im using this) i only see examples for http gets. can someone show me or help me find and esp-idf example?

>> No.2046482

>>2046372
>Lets say I want to implement a decimate + average filter from a parallel signal
the place-and-route can trade area for speed. it's hard to find timing specs for FPGAs. the best way is to download the design software, implement your design in HDL or schematic, and compile it to see what a naive approach produces. you can enforce some minimum speed by adding clock constraints. the design compiler will duplicate resources, work harder on place and route, etc. in an effort to meet your spec
>Is the ice40LP better than the model i'm planning to buy
idk, depends on the board. some iCE boards have HDMI outputs which you can drive, if you're into that
iCE40 are OTP but they can use an external 25 series SPI flash for booting
EP4C are EEPROM and come on instantly
>does it work as
it might, some assembly required. there is probably a project for it. check sigrok's support list
>any change if I want to implement an LCD controller
not really, add it in, assign pins, program it.

>>2046429
esp_http_client_set_post_field is how you send POST data. be sure you have Content-Length: and Content-Type: headers, but watch out for https://github.com/espressif/esp-idf/issues/2047

>> No.2046508

>>2033493
hey guys can a canamaker nano c program a atmega328p-u ?im looking for a cheap way to program a mcu and found it. its a generic arduino nano clone.

why mega? every one was complaining about attiny85 not having enough space for code years ago. thats all i find when i google how to program one besides generic youtube vids of people using shields

>> No.2046522 [DELETED] 

Can emacs be setup for STM debugging? All the guides I'm reading for my dev board are telling me to use VSCode with an add-on called Cortex Debug

>> No.2046527

>>2046372
Download the cyclone iv datasheet and search for "mhz" and you will see the limitations of various parts of the chip.
What's the frequency of your parallel signal? Your filter could be running at some multiple (1x, 2x, 3x, whatever) of the input signal frequency. You don't need to run the fpga at its limit to do useful work.
Also depends on the latency you want. If you're running the filter at 1x your input frequency that means you'll need a deeper pipeline and more resources to do your filtering in 1 clock per input signal value.
There are a few ways to skin this cat, it depends on what you wanna do...
If you're doing audio frequencies you have a lot of frequency head room with that device and this isn't a problem.

>is there any change if I want to implement an LCD controller apart from the previous stuff?
No, you can run it off a separate clock. Or you can derive the clock from your filter's clock, or vice versa.

>> No.2046541

>>2046372
>I'm thinking of getting this one along with the programmer (does it work as an logic analyzer?):
I wouldn't suggest getting a FPGA that's not supported by the open stack today.
Look into icesugar and nanodla, available in aliexpress.

>> No.2046542
File: 29 KB, 612x431, 1596691644695.png [View same] [iqdb] [saucenao] [google]
[ERROR]

>>2046372
For getting started, something iCE40 based, like the icesugar mentioned above.
If you need some oomph, look at ECP5, such as the ULX3S.

>> No.2046553

Blackpills vs the equivalent Nucleo-32 board, pros and cons?

>> No.2046554
File: 496 KB, 1000x707, Hbc6983378127432a8751f61e52675d61M.jpg [View same] [iqdb] [saucenao] [google]
[ERROR]

Anyone have one of these TTGO T5 boards?
V2.3_2.13
The documentation is horse shit, I'm just looking for a basic example file to work the screen.

>> No.2046561
File: 8 KB, 897x34, 47088177.png [View same] [iqdb] [saucenao] [google]
[ERROR]

>>2046554
What do they mean by DC? I don't see it on the pinout

>> No.2046598

>>2046522
STLink can be made to work with gdb, so if you can make your editor work with gdb then you can do it.

>> No.2046625

I'm still trying to figure out what FPGAs are good for over microcontrollers, especially from a hobbyist point of view (I'm starting to think there isn't anything)
From what I can tell, to do anything useful with one you need to be part of a design firm with the funds to purchase "IP" which are pre-designed FPGA HDL libraries that can actually do stuff efficiently, and without those IP libraries you're kind of boned unless you have a PHD in DSP and computer science

>> No.2046627

>>2046625
I guess as an adjoinder, my current autism of the week is linear predictive coding. This involves doing a shitload of linear algebra number crunching and solving a *lot* of matrices. Would this be the kind of work that an FPGA would be better suited for over a microcontroller?

>> No.2046648

>>2046627
depends what you define as "microcontroller"...
>especially from a hobbyist point of view
its the other way around. from a hobbyist point of view, theres not much you _cant_ do with an fpga. youre just not very creative.
from a commerical point of view, thats when things get tricky. you can mine bitcoins on an FPGA, but i suspect a GPU will still give you better bang per buck these days (but don't quote me on that.) Similarly, you can use it for various numerical problems, or you can just use a run-of-the-mill high end CPU and beat it on clock speed and multithreading.
FPGA is just another engineering solution. its not "FPGA vs CPU" or whatever. just different arbitrary tradeoffs, and its up to you to select which ones you can live with.
>Would this be the kind of work that an FPGA would be better suited for over a microcontroller?
what is your definition of "better suited"? non-trivial FPGA chips are not cheap. multicore ARM SoCs with NEON fp instructions will be 15% the price i reckon. but whether they provide you with good enough performance, you will have to benchmark.

>> No.2046651

>>2046648
I wouldn't say I'm not creative; it's like handing a drawing tablet to an 18th century painter and telling them to make art. They could be Rembrandt and still couldn't do shit if they don't know what to do with it.

I have a solution that's looking for a problem and I want to learn how to use it. Unfortunately I have a single digital systems course under my belt with a rudimentary understanding of verilog.

My definition of "better suited" in this case is in the sense of a CPU vs a GPU for parallel processing. CPUs suck at it while GPUs are designed for it.
So I'm trying to see if, for example, an iCESugar FPGA would make a good DSP co-processor to accompany a bluepill for DSP number crunching (for linear predictive coding, filtering, FFT, etc)

>> No.2046681

>>2046625
>>2046651
A buddy told me he spent a lot of his career writing embedded software that helped companies movie away from fpgas, because modern multicore embedded processors have so many features and so much computing power that it makes this possible.
NXP makes 16-core ARM processors (layerscape), and the i.mx8 has 8 arm cores and a GPU which can be used for signal processing.

A low end fpga like that 6k LUT cyclone IV, which is the smallest fpga in that family, can't really compete with today's processors for mere common number crunching tasks.
>(I'm starting to think there isn't anything)
You're not wrong...

>> No.2046694

>>2046508
USBasp are cheap af, why not that instead

>>2046561
data/command, register selector, A0, whatever
I don't see an IO 8 anywhere, might have to trust the code over the duino pinout chart

>>2046625
FPGAs are niche, but not completely useless to the hobbyist. they are common ingredients in things like home-brew logic analyzers, video/waveform generation, high-speed serial communication, matrix controllers, memory bus peripherals/monitoring (from SDRAM/DDR controllers for old parallel buses, to MITMing 100Mbps Ethernet), and other things with 10s of MHz clocks. it's also nice not to have a fuckload of 14-pin logic all over the board (imo). it's just lots of logic in a different, more editable package
and of course just large logic projects, prototyping and replacement. many 1980s custom home computer LSI have been replaced by an FPGA/CPLD
>funds to purchase "IP"
a lot of IP is free, and you can write your own

>>2046627
it could be. you can unroll those matrix math loops into hardware and eliminate the loop instructions, or unroll those overall sequences into pipelines and process them in parallel. I've even heard of PhD fags doing bit-serial DCTs with an FPGA. think of all those on-chip multipliers you can use to process massive data
usually you would use the FPGA with an external processor that has the bandwidth to steer data into and out of the FPGA (many MCUs in large packages have a suitable external bus interface), or implement some kind of programmable sequencer on the chip (see KCPSM2)
in this case, unless you're compressing audio en masse for glowie surveillance or something, you won't need the level of performance the FPGA will offer. when you do, you'll be glad it's there

>>2046681
there's more to electronics than computation. you have to /g/o back

>> No.2046705

>>2046694
>there's more to electronics than computation. you have to /g/o back
I know electronics and I know very well what the capabilities of FPGAs are, don't /g/ me nigger. For what *this guy* wants to do, which is number crunching and digital filtering, he is not wrong thinking that a processor will do the job.

>> No.2046854

how do i go with choosing the mcu manufacturer?
I've got the specs for my mcu and I'm looking at nxp, microchip, stm and ti.
Do i pick the one with more community? better ide ? the cheapest ?

>> No.2046860

>>2046854
Do you have a goal or just want to jump in and learn something? If you just want jump in to a new hobby, honestly you should probably just STM it these days, especially if you want prebuilt boards, tons of code and tools. Microchip if you want to adapt older projects / work with bare chips. TI if you hate your bank account or just want something difficult no one here can help with much. Not familiar with NXP.

>> No.2046902

>>2046705
there's a whole world outside the fuckin chip. data transfer, fusion, and conversion is a very common FPGA task. these smaller ultra-low-density devices are perfect for it
>>I'm still trying to figure out what FPGAs are good for over microcontrollers, especially from a hobbyist point of view
that was an open-ended question. where do you draw the line for hobbyists? arduinofags? people scared to solder SMT? people who give no fucks about microseconds? agree that they won't have much use for programmable logic. but processor core designers and other datapath designers, those involved with digital video or digital signage, or others who are concerned with nanoseconds but aren't buying the sort of quantities that make custom hard peripherals worth buying

>>2046651
>suck at it
you have to define this tho. external concerns, like what interface at the input or output
>iCESugar FPGA
>LP1K
only 1k LEs. those chips are designed for low-speed, low-power tasks like polling serial buses and buttons while a main processor is sleeping, and figuring out when the user on the other side of the sensors wants to wake up the device. a very small instruction sequencer can be built in about 100 LEs. a standard board-level serial bus like SPI or I2C costs about 80 LEs all-in. adders take 1 LE per bit. and so on. in practice only about 80-90% of LEs can be used for your logic, as some will be reserved for routing purposes

>>2046854
manufacturer IDEs almost always suck as much as they can get away with
communities are filled with amateurs who don't know what they don't know
price matters, but it depends on how many and what package/form you would buy in the future
price/availability of programming/debugging hardware is also important. SWD isn't quite universal, there is usually a bit of vendor BS involved. a native USB DFU bootloader is pleasant
if in doubt, ST has very good community support, many IDE/HAL choices, cheap ST-Linkv2 dongles, and good price/performance

>> No.2047098

>>2046694
actually they are about the same at the cheapest end. im new to micro controllers but i do a few days worth of reading and searching before buying anything. the problem is every one seems obsessed with the attiny85 and im buying atmega328s so there werent a bunch of references and what i found required ones that were not the same item. they speak of drivers but interwebs are a cruel mistress. as of today my browser has changed forever and now i am notified of dead links with a funny reference to a wayback machine. much of what was posted even a year ago on instructuctions for mcus seems lost forever like tears in the rain. even part listings for fucking screens.

i feel like i am arriving to the party way late and everything is about to be liquidated so they can sell every one a new pipe dream like going to mars but in reality your just literally turned into dog food and they deep fake prerecorded messages to send to loved ones while the government steals all your money. time share esk fly by nights that are meant to steal generational wealth for 3rd worlders sake robbin hooding a "better world" while everything goes to shit and i cant buy a 240 x 160 dot matrix display that was sold just last year and the website is gone... wiped away from this world

speaking of which does anyone know a arduino friendly 2 inch or so display ? adafruit shit allegedly makes it constipated and wont have a good refresh rate

>> No.2047198

>>2046651
>>2046902
>iCESugar
>LP1K
WTF? iCESugar uses UP5K.
That's the newest iCE40 subfamily, and 5K LEs,
There's only two iCE40 chips with more LUs, and they're older. (HX8K/LP8K)
Need any more than that, just go for the ULX3S.
>1K not enough
iCESugar is 5K, but for getting started and for many uses, 1K is plenty. I got started with an iCEStick, which is actually an HX1K.

>> No.2047205
File: 95 KB, 850x400, 1612714598553.jpg [View same] [iqdb] [saucenao] [google]
2047205

>>2047098
you mean like this?
the biggest limitation in display speed is the bus. the next biggest is the library. I2C bitmap displays will always be slow unless very small. you def want an SPI interface which you can pump data into faster
240x160 is kinda big for an 8-bit micro unless it has its own RAM and its own high-level drawing primitives

>>2047198
I meant the sugar nano, sumimasen
the possibilities do get more interesting at 5k, I agree, esp with hard core peripherals not counting against your gates

>> No.2047214
File: 2.36 MB, 2560x1440, 1593955072058.png [View same] [iqdb] [saucenao] [google]
2047214

>>2047205
I own one, and believe iCESugar is very nice at its price.
I've also got a bunch of other iCE40 devboards, such as the iCEStick I mentioned, and the tinyfpga-bx, which is now unobtanium.
From my own experience, I'd say grab an iCESugar, and once you need to go a step up, look at the ULX3S (ECP5-85K, a significant jump).

>> No.2047225

Ok guys, from what I see, an 8-bit 100 Msps ADC USB oscilloscope with a bit of DSP might be too much for the icesugar-nano (and maybe even form me lmao) considering I don't know enough about FPGAs to even be able to properly choose one for the project.
What about a sigma-delta modulator ADC (for audio, so 2.8224 MHz) + some DSP, could it be possible on the icesugar nano?

>> No.2047235

>>2047225
>what about a sigma-delta modulator ADC (for audio, so 2.8224 MHz) + some DSP
The I/O part (and the sigma/delta function) sounds too easy to do, even on simpler FPGAs. It's up to how much DSP you want.
>icesugar-nano
Get an iCESugar proper. A nano on the side can't hurt, but 1k is easy to hit, particularly as block ram is a factor for many applications and they're also short on that.
(same shop sells nanoDLA, a very simple and cheap 8ch logic analyzer that works with pulseview/sigrok and which you should get as it'll help you a lot if you're screwing around with FPGAs)

>> No.2047260 [DELETED] 

Is it a huge loss in performance to go from a Cortex M7 to a Cortex M4? I'm developing an audio effect on a dev board running an M7, but I think the current draw (300ma I think) is too large for the product I want to develop (guitar pedal), which explains why all the highend pedals are using Cortex M4 instead

>> No.2047395

>>2046854
I personally prefer microchip SAM and use atmel's ASF3 HAL which has everything all at once.
STM32 is good too if you don't mind the configurator.

>> No.2047444

>>2047205
well i was going for a bigger screen not more used pixles. i figured i could jew it to display 1/4 resolution on the same number of pixles. its just looking at the smaller screens is sad. like you can tell all those faggots with the keychain diy single chip game went half blind trying to play that shit and i dont want to go that route. not me. to many bills im not sucking dick for lens crafter money

im pretty sure its possible some one did a atmega64 emulator and outputs vga but isnt ever displaying true resolution on the screen

as far as whats drawn i did some reading and i think i can bitlash zelda room loads. so the game mechanics and hitdetec dummys are always there but all visual assets are loaded per room minus player character and the tiles and enemy ai and sprites load per room

also im not sure if this matters but i dont intend on using anything but monochrome even though its color screen. so if i can jew ada script with all color is either (R0,G0,B0) black or (R0,B50,G50) bluegreen then multiple clock cycles to determine color of pixle could be nulled and full resolution used

>> No.2047551

>>2033493
can I emulate common microcontrollers and their modules using QEMU?
I don't want to buy the modules yet and I want an easy environment to test on, I think QEMU would let me inspect anything that would go wrong with the software I write.
I'm specifically interested in STM32 and PIC32.

>> No.2047575

>>2047551
No
The whole point of microcontrollers is to be able to have a computer that's able to communicate with the real world
Buy a cheapo Arduino board

>> No.2047583

>>2047551
what do you wanna emulate ?
I once used it to emulate a bluepill to test my timer code because i didn't have any smt32 laying around.
>I don't want to buy the modules yet
a nucleo is 20-30 $

>> No.2047584

>>2047583
essentials protocols such as i2c, uart, bluetooth, ethernet and maybe even wifi if possible?

>> No.2047596
File: 145 KB, 2000x1334, 87b5-SS-101020023-1-0-2-1000x667.jpg [View same] [iqdb] [saucenao] [google]
2047596

i have an orangepi PC and a seeed sound sensor for arduino. do you guys think its possible to use this sensor with the orangepi? i have very little experience with microcontrollers, want to make my orangepi listen to the doorbell and send me a telegram message when it detects it.

>> No.2047609

>>2043618
>hobby projects
What are they? Genuinely curious as I'm starting to look into projects

>> No.2047610

>>2047260
put a 4MHz buck converter in a can on the far corner of the board. they'll never notice

>>2047444
all that would help

>>2047583
>I once used it to emulate a bluepill to test my timer code because i didn't have any smt32 laying around.
it emulates MCU timer peripherals now? or just systick?

>>2047596
maybe, you should check with a voltmeter if the sensor will run at 3.3V, if you already have it to hand
>want to make my orangepi listen to the doorbell
better idea, add a 24Vac relay, coils in parallel with the doorbell chime and contacts to the GPIO of your choice
the orange pis generally have their own microphones built-in, fwtw

>> No.2047660

>>2047260
profile your code with systemview, your results will most likely surprise you that the processor spends most of its time idle.
and if you're not already use sleep states during idle time so you're not spinning in a loop waiting for an interrupt or event to occur.

>> No.2047671

>>2047551
>>2047584
People have made ports of qemu for stm32 and pic32
Never used them so I can't speak to their capabilities. Google qemu stm32, check their product pages

>> No.2047683

>>2047671
>product
Oops I meant to say project pages

>> No.2047691 [DELETED] 

>>2039445
This is what I had to use for burning the micronucleus bootloader onto a fresh attiny85 custom board using a similar arduino as ISP setup.

C:\Arduino-1.8.1\hardware\tools\avr\bin>avrdude -CC:\Arduino-1.8.1\hardware\tools\avr/etc/avrdude.conf -v -PCOM10 -b19200 -pattiny85 -cstk500v1 -U flash:w:t85_default.hex -U lfuse:w:0xe1:m -U hfuse:w:0xdd:m -U efuse:w:0xfe:m

>> No.2047696 [DELETED] 
File: 88 KB, 620x531, meris_enzo_01-A472y.2VGbQYWmrN0.xYnDFRweCvvZvp.jpg [View same] [iqdb] [saucenao] [google]
2047696

why do most high-end digital guitar pedals use a cortex M4 instead of M7? is it mainly for lower cost and lower current draw?

I am currently developing an effect on a dev board using an STM32H750, and it needs 350ma current for the whole board (~300 for the mcu + 50 for other). I'm wondering if I can just use a lower-clocked cortex m7 to get to 250ma total or under. The reason <=250ma is desirable is because if you go any higher, than you would be expected to include an external power supply when you sell it. sorry for dumb noob question

>> No.2047710 [DELETED] 

>>2047696
Sorry I realize this is a duplicate question, I just didn't word it well previously

>> No.2047743

>>2047671
neat

>>2047696
>developing
>on a dev board
that's not how you spell "power optimization"
>I'm wondering if I can just use a lower-clocked cortex m7
probably, did you try slowing or stopping the relevant core and peripheral clocks in Cube

>> No.2047764

>>2047551
>can I emulate common microcontrollers and their modules using QEMU?
maybe but you don't want to. HW sometimes has bugs you won't find until you actually test with it.
for example a ICM42605 IMU has a HW bug when using the i2c interface. during initialization if you send a specific byte sequence which is done in their example code it causes the device to "let go" of sinking the SDA line during ACK for approx 500ns before the master sends the stop sequence. if you're using an FPGA or a micro that generates a HW interrupt on stop detect you get two interrupts.
>I don't want to buy the modules yet and I want an easy environment to test on
tesing SW without HW will only get you so far. you can't really break HW with SW so just buy it and start testing.
>I think QEMU would let me inspect anything that would go wrong with the software I write.
so will any IDE. you get the full register inspection for CPU and all peripherals, stack trace, instruction trace, etc. Get a Jlink EDU and you can even add systemview to your project to profile code execution frames in realtime to see when things run or when interrupts fire.

>> No.2048214

Is there some general guide on how choose microcontroller?
Like of course it should have suppliers.
It should not be too new to see if other people have had issues with them.
Estimating program size and memory needed is kind of hard.

>> No.2048306

Anyone here have experience with coding TFT displays, specifically the ILI9341, but without a library and on STM32s?

>> No.2048308

>>2048306
I think I did 10 years ago, but we used a 100-pin F103 and its fake ISA bus mode.

>> No.2048317

>>2048214
Most any circuit design handbook today will have a chapter on microcontroller selection.
>Estimating program size and memory needed is kind of hard.
You make a proof of concept or prototype first so you can work out issues of program size / memory size early.
In my opinion estimating memory use it isn't a big deal but I've been coding a long time.

What's your application?

>> No.2048326

>>2048308
Im trying to wrap my head around using an STM32F0 with a ILI9341 no matter what i do all i get is a white screen

>> No.2048329

>>2048306
>>2048326
Try it with a library first, just to verify that the hardware works correctly.

>> No.2048342

>>2048214
selecting microcontrollers off-the-shelf is hard because you are always making compromises and trade-offs between parts and will almost never get exactly what you want. unless you have very specific and particular requirements, including but not limited to
>rare or fast serial buses
>extremely low power-down current consumption (<1µA)
>true 5V I/O
>fast and/or high-precision ADCs
>advanced timers
>external memory interfaces/FIFOs
>crystal-less USB
it's best to choose from the well-beaten path. nobody ever got fired for buying STM32F103, even though its I2C is buggy

>> No.2048356

>>2048342
could you elaborate on 103 i2c bug? just wanna know in case im ever forced to use it

>> No.2048382
File: 66 KB, 693x307, 1586296817981.png [View same] [iqdb] [saucenao] [google]
2048382

>>2048356
get the errata sheet. 2.14.1 and 2.14.2 impose strict timing requirements for interrupts servicing multi-byte transfers, which could interfere with anything else you are doing in code that also has strict timing requirements. 2.14.5 breaks higher clock frequencies (above 88kHz) in standard mode. the workarounds are kind of cringe (use DMA mode instead of interrupts, don't use those particular clock freqs, flip the I2C port pins to GPIO mode briefly to unstick internal registers)

>> No.2048468

>>2048356
>just wanna know in case im ever forced to use it
why would you ever be forced to use a 8 year old micro?

>> No.2048480

>>2048468
>why would you ever be forced
perhaps it's already on some board you're working with (whether your own or another designer's) and you can't easily exchange it for a more capable device. been there, tried that, lost an I2C port and the serial EEPROM attached to it, had to emulate (poorly) with flash
it'd be great if all MCU application engineering were green-field work, but unfortunately it is not

>> No.2048728

>>2048326
Hmmm... looks like I was using an ILI9335, but the ILI9341 documentation worked.
The guy before me did the initial bring-up, but it looks like he started with a write_reg function, and an init which did a whole bunch of register writes to initialize the LCD. There was also an init for the ISA bus mode of the 32F103 GPIO pins.
You probably can't use that ISA bus mode unless you're using the enormous (100-pin) chip package. Your best bit on a 32F0 to save pins is probably with a SPI interface. It looks like SCL/SDI/SDO are the pins you need. I didn't understand how to do non-destructive reads, but it looks like they thought of it with a couple of other signals.

First make sure if your LCD has a backlight that you turn it on. Can't see shit captain otherwise. Also register 0x07 was set to 0x0133 at the end of init to turn it on.
Then you have to be able to read and write registers using whatever protocol you decided on.
Now make an init function to set up the registers, then try reading all the registers back to confirm that they seem to have sensible values.
Then try to push a few pixels.

To start writing pixels, set IR to 0x20 and write the horizontal GRAM address to CR, then set IR to 0x21 and write the vertical address.
Then set IR to 0x22 (GRAM write/read), then start stuffing pixel data into CR. To skip a byte you can read CR instead of writing. Pixel data was 16 bits, so one write per pixel with my 16-bit mode. SPI seems to be 8 bits at a time.
An important thing is to write a horizontal line function that sends the screen address, then the 0x22 command, then a bunch of pixels, which is faster than setting the address for each pixel.

If you can find a library that works, start with that, then you can hack it the fuck up if you want.

>> No.2048735

>>2048356
All I remember was the ST library code (the pre-HAL library, as Cube/HAL wasn't until like 2004-2005) was complete and total ass. It was comparing a 32-bit status register against a handful of hexadecimal constants. Yes, they were comparing the exact state of *every* status bit at the same time, even the ones not related to what they were checking. What. The. Fuck.
I was using low-level I2C to talk to stuff that was not an EEPROM, and that code was locking up because one or two of the status bits were not the exact states that the idiots were looking for, so fuck it, I wrote my own.
Not related, but I also needed to write an "I2C unstuck" function which took over the GPIO and manually cranked out 9 I2C stop bits or something like that. That way if a reset or crash or electrical glitch happened while you were talking to a device, it wouldn't be stuck in the middle of a transaction until a human came around to kick it.

>> No.2049006

Is my esp32 dead? When I try flashing i get invalid head of packet (0x00) i tried using the buttons, drivers, changing os, usb port, and cable. I heard about efuse s but no clue how to go about that.
https://www.amazon.com/HiLetgo-ESP-WROOM-32-Development-Microcontroller-Integrated/dp/B0718T232Z

>> No.2049058

>>2047764
I only want to use it to learn embedded systems essentials
but yeah I will take your advice and buy some real hardware
thanks anon

>> No.2049206

>>2049058
Not him but it's way more fun doing it with real HW. Ask here (this is a pretty OK general) or in any appropriate forum if you ever get stuck.
BTW, QEMU is slow as shit and you'll have trouble using it with micros (although it's somewhat ok for emulating a raspberry pi)

>> No.2049222

>>2049058
comprehensive on-chip debugging features are the norm for 32-bit MCUs and have been for a while. often there are provisions to select particular peripherals to keep running while paused for debug, e.g. to hold a PWM output level. some of these features are even trickling down to higher-end 8-bit chips. an MCU simulator workflow doesn't offer all that much win in the general case anymore

>> No.2049348

>>2049006
ok so it turns out the pos didnt have enough power. so i uploaded a blink led program where it shouldnt be using much power and it still wont flash. it will only flash if i have an external power source.

>> No.2049410

>>2049348
Turns out even thought the mcu is running hello world it still needs more power than the usb provides and it won't flash. The red led is lighting up but it is dim.

>> No.2049664

>>2049410
usb only gives 100mA unless you enumerate as a high power device in which case you get the full 500mA

>> No.2049674

>>2049664
Ok how can I do that? I also am using a power hub if that matters.

>> No.2049679

>>2049674
>Ok how can I do that? I also am using a power hub if that matters.
Shit forgot to mention I'm on linux

>> No.2049681

>>2049674
by using a microcontroller or other device with USB on that port that can enumerate with a descriptor that has the bMaxPower field set to 0xFA.
see
https://www.keil.com/pack/doc/mw/USB/html/_u_s_b__configuration__descriptor.html

>> No.2049685

>>2049681
I'm really new. So I need to include something in my code that sets that? Or is this on my usb driver?

>> No.2049697
File: 18 KB, 552x421, 1585260419757.png [View same] [iqdb] [saucenao] [google]
2049697

>>2049685
pic related is the flow of a usb transaction when you plug in a device to a PC.
the first thing the host requests is the descriptor which contains the bMaxPower field.
if you don't have a microcontroller with built in USB then you can't enumerate as a USB device.
from your previous posts it looks like you're using an ESP32 which doesn't have USB built in. so basically you're shit out of luck.

>> No.2049701

>>2049697
ah wtf... not even the dev boards have this?

>> No.2049704
File: 643 KB, 1200x900, 1596095527236.jpg [View same] [iqdb] [saucenao] [google]
2049704

>>2049701
there are a million micros out there, no reason to use ESP if it doesn't meet your needs. if you're using arduino to program the ESP and want to keep going with that check out something like this for a wifi + usb application.
https://www.adafruit.com/product/3010

The board you have not only has a usb port for the serial comms. you can't program a custom descriptor with it or anything. with native USB support you can make anything from a keyboard to a webcam.

>> No.2049706

>>2049704
Oh damn I'll try that feather then. Looks much better than the esp

>> No.2049709
File: 105 KB, 960x720, max power.jpg [View same] [iqdb] [saucenao] [google]
2049709

>>2049701
You can use a dumb USB power brick, they don't give a fuck about bMaxPower.