[ 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.78 MB, 1024x679, file.png [View same] [iqdb] [saucenao] [google]
1951783 No.1951783 [Reply] [Original]

If it doesn't work it's because you broke it edition.

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


old boy >>1938160

>> No.1951788

So, who is currently the hot new girl on the block?
ATmega328P used to be the alpha and omega of everything DIY, then ESP32 came around and blown it out of the water, allowing its users to finally blink leds at peak efficiency with dual core CPU.
Is there currently any better general purpose bug than ESP32 within similar price range?

>> No.1951789

>>1951788
True, but AVRs are not flakey, while ESP32 can be flakey.

>> No.1951791

>>1951789
Oh definitely. I had my share of problems with ESP32 freezing from time to time and not working properly, but only when i was trying to do IOT stuff where for example i am connecting to wifi and making requests to https web servers, but if my code is fully canned (as in the esp32 doesn't have to communicate with anything on the internet) i had no problems with it at all, i have some esp32s that are running for several years now without any issues.

>> No.1951801
File: 554 KB, 1920x1080, 1574670156254.png [View same] [iqdb] [saucenao] [google]
1951801

>>1951788
>hot new girl on the block?
New imposes quite the restriction. It has to be new.
Well, I can think of two:
- gd32v (longan nano etc)
- bl602
They're risc-v based microcontrollers. The former has stm32-like peripherals. The latter has fancy wireless connectivity options, like esp32.

>> No.1951803
File: 1.31 MB, 1920x1080, 1574968326027.png [View same] [iqdb] [saucenao] [google]
1951803

>>1951788
>>1951801
There's also the newish gowin family of chink FPGAs.
GW1N-1 based tang nano devboard is less than $10. It works, somewhat, with the prototype-tier code from project apicula, which reverse engineered the chips.

>> No.1951807

I have arduino question, so this
pulseIn(pin, value, timeout)
https://www.arduino.cc/reference/en/language/functions/advanced-io/pulsein/?setlang=it

Measures pulse lengths, and if the pulse is longer than timeout it returns the timeout falue, so if you do say
pulseIn(5, HIGH, 1000000)
it waits for the pin to go low, then when it goes high it starts timing and if the pin remains high for longer than 1 second it times out and returns 1 seconds. But what happens if the pin
1.) never goes high
2.) is high all the time and never goes low

does the time out also apply, or will it be stuck forever waiting for the "raising trigger" (pin to go from low to high)?

>> No.1951813

>>1951807
>will it be stuck forever

While the documentation was written by an underachiever, it's probably safe to assume that any function with a timeout will never hang. My guess is that the timeout starts when you call, and does not restart when the pulse starts, and the function will always return at the timeout if the pulse fails.

>> No.1951814

>>1951807
>t it returns the timeout falue

nah, it returns 0 if the pulse fails.

>> No.1951821

>>1951813
>>1951814
I misread it, the timeout is for the pulse to start, if the pulse raise trigger doesn't happen within timeout pulseIn returns 0.
That is what i needed, but it still doesn't solver the problem if the pulse goes high and stays high, it's not possible to change the timeout for tjhat and the default is 3 minutes so fuck it i will just make my own pulseIn function with two timeouts, it's not like it's that hard.

>> No.1951825

>>1951821
Yeah, I think you're right and my assumption that it won't hang is wrong. The documentation isn't clear about that, but in two places it says the timeout applies to the pulse start. Just for fun why don't you test it? Keep in mind the watchdog timer.

I hate using arduino libraries because you're always chasing open-ended crap like this. AVRs are simple enough to program in assembly language anyway, and stuff just works.

>> No.1951830

Alternatively, there's avr-libc.

>> No.1951835

>>1951788
The Parallax Propeller has always been a favorite of mine. Octal-core controller, with on demand core launching. It struggles in places, but overall is a decent and very flexible controller. Made by Parallax (who made the BASIC stamp), its worth checking out even if for something unique just for fun.
They are close to releasing the Propeller 2, which builds on the Octal-core design and really knocks it out of the park. Lots more memory and speed.
>similar price range?
At $8 a chip, not really. You also need glue: serial memory for boot loader, crystal, ect...
But its still fairly cheap all considered. $15 programmer, but they offer free schematics to make your own.

>> No.1951839

>>1951783
Are there any IDE's or at least compilers for major microcontrollers that run on The Raspberry Pi (ARM arch)? I have a small and portable Pi system that I built and I'd like to code and compile with it on the go. I don't deal with arduino and don't want to deal with web-based IDEs.
I'm just fine coding in a text editor and compiling in the terminal manually, but I don't seem to find anything that supports arm, its all x86

>> No.1951846 [DELETED] 
File: 78 KB, 800x800, INA3221.jpg [View same] [iqdb] [saucenao] [google]
1951846

>>1951350
>>1951478
So I'm going to build my own lab PSU from an pc ATX PUS, and have it driven by an Arduino and a LCD. The PSU already have 30A 3.3v, 30A 5v and 15A 12v out. I'm thinking of driving those directly out and have a variable buck booster attached to 3.3 and/or 5 to have a variable output driven by a digipot. Pic related and some shunts seems to be the solution for measuring the voltage and current. Anything else I should keep in mind before attempting this? (im 3d printing an enclosure and definitly putting in a nice 120mm fan or something, glass fuse for each channel etc)

>> No.1951871

>>1951801
Doesn't have to be fresh new just better than esp32 at similar price.
I am running out of esp32 and i want to order a new batch of 20 so i have a big supply, but at the same time i wan't to make sure there isn't something considerably better available for me to stock up on instead

>> No.1951876

>>1951871
>esp32
>and i want to order a new batch of 20 so i have a big supply
Do put some effort in understanding the new stuff I mentioned, and esp32-s2 (newer part, different in many ways, lower power in exchange for some features gone).
Also, if you're considering esp32 for the radio capabilities it has, do at least look into the nordic semi stuff, and the chink bl602.
https://www.cnx-software.com/2020/10/25/bl602-iot-sdk-and-5-dt-bl10-wifi-ble-risc-v-development-board/

>> No.1951951
File: 40 KB, 666x433, Capture.png [View same] [iqdb] [saucenao] [google]
1951951

>>1951783
Looking to port code from PC to an AT89LP51-20JU (8051 based unit).

I have hex files already made. Will this work, is there a more reliable solution?

>> No.1951956

>>1951876
yeah, thanks,I will have a looksie but i am only going to consider options that have a nice programming language option, like for example the micropython for the esp32, since after being spoiled by comfy high level programming languages, i just cannot force my self to delve into the assembly sewage anymore

>> No.1951969

>>1951951
That is a Pickit 3 clone to program Microchip PIC microcontrollers. If you are looking to program Atmel mc's, get a Microchip SNAP or Pickit 4.

>> No.1952019

>>1951969
ty

>> No.1952037
File: 27 KB, 500x508, Thinking lately.jpg [View same] [iqdb] [saucenao] [google]
1952037

>>1951783
If you can over clock a pi to make it faster (at the expense of heat), could you under clock it to make it run cooler?

>> No.1952041

>>1952037
Yes, that's no problem. You can do it the same way you overclock it.

People sometimes do that to minimize power usage as much as possible.

>> No.1952057

Best way to program an ESP? I'll need to use bluetooth, a button and perform computations and hardware interrupts.
Please help because at this moment using Arduino seems to be the most sensible way to go and I want to try something better.

>> No.1952263

>>1952057
esp-idf

>> No.1952538

I want to put a microcontroller in my computer to handle fan control. Writing a kernel driver to feed temperature info to it is no problem, but I don't want to just glue an arduino to the side of the case and use an internal USB header. Is there a microcontroller integrated into a PCIe card?

>> No.1952724

>>1952538
PCIe isn't much fun with a microcontroller. Its possible, but way too complex. Although there may be specialized chips to interface to PCIe that break out simple interfaces. I've never researched into it.
You would have a much better time if you find a PCIe to serial card(RS-232 or similar), and replace the metal facing with a solid one, keeping the connections on the inside. Build onto it a place for the microcontroller and connect to it directly.

>> No.1952985
File: 8 KB, 413x454, Untitled.png [View same] [iqdb] [saucenao] [google]
1952985

I've been trying out A6 GSM module. This is the code I'm using:

#include <SoftwareSerial.h>

//Create software serial object to communicate with A6
SoftwareSerial mySerial(11, 12);

void setup()
{
//Begin serial communication with Arduino and Arduino IDE (Serial Monitor)
Serial.begin(9600);

//Begin serial communication with Arduino and A6
mySerial.begin(9600);

Serial.println("Initializing...");
delay(1000);

mySerial.println("AT"); //Once the handshake test is successful, it will back to OK
updateSerial();

mySerial.println("AT+CMGF=1"); // Configuring TEXT mode
updateSerial();
mySerial.println("AT+CNMI=1,2,0,0,0"); // Decides how newly arrived SMS messages should be handled
updateSerial();
}

void loop()
{
updateSerial();
}

void updateSerial()
{
delay(500);
while (Serial.available())
{
mySerial.write(Serial.read());//Forward what Serial received to Software Serial Port
}
while(mySerial.available())
{
Serial.write(mySerial.read());//Forward what Software Serial received to Serial Port
}
}

It works fine, until I send a SMS message to the module. It's set on 9600 baud 100%, I checked it with a command.
then it outputs gibberish (look at the image attached).
I'm not sure what the issue could be, please help me as I've been trying to fix this for days now.

>> No.1952991

>>1952985
Looks like something turned on parity in the serial settings.

>> No.1953547

>>1952538
use a micro with built in USB like an STM32
also build a custom board with it so you can just put the 9 pin header and fan connectors on it directly

>> No.1953552

>>1953547
>>1952538
also PCIe connectors have built in i2c, USB, and UART. Take your pick and just find the pinout and make a board if you really want to use the PCIe connector.
Actual PCIe comms is in the realm of ASICs and FPGA's

>> No.1953553

>>1952985
You aren't accounting for parsing bits and there is no bit loss correction.

You need a master clock somewhere to keep components synchronizeed

>> No.1953559

>>1953553
>UART
>master clock
>Universal Asynchronous Receiver Transmitter
you have no idea what the fuck you're talking about.

>> No.1953564

>>1952985
you're using software serial and delaying 500ms between reads. how do you expect to clock in bits in serial when you're waiting in a wait loop.
if you are running sw serial at 9600 you need to clock in a bit at minimum every 105us. when you delay 500ms you have the potential to miss
4800 bits or 600 bytes worth of data.

dont use software serial unless you know how to use async timer interrupts.

>> No.1953581
File: 2.30 MB, 1920x1080, 1578799724115.png [View same] [iqdb] [saucenao] [google]
1953581

>>1952985 >>1952991 >>1953547 >>1953553 >>1953559 >>1953564
>software serial
Are you using a xtal or internal oscillator? It looks as if your clock is not stable enough for software serial.
The reason it works until you receive a large amount of data at once has to do with how UARTs work. If the message is 1 byte, it's a single UART frame, which means that the software serial will sync to the message start bit.
Generally, because you have your own clock and the other end has its own clock, every bit will drift both clocks, every bit will be slightly more off than the previous one. Still, everything will be alright as long as the clock stays within 10% of error for the whole message.
Problem is the stop bit at the end of the frame is immediately followed by another start bit (i.e. no gap). When that happens, the software serial apparently doesn't have enough time to sync with the start of the new message, and you'll still have the drift you carried, thus the drift will continue to increase, and errors will eventually happen.
There's a few options you have to increase reliability. You might need to combine them.
- Use hardware uart.
- Add pullup resistors on both RX and TX.
- Use a slower uart bitrate.
- Set the other end to send more than 1 stop bit (e.g. 1.5 or 2).
- Improve your clock (use xtal instead of oscillator, or at least calibrate for your internal RC oscillator).
>I don't know whether the source is sending gibberish or it's actually my fault on the receiving end
Get a logic analyzer. NanoDLA is less than $10 on aliexpress, and works with sigrok/pulseview.
>Where did you learn this shit
I implemented an uart, complete with supersampling and FIFO buffers, from first principles, in order to learn Verilog. It took me weeks, at an intermittent few hours/day. But hell, did I learn shit.
>verilog sounds fun, but aren't FPGAs expensive?
You could get an iCESugar, which is dirt cheap on aliexpress, and learn this stuff, too.
t. dbus_ti_link_uart_verilog author

>> No.1953645
File: 192 KB, 550x730, 1575288933106.jpg [View same] [iqdb] [saucenao] [google]
1953645

>>1952991
>>1953553
>>1953564
>>1953581
thanks a lot anons, I'll try lowering the delay and also implementing parity. I'll tell you how it goes.
and, thanks for explaining how you learnt about UART, I'll check it out.
I've been making small projects with arduino for 4 years now (not regularly though), but I don't know where to even start with the basic stuff. I can make stuff work (I know the logic, I figure out algorithms in my mind) , but I'd really like to work with oscilloscopes and other stuff and just see how it works.
but then again, I'm self taught and I started as a 14 years old kid with 0 previous experience (18 now), couldn't make things regularly, so my expectations may be too high.

>> No.1953691

>>1953645
You should probably move on from Arduino already. 4 years should have been enough.
Look into stm32 and/or gd32v.

>> No.1953804

Best cheap-ish ARM-based board (I love the STM32s) with BLE or Wifi connectivity (Like the esp)?

>> No.1953843

>>1953804
Does it have to be ARM?
If RISC-V is ok with you, try "BL602" on aliexpress.

>> No.1953846

>>1953843
DT-BL10 is a popular such module.

>> No.1953942

>>1953843
>>1953846
Thanks, will check it out. I've never worked with RISC-V, the reason I wanted ARM is because 1. I really liked working with STM32 and 2. I think it's the future on MCUs, they do so much research and especially in my field (machine learning) they seem to be way ahead. If I had a reliable ARM based board with good specs I think I'd never need to use anything else.
I guess I'll check other MCUs and boards for now, anything I learn can be transferred pretty easily probably.

>> No.1953946

>>1953942
I'd suggest gd32v, which is a stm32 clone (same peripherals) but on risc-v.
Problem is, that doesn't solve yojur BLE/Wifi requirement.

>> No.1953957

>>1953804
>>1953946
https://www.u-blox.com/en/product/nina-w10-series-open-cpu
And variants, some with PCB antenna or connectors, I've been using them for years.

>> No.1953964

>>1953843
Nordic semi.

>> No.1953966

>>1953964
meant for >>1953804

>> No.1954018

>>1953966
>>1953964
>>1953957
>>1953946
Thanks for the suggestions. The DT-BL10 seems like the perfect board for what I wanted.
I can't find any of these on Banggood, I guess I have to try Ali (never ordered from there). Might get one or a few of each and see.

>> No.1954020

>>1954018
If you're considering Ali...
attiny85 devboard digispark: https://www.aliexpress.com/item/32971847940.html
atmega328p devboard arduino uno r3: https://www.aliexpress.com/item/32680845470.html
atmega328p devboard arduino nano: https://www.aliexpress.com/item/32989224656.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 STM32F103C8T6 devboard blackpill: 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
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
Go nuts. (yeah, I ordered all that)

>> No.1954030

>>1954020
Holy fuck. Did you get them and did they work/did they have actual listed parts?
I'm considering getting a few of those you listed.

>> No.1954037

>>1954030
The stuff I ordered before 11.11, yup. But that's at most half of that.
The 11.11 will arrive, eventually. Probably. Maybe.
I am surprised that the STM32F103C8T6 blackpill passes the blink test from greaseweazle, which is specifically made to detect fakes.
If it's a fake, it'd be flawless. It's impressive because that board sure is cheap.

>> No.1954045

>>1954037
If the processor is actually an STM32 and you can use ST-Link with it you're good. I got a bunch of blue pills and the chips were not STM32, but they work fine with an FTDI and they were super cheap so I just kept them.
Any links for DT-BL10 boards from Ali from a shop that was good to deal with?

>> No.1954050

>>1954045
Yep, used st-link v2 clone from ali to program it.
The F411 gave me some trouble, but I hadn't figured out things yet (I'm new to stm32).
I'll insist with the st-link at some point, but I was able to program it via DFU.
All the arduino crap is of course fine, so is of course nodemcu.
The iCESugar 1.5 works with the open fpga stack (yosys/nextpnr) and is generally awesome.
I don't have the esp32-s2 stuff yet.
>Any links for DT-BL10 boards from Ali from a shop that was good to deal with?
Unfortunately, very few shops have the DT-BL10, and none of them is a shop I had used before.
I learned about these chips quite recently, and have put one on my cart (from the shop where it was cheapest, shipping considered), but I haven't ordered it yet.
Earlier, I was trying to figure out whether the SDK is sane. It's a bunch of github repos and there's a lot of binaries in them, which is ugly.

>> No.1954097

>>1954050
Yeah, I just checked it and you actually need to download the source code and serve an html file to access the docs. What?
Maybe I should stick with Espressif.

>> No.1954402

>>1951783
just got the arduino mega 2560 and ran into a problem. for some reason the PWM pins do not work or i can't get em to work. im doing the simple RGB one and canot for the life of me get it workin. I hooked it up perfectly and even used the picture to reference. i put a multimeter to the pins while running the RGB sketch and the voltage came out to 2.5 when i think its supposed to be 5. switched out the resistors, and even ordered a new controller board and still nothing. i dont get why the LED wont light up.

>> No.1954452

>>1951791
Whats the point of using a ESP32 if its not a IOT project?

>> No.1954484

>>1953804
nrf52 for BLE

>> No.1954531

>>1954402
>i dont get why the LED wont light up.
Do the leds work when you power them directly? (with a resistor, that is)

>> No.1954579

>>1954402
>i put a multimeter to the pins while running the RGB sketch and the voltage came out to 2.5 when i think its supposed to be 5
what duty cycle did you set the PWM to. less than 100% and the DC voltage or AC RMS won't be 5V.
put your meter in current mode and measure the current through the circuit. Also what resister value are you using.
Lastly use your meter in diode mode to check the forward and reverse voltages of the led.
forward should be anywhere from 1.8-3V depending on color and reverse should not me measurable.

>> No.1954731

>>1954452
insanely low power consumption on battery
>j-just use this other micro if you don't need wifi
does it have excellent Arduino ide support? didn't think so, assembly and proprietary chip specific languages are gay

>> No.1954772

>>1954731
>training wheels

>> No.1954793

>>1954731
You can program them all using C, although depending on the micro you need to learn a few things on how to do stuff. Arduino IDE is fine if you just want to do easy hobby stuff, but I'd suggest to get a little deeper in and try to program them using plain C, not because you'll need it but because it's kind of fun, you learn how it works and you can make it work a lot better.
>>1954772
Imagine having to tell strangers on the internet to stop liking things you don't like because your only pride in this life is using a slightly more complicated toolchain than some hobbyist.

>> No.1954796

>>1954793
Using the Arduino IDE/SDK, you're not about to extract much performance or functionality out of the microcontrollers you're using.
But, sure, It saves you from reading the datasheets, which is why it's training wheels.

>> No.1954797

>>1954050
>>1954045
Wait for Pinecone, or otherwise wait in general. There'll be better devboards than DT-BL10.

>> No.1954798

>>1954796
Yes. It's an abstraction layer so you can use the micro in a very simple (but inefficient) way. If you don't need to access low level functionality, which you don't in most hobbyist scenarios, then I don't see the problem with using it.
If it helps people get into making stuff, I'm all for it.
Is it really training wheels if you don't ever intend to dig deeper? It's just working at a higher level. Although I get your point.

>> No.1954799

>>1954796
>you're not about to extract much performance or functionality
Learn how to write to the registers and you can do anything with the Arduino IDE that you can with whatever shit you're shilling.

>> No.1954800

>>1954799
>Learn how to write to the registers
As I can read a datasheet, I have little reason to use Arduino IDE or SDK.
Thus, I can do whatever I want without any concern that the Arduino SDK might be touching the hardware I'm trying to set up, or otherwise messing with what I am trying to do.

>> No.1954804

>>1954531
I can try hooking them up through the analog pins. I think k i already tried that but ill try again.
>>1954579
>what duty cycle did you set the PWM to. less than 100% and the DC voltage or AC RMS won't be 5V
I didn't think that affected the amplitude thought it only effected the length of duration. The kit only came with 220ohm resisters. Didnt think to try the diode mode on LED will do when I get off work

>> No.1954805

>>1954799
>with whatever shit you're shilling.
Arduino doesn't have a monopoly on open SDKs.
>If it helps people get into making stuff, I'm all for it.
Absolutely. For most tasks, the shittiest microcontroller and a few lines of Arduino code will suffice,
But for anything more complicated, it'll be doing you more harm than else. Best to drop the Arduino SDK. There's options like avr-libc, stm32-base, libopencm3, your RTOS of choice or, god forbid, going baremetal.

>> No.1954938

Hello, my boyfriend browses this place a lot, he is mre of a /g/ user I think but he has started to pick up electronics and microcontroller programming. What could I get him for christmas?

>> No.1954941

>>1954938
A nice blowjob.
In all seriousness, depending on your budget and what he has already, an arduino kit, or an ESP32 kit. If he already got a kit then idk.

>> No.1954990

>>1954941
A FPGA devboard and a Logic Analyzer.
He probably has neither, despite having microcontrollers and such. That's typical.
My suggestion is iCESugar and nanoDLA, respectively. Both are quite cheap on aliexpress.

>> No.1955507

>>1954804
it affects average amplitude, which is what your meter is measuring (RMS). if you're in DC mode then you won't measure the full peak-to-peak 0-5V since PWM is a AC waveform.
what you need is an oscilloscope.

>> No.1955514

Does iCE-something or any other free dev environment allow you to practice writing verilog, and then test drive a certain FPGA model if you're not willing to buy one yet?

>> No.1955526

Is there a pastebin for this topic? I have a degree in computer engineering but have been working in test for a while. I would like to get back into microcontroller stuff.

>> No.1955544
File: 2.19 MB, 1920x1080, 1595397041120.png [View same] [iqdb] [saucenao] [google]
1955544

>>1955514
>and then test drive a certain FPGA model
Verilog has a good degree of non-synthesisable functionality, for simulation and verification.
All decent verilog courses/tutorials will teach you how to simulate and how to do automated testing based on simulation.
>l if you're not willing to buy one yet?
iCESugar, Anon. On Aliexpress. See pricing.
No reason not to have a real FPGA. A dirt cheap iCESugar combined with a dirt cheap sigrok-ready logic analyzer like nanoDLA is all you need for learning.
Elaina-sama likes iCE40 FPGAs.

>> No.1955585

>>1955544
Do they pay well at Muselab?

>> No.1955588

>>1955585
Of course not. Did you see these devboard prices? They're practically giving them away.
There's no margin there to pay shills. Not even if they're the sort to do great work.

>> No.1955607

>>1955544
>A dirt cheap iCESugar
>$30
nigga you think I'm made of money? I could restock, reoutfit my analog lab for that

>> No.1955612
File: 2.35 MB, 1920x1080, 1601942332438.png [View same] [iqdb] [saucenao] [google]
1955612

>>1955607 >>1955544
Anon, have you ever looked into FPGA devboards in general?
The iCE40 devboards are cheap. Among these, iCESugar is the cheapest.
Try looking around. Even an icestick (with its puny hx1k fpga chip) will easily you twice that much. Tinyfpga Bx, Blackice Mx are more expensive still, while it's debatable they're any better.
I guess the blackice has some ram and more IOs, but is it worth paying multiple times as much?
The next step from iCESugar, imho, is ULX3S, but that's easily $150.
Similarly, logic analyzers can be expensive AF, but under $10, besides the nanoDLA, you'll only find a bunch of saleae clones which are similar hardware but non OSHW and thus generally shittier.

>> No.1955618

>>1955612
>besides the nanoDLA, you'll only find a bunch of saleae clones which are similar hardware but non OSHW and thus generally shittier
Jesus Christ, stop astroturfing for your shitty company already

>> No.1955620

>>1955618
You know pretty much anybody can make nanoDLAs, right?
It's open hardware. That's why it's available from several sellers in aliexpress.

>> No.1955623

>>1955618
t. nanoDLAlet

>> No.1955673
File: 98 KB, 312x270, farnell-man.png [View same] [iqdb] [saucenao] [google]
1955673

am i the only one who keks at this everytime they open up farnell?

>> No.1955690

>>1955673
>>1955673
they increased their inventory by 25% wow
coming tomorrow how did they manage that

>> No.1955693

>>1955673
>>1955690
I always wondered if all these threads actually had shills, or people just liked stuff and recommended it.
Now if this isn't obvious shilling though, I don't know what is.

>> No.1955721

>>1955693
>he things we get paid to post farnell man on a vintage eeprom programming voltage specification forum
god i wish

>> No.1955778
File: 53 KB, 600x800, EYRpqadWkAAKQxd.jpg [View same] [iqdb] [saucenao] [google]
1955778

I am thinking about starting a company.
i have developed a product over an existing dev board, the board is simple, as it only has the chip + a camera
is it ok to go to market with a dev board product? i do not have the expertise to design the pcb or the connections to assemble them.
the price of the dev board is cheap enough (< 4 usd under <3 over 100 units), redisigning it might only save 2% of the cost. and the maging is generous enough that it won't matter.
The value is in the software, the hardware is generic enough. i would only do a case for the product, that's it.

>> No.1955791

>>1955778
based and devboardpilled.

>> No.1955830

>>1955778
Package it up in a nice case and it doesn't matter at all what components you use inside.

Just make sure you don't leave any dev files on a SKU you sell to someone

>> No.1955845
File: 142 KB, 1500x993, 81iAOmr6s0L._AC_SL1500_.jpg [View same] [iqdb] [saucenao] [google]
1955845

>>1955830
Pretty sure i can blow a fuse and stop it right there.
the board is pic related

>> No.1955857

>>1955845
so you developed with arduino ide or idf?

>> No.1955872

>>1955857
The system is just recording the wifi stations nearby and a video, later its uploaded to the phone when the real stuff begings,
developed it in arduino, but i do not need any weird boilerplates and shit, so probably i will write it directly.

Dunno yet.

>> No.1955965

>>1955618
dumb /g/tard

>> No.1955974
File: 20 KB, 403x392, 1491519849808.jpg [View same] [iqdb] [saucenao] [google]
1955974

>live in third world country
>offer to finish foreign students Arduino/IoT homework for money on upwork
>get an order from American student to convert his Arduino program to inline assembly (sorting, array stuff etc)

Holy fucking shit what a Trainwreck. I've written my fair share of AVR assembler and AVR C but what the fuck is wrong with AVR inline assembly. There behaviour is totally random and depends on the compiler you're using. I lost 25$ that I could've earned if the customer was using the same compiler as me. The code worked perfectly on my machine

>> No.1955978

>>1954796
Bruuh we don't even have a complete register map for esp8266 or ESP32, what the fuck do you expect to read in the datasheets without that critical bit of info?
Let's face it, ESP is way too locked down and complex to read the datasheet. Hell, most arm chips are way too complex with thousands of pages worth of datasheets and application notes and reference manuals

>> No.1955981

>>1955974
It's ok Kumar, next time you can write C and compile it to ASM and make minor modifications to that.

>> No.1956028
File: 541 KB, 350x396, 1604592558089.gif [View same] [iqdb] [saucenao] [google]
1956028

Is there a better way to handle big storage on a pcb or is a microsd the best choice, we are talking about 8-16gb of storage, connected to an arduino
Most flash chips i have seen are 512k tops

>> No.1956182

>>1955778
>is it ok to go to market with a dev board product?
just package it in a enclosure and no one will know.
This happens all the time in cooperate design. its called COTS (consumer off the shelf) designing.

>> No.1956184

>>1955974
>get an order from American student to convert his Arduino program to inline assembly (sorting, array stuff etc)
you should have told him he's a fucking retard and to keep his money

>> No.1956277 [DELETED] 

>wanted to do a specific hardware project with Cortex / SMT32
>someone just released a devkit that does pretty much what I want, and released the schematic
>all I would have to do is write the code

I'd be retarded not to buy it and save a bunch of time, right? If I ever wanted to sell my project I would just design a new PCB using their schematic as a guide

>> No.1956283

>>1955778
>>1955830
>>1956182
I'm facing this same exact situation. I want to sell a product with very specific DSP code (for music production) and the dev board that does what I want is cheap. But I just feel like learning to design the PCB from scratch makes you more independent...

>> No.1956347

>>1956283
designing a custom PCB is considered more professional but not required to sell a product.
Just know that doing a custom board generally will be smaller and can fit any form factor you want.
if you don't have those requirements then just use the dev board.

>> No.1956386

>>1955978
Do you unironically believe the esp for arduino people have access to documentation you do not?

>> No.1956444

>>1955974
What differences are you seeing from the inline?

>> No.1956447

>>1956444
>literally have to push/pop all 32 registers before/after a function (inline assembly) call because gods knows what register is going to contain vital data that might send the AVR an infinite loop with random stuff being printed because arduino C++ serial library is being called somewhere or somehow
>according to number of arguments in the function, the last pairs (R26:R27, R28:R29, R30:R31) of registers may contain argument data, but its just as likely that they may not, and argument data may be in a completely random pair of register somewhere else (R18:R19 seems to be a favourite)
>everything may work on my machine but because of my compiler, but the same code may not compile on another compiler and send the AVR into an infinite loop
>no instructions to multiply/divide 8+ bit numbers
>no instruction to even multiply numbers in some variants, have to do retarded repeated addition
Never mix ASM and C if you can help it, just make different sections with C and ASM. Inline assembly is an abomination.

>> No.1956449

>>1956447
Is should add that I could've written the programs in pure assembly, all with everything, setting up UART, sending data, printing text, etc, but Arduino + Inline assembly functions just fucks everything up

>> No.1956466

>>1956184
25$ is enough to buy like 25 kilos of rice. Maybe even more. That's enough rice to last me and my family for months

>> No.1956480

>>1956447
C and ASM inlining is usually fine. The argument registers should be automatically picked up by the compiler, you shouldnt have to specify.

The inline asm syntax in C allows you to pass values to and from registers - function arguments shouldn't come into it.

How long is the asm / what are you trying to do with it?

Or else just post code

>> No.1956548
File: 9 KB, 317x189, 1578388805540.png [View same] [iqdb] [saucenao] [google]
1956548

>>1956447
>>1956449
>literally have to push/pop all 32 registers before/after a function (inline assembly) call
no, you just add any register you use in a volatile asm block to the clobber list.
>Never mix ASM and C if you can help it, just make different sections with C and ASM. Inline assembly is an abomination.
or you can learn how to properly use GNU extended asm. since AVR compilers are GNU. Don't blame the tool for the user's incompetence.
>>1956480
>The argument registers should be automatically picked up by the compiler, you shouldnt have to specify.
asm is not analyzed and processed by the compiler like normal C code. its only assembled into byte code. Any argument registers you think you got are purely by chance and could change depending on the compiler used.
This is why you pass the C variable register into the volatile ASM block and extract the data once done into a C variable and return that.
https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html

>> No.1956559

>>1956548
>Camelcase in C

>> No.1956566

>>1956548
>This is why you pass the C variable register into the volatile ASM block and extract the data once done into a C variable and return that.

Thats what I meant - just phrased badly.
Its not guaranteed to use specific arg registers, but you can pass values to and from inline asm as you've said. And it should be fairly reproducible so long as you tell compiler clobbers and io's etc

>> No.1956654

Trying to escape arduinoland, but sticking with a 328p for now.
I've been using an SX1276 for LoRa and MCP2515 for CAN communication which have a bunch of arduino libraries, but anything non-arduino I can find either seems incomplete or has little or no documentation. Microchip only offers libraries for PICs.
Do people routinely write their own software to interface with complex ICs with 100+ page datasheets?

>> No.1956660
File: 484 KB, 706x1157, 1576911810704.png [View same] [iqdb] [saucenao] [google]
1956660

>>1956654
>Do people routinely write their own software to interface with complex ICs with 100+ page datasheets?
Yes, we do. Arduino is the microcontroller equivalent of playing with blocks.
If you're not reading the datasheet, you're doing it wrong.

>> No.1956683

>>1956654
>Do people routinely write their own software to interface with complex ICs with 100+ page datasheets?
it depends... sometimes the chip vendor will actually supply an API layer that leaves a few callbacks for you to tell the library how it writes to the I2C bus, and handles the nasty shit itself.
For example, ST's VL53L1X communicates over I2C, but don't document the register set, instead giving you a shim which presents the actual API. Yeah you can probably reverse engineer the meanings of the registers, but honestly who cares.

I don't think writing your own interface wins you any prizes. its just something you have to be prepared to do, and be comfortable with the idea of having to do it, but from a product point of view you are introducing an additional software component that will have to be developed and tested, which is just going to take time and effort.

for something with 100+ pages, you probably don't care to implement every single little feature - you just want to initialize it, and then use some subset. write it like that, and then when you need access to another register down the line, write it then and there.

if its I2C/SPI, its gonna be the same old pattern of read/write register in some order, shift some bytes around, and return to caller. writing drivers becomes mundane after the first two or three.

>> No.1956715

I'm trying to control an ESP8266 through the web the catch is that it's connected to a network i'm not administrating with a captive portal.
I've managed to get past the authentication with the captive portal but I can't access the webserver inside the network since all the requests seem blocked (even ICMP). I tried opening the web server on port 53 usually not blocked cause it's used by DNS but even that failed...

What should I try next?

>> No.1956719

>>1956654
>Do people routinely write their own software to interface with complex ICs with 100+ page datasheets?
Yes, if you work in a normal company and not at a startup.
Startups routinely pack arduinos running blink in shiny 3D printed boxes and present them to investors as the cure for cancer or source for perpetual energy. I was involved with the startup "ecosystem" after graduating from univ and most tech based startup are the same. They're a mismatch of a few tech guys who know their tech but nothing about how to run a business and a few "marketing" types who know jack shit about tech.
Unsurprisingly, most startups fail. The ones that DO succeed unironically consist of either only tech guys or only "marketing" guys.

>> No.1956744

>>1956715
If sending a request or sockets won't work, if you don't need it to be realtime or battery efficient you can try to actually send a GET request every x amount of time to some webserver, and then instead of sending the request to the ESP you can send it to the server/db, and the ESP can read it from there. Not instantaneous, but will work.

>> No.1956799

>>1956744
>>1956715
I just read this again and it might be confusing - here's a practical scenario:
>What you want
Send a request to an ESP to turn on a relay (example)
>How to do it
From your smartphone: Send a request to a cloud mongodb database and set a field, `relayOn` to 1 and `relayRead` to 0.
From the ESP: every 5 seconds, read the `relayOn` value from the db. If it is 0, go to sleep for 5 seconds. If it is one, set `relayRead` to 1 and execute code to turn on the relay. Go to sleep for x amount of seconds (sleep time when relay is on might be different than when it's off)
From your smartphone, you can see the ESP got your request if the field `relayRead` is one.

>> No.1956800

>>1952037
It won't really run cooler, well it will, but the amount of heat you're getting is definetly higher than the amount you're loosing by underclocking. You might want to look in those sticky little radiators you put on your chips

>> No.1956807

I need to learn to design a PCB.

>> No.1956808

>>1956800
Those are called heat sinks. Also, the tradeoff between heat and performance might be worth it depending on the application. For a simple data logger or something you can underclock it way down and never notice a difference.

>> No.1956816

>>1956807
Why?
I know it looks cool when you see people shilling fab companies on YouTube go from idea to PCB, but for the vast majority of projects if you're not a professional it won't provide anything additional for you.
The only 3 use cases are:
>Final project needs to be as small as possible
Yeah, you're going to have to use a PCB and get SMD parts etc.
>Final project has at least a little bit of complexity and you need to make it many times
It might be faster to simplify the process by ordering PCBs and not having to worry about connections
>Final project is too complicated for stripboard and/or requires SMD-only parts
You might need to order, find out you've made a small mistake, order again, repeat. Figure out if it's worth it.

>> No.1956836

>>1956799

Yeah that's the only option. I have server back home I can access with a VPN, i might try opening a web server to the internet where the ESP can gather the data it needs and smartphones/computers can input this data.

The requests the ESP will be sending, however , need to be pretty frequent since it's controlling some lights. How frequently do you think I can make GET requests to the server ?

>> No.1956866

>>1956836
If you don't care about battery life that much, I think it will be virtually the same as having a socket. You can probably send a GET every few ms and the overhead will be mainly server-side
>You send a POST request using your smarphone to the server - 100ms
>The ESP sends a GET request to the server to check for new info - 40ms
That means you have a communication overhead of at least 140ms in this example, probably will vary but generally more IRL.
I don't think it's too much, especially for lights. You will tap on a button on the phone and within a second you should have your lights on.

>> No.1956870
File: 41 KB, 623x791, ledboard.jpg [View same] [iqdb] [saucenao] [google]
1956870

>>1956807
I've been working on this in KiCad. I just got tired of making this circuit all the time. It's not the first time I've done something on a side board like this, I guess you could call them "breadboard macros". The other day I did a similar thing with a MIDI DIN plug, and I'm about to make another.
I had already built a prototype on perfboard, and I found out that it's not only useful directly on a breadboard. I stuck a bunch of dupont fly wires on it and was able to use it to debug a project.
The circuit is basically 1.4K resistor -> 2N3904 open collector -> LED with 120R resistor.
The values were chosen because I already had a tape reel of each resistor, and a bunch of loose transistors. The holes are to mount it on a front panel with a ribbon cable. Also my original had the pins 0.2" apart to line up on the perfboard.
Now I'm looking for somewhere to get them printed up. Depending on the minimum size I might panel them 2-up. I think 2"x2" (50mm) is often a minimum size before the cost starts going up, and these are slightly smaller than 1x1.75.

>> No.1956872

>>1956836
>>1956866
>How frequently do you think I can make GET requests to the server ?
If you meant server side, a Node server can handle thousands of requests at the same time so you can probably bombard it as fast as you can and it won't feel a thing. The bottleneck would be the database, but most DBMSs support parallel connections as well, especially for SELECT queries. A RPi 3B server would probably be unfazed by an ESP8266 screaming at it at the top of its silicon lungs.

>> No.1956890

i have some old AVR and arduino stuff laying around i dont use anymore. should i throw them away, or are there ppl out there interested in free old shit

>> No.1956895

>>1956890
Don't throw them away, someone probably wants them. Why don't you give them to a school or a little cousin or something?

>> No.1956936

Thoughts on Teensy microcontrollers? Been thinking of buying a Teensy 4 recently.

>> No.1956938

>>1956870
Nice, looking good. I wish I had your abilities

>> No.1956941

>>1956938
not him but cmon bro, those "abilities" are attainable in a day or two

>> No.1956951

>>1956870
That's already available as your typical LEDs PMOD.
But with PMOD header.

>> No.1956952

>>1956870
>120R
Anon... don't be part of the cancerous bright LED problem.
680Ω is, like, the minimum.

>> No.1956988

>>1951783
Arduino pleb here. Just doing crap I want at home, nothing production or high-volume so the time I save using a handful of Arduinos/ESPs is worth the cost. That out of the way:

How do you guys do prototype boards? Sometimes the stuff I do (custom gamepads for PC's, sensors, relay controllers, that sort of easy shit) are super simple stuff, but without a printed PCB are very annoying to wire up. So far I've only used proto boards with wires soldered to make connections, and using copper-clad boards and Dremel-ing traces into them. I haven't tried the chemical method with the copper boards because the etching liquid is like 4x the cost of my projects; how well does it work?

I'm scared to do "proper electronics" because I can't be fucked to solder a billion wires to all the pins to make the actual circuits. Even my ESPs I have plans for but no desire to continue doing the connections in these slow ass ways; takes a day to solder a single board with like 20pins. What's the next step I need to look into? Again these are mostly personal projects that I rip the $$ components out of and reuse when I'm bored a year later, so cost and turnaround time is a factor.

>> No.1956996

>>1956988
Etchant is pretty cheap. You can even go cheaper by using muratic acid + peroxide, which after etching a few boards will turn more and more into cupric acid, which can be regenerated with oxygen (adding more peroxide or pump air through it).

Another option is to use to use a small cheap CNC router to mill them.

>> No.1956999

>>1956988
Just order them PCBs.
These days it's stupidly cheap. Enough it's not worth bothering with the old home-etching hacks.

>> No.1957000
File: 287 KB, 1213x910, usb-host-prototype.jpg [View same] [iqdb] [saucenao] [google]
1957000

>>1956988
>takes a day to solder a single board with like 20pins
thats not normal. i think theres something amiss with your hand soldering workflow for things to take this much time.

i create prototypes with veroboards. QFP and similar SMD packages are put on a breakout board, and then all the connections made with point-to-point transmission coil wire. The coil wire laminate i remove by simply dipping the end into a solder blob on the end of the iron. after making the connection, quick test for continuity, and done.

might take a few hours to get everything connected together, but this assumes you have your workspace configured optimally - probes on lap, and iron, flux, coil wire, wire cutters and solder all ready and within instant reach.

pic related is granted pretty simple (disclaimer: it doesn't work), but this is my go-to method. that breakout board is actually hot-glued to the "motherboard" veroboard.

>> No.1957002

>>1957000
>coil wire
I could use some such wire at an adequate thiccness for breadbording. Advice?

>> No.1957010
File: 336 KB, 3156x2107, male-to-male-jumper-cable.jpg [View same] [iqdb] [saucenao] [google]
1957010

>>1956999
the cheap pricing is very true, the problem is with the timescales - having to wait 15-25 days for the china mail option is discouraging. if i pick fedex i can get it in 7 days or so, but then the price spikes to £30, which is now turning into a bit of a commitment. so even today i think board prototyping techniques are still a valid discussion point, since really the defining factor of prototyping something is turnaround time.

>>1957002
for breadboards, there is a minimum thickness the wire must be for the metal clips under the hole to exert enough frictional force on the wire for it to form a reliable electrical connection. This thickness is about 0.5mm or 0.6mm (just measured some jumper wires), which puts transmission coil out of range.

your best bet is gonna be solid core wire of that thickness. but then you have the problem of inflexibility - jumper cables (pic related) solve this problem. However, that can get janky very fast since they're of fixed length, and the spaghettification plus increased top-heaviness of the board will start to cause reliability issues - at which point one jumps ship to a soldered prototype board.

>> No.1957011

>>1957010
I have jumper cables, but basically want to cut wire to size for the purpose. I'm trying to design and build a breadboard computer.

>> No.1957012
File: 134 KB, 961x979, jumper-cable-kit.jpg [View same] [iqdb] [saucenao] [google]
1957012

>>1957011
in that case, id try something like this

>> No.1957014

>>1957011
>>1957012
AWG 22-30 works on a breadboard. 22 is snug as a bug, 30 is thinner, easier to connect, less secure.
I think what I have is AWG 24

>> No.1957015

>>1957012
Thanks, I'll look into these, but is there any kind of wire spindle I could order and cut from which would be useful for breadboard and protoboard?
Intent is to order from aliexpress, with other crap, this Monday.
I don't even know which keywords to use >.<
>>1957014
I'll investigate this, thank you, Anon.

>> No.1957019

>>1957011
I'm confused do you want something for breadboarding or for soldering prototype PCBs?
Why would you want or need the same kind of wire for both?

>> No.1957021

>>1957019
Breadboarding.
But ultimately, save for a bunch of old spliced up telephony wires, I have no wire.
I do however have a bunch of breadboards (and a bunch of pre-made jumper wires) and a supply of protoboards.
If there's an overlap of types of wire can be useful for both, that'd be best. But, breadboard is priority.

>> No.1957023

>>1957015
Yeah if you write AWG 24 solid core wire and find a package with multiple rolls of wire in different colors you're golden. Get a wire stripper if you don't have one, one of those that look like staplers and strip the end of your wire. Make sure it is made for 22-30AWG at least, because some are made to only strip thicker wire. The variable length of stripping feature is nice to have. Try to find one that's all metal if you can, the plastic ones sometimes suck.

>> No.1957029

>>1957023
mkay. I guess that's one issue solved.
https://www.aliexpress.com/item/32863697410.html?
There's a few options re: colors. I have the possibility of getting 2 boxes (one of each set of colors) of different sizes. Should I go with 2x AWG24, or would you recommend I get e.g. AWG 26 or 28 for the 2nd box?

>> No.1957033

>>1957029
22AWG is the recommended size for breadboards, I just mentioned 24AWG because that's what I got (I use it mostly for perfboard).
Depending on your budget and use case you could get eg 22 and 30, and use the latter for perfboard (it's easier to bend and solder - 22 is pretty rigid and needs more heat).
Get a box like the one in the pic here >>1957012 to organize the different lengths, the cut wire quickly adds up.
You could also get a box with precut wires, those are cut to the exact lengths you need for breadboards. Depends on how much wire you expect to need.

>> No.1957037

>>1957033
Maybe I should go with 24 and 28? 2 AWG away from either limit of the 22-30 "works on breadboard" range.
Re: how much, it's not like I can easily buy too much. Wire doesn't expire (hopefully).
I'll also try and get a jumper cable kit.

>> No.1957054

>>1957037
24 is fine, but I wouldn't go any higher for breadboard because it's kind of flimsy and will fall out of the breadboard if you move something, it's a pain in the ass. Just imagine you just made a big complicated circuit and it works, and then it doesn't and it's because a wire moved a little. That sucks ass.
If you're not planning to use perfboard get the 24 or 22 only, otherwise maybe get a 24 + some wire wrap wire (very thin, you melt its insulation in a ball of solder right on your iron's tip and it's ready to use, works amazing for that) or 28-30AWG if you want sturdier connections.

>> No.1957059

>>1957054
If you plan to use a bunch of components like diodes and resistors that have smaller gauge leads, then use 24AWG because 22 will eventually stretch your breadboard contacts. If you think about it, the obvious porn analogy for that will make it make sense immediately.

>> No.1957136

>>1957010
>having to wait 15-25 days
That's why I go with Amazon for most stuff, if it says "fulfilled by Amazon", that means the parts are already in a bin in the US, which saves two weeks right there. Then I'll wait until i get to $25 or whatever so I can get the free 1 week pleb shipping and still get it faster than from China.
>>1957002
>>1957010
>minimum thickness the wire must be
22 gauge solid was the "standard" for breadboarding from way back. Solid Ethernet wire is a bit too thin (26 ga?). The local telephone guys leave their scraps outside the breakout boxes and I can walk by three of them, I think it's 22. And 18 gauge is Right Out, that will definitely stretch out your contacts..
>>1957010
>>1957011
Hey guys, really, don't use male dupont wires, the few I've got were just too fragile. I get female ones and stick the longer header pins in them. But I'm also not using them for breadboard wiring, strip-n-bend has been good enough for me for decades. I don't think they even fit in the header blocks that I've salvaged from old PCs. (lift the latch with a straight pin, rearrange wires)
>>1957000
I'm really big on using headers whenever I can, along with ribbon cables. Then I can take apart the generally useful bits and use them for something else. I've come up with some interesting tricks, including weaving the wire just right before crimping down a ribbon cable header, and crimping on two headers to get both sides to span an IC width.
Another trick is solder an SMT resistor between two header pins. Then you get a nice compact resistor, and it's easier to read the numbers than color bands on a regular resistor. It's a lot more tidy too.

>> No.1957337

Guys why would one use a pullup/pulldown resistor for, say, a button vs setting that pin via software to pullup/pulldown?

>> No.1957496

>>1957337
RC constant. IC pu/pd resistors are in 30k-50k range so see how it figures with your design.

If it works and you don't care - just use internal pullups/pulldowns.
If traces are long and/or suspectible to significant noise - they I would consider using external pu/pd resistors with some filter caps but rarely I care enough to use them

>> No.1957514

>>1957496
So for stuff like a toggle button it doesn't matter and I can do it using software, but if it's something very complicated it might be worth adding those extra resistors and maybe a cap.
Thanks breh

>> No.1957529

FYI pull-down is preferable over pull-up if you're using battery power. Pull-ups will use some power, no matter how small, to do their thing.

>> No.1957615

>>1957136
Thanks for advice. I think I'll grab a box of 24 and a box of 28.
The phone cable I mean is really thin, to the point it's unreliable on a breadboard. They're a bunch of twisted pair wires with all sorts of colors (solid and patterned). These were all inside a much larger cable. Phone guys use this to run a shitload of lines together @ streets.

>> No.1958052

>>1957514
if you're designing a custom PCB it's better to put the pad there and dont populate it rather than need it later and not have it.

>> No.1958060
File: 21 KB, 500x500, images (22).jpg [View same] [iqdb] [saucenao] [google]
1958060

Has espruino microcontrollers been copied by counterfeiters yet?

>> No.1958061

>>1958060
*espressif*

>> No.1958151

>>1958060
Can't out chink the chinks
These things are literally 1$ including the processor itself, with flash, track antenna, crystal + supporting circuitry AND a metal can

>> No.1958184

>>1958060
esp8266 is very old news.
esp32-s2 is current.
esp32-c3 is the incoming risc-v based successor.

>> No.1958379

>>1957010
>male-to-male
that's pretty gay anon

>> No.1959083

>>1958184
>esp32-c3 is the incoming risc-v based successor.
Shit, that sounds so cool.

>> No.1959087
File: 1.76 MB, 1920x1080, 1580758530296.png [View same] [iqdb] [saucenao] [google]
1959087

>>1959083
See already available BL602, another risc-v based µC with wifi/bt, with ongoing work to free the wifi/bt portion. (look up pinecone reverse engineering)
And gd32v, an stm32 clone that uses risc-v instead of ARM (successor of gd32, stm32 clone).

>> No.1959819

>>1959087
I looked into BL602 after you shilled it a few days ago, it has terrible documentation and an even worse SDK. The pinecone dev board is probably years away as well.

>> No.1959853

>>1959819
SDK sucks, but Bouffalo is cooperative re: documentation (minus the wifi part). Thus I expect the sdk to be replaced, in time.
Right now, it's the only risc-v µC with radios, as the esp32-c3 isn't out yet.

>> No.1960746

can someone handhold me or spoon-feed me on getting an icesugar FPGA set up on linux?

up until now I've been using the Xilinx suite on Windows with a Basys-3, which takes care of everything for you. As far as I can tell, I'm on my own on linux as far as testing, simulation, synthesizing, implementing the program, and flashing it to the FPGA are concerned

I just need some general pointers on where to get started and I can hopefully handle the rest

>> No.1960760
File: 1.06 MB, 707x1000, 1581798032419.png [View same] [iqdb] [saucenao] [google]
1960760

PSA: Pinecil (improved ts100 compatible iron with risc-v µcontroller and usb-pd) is available for order.
https://pine64.com/product/pinecil-smart-mini-portable-soldering-iron/
>>1960746
Sure, I have mine set up, on Arch. What distro are you on?
For starters, for any iCE40 you do need to install yosys, nextpnr and icestorm.
And specifically for the icesugar, you need to get icesprog. There's some official icesugar repo in github. icesprog used to be binary-only but they (finally) released the source a few weeks ago.

>> No.1960768

>>1960760
I'm on Gentoo. I'm checking now to see what kernel modules I'll need. I can't imagine it'll be much more than maybe UART support or support for FTDI/serial stuff (which I've already enabled)

>> No.1960777

>>1960760
>have to pay extra for tips that aren't shit
dropped

>> No.1960778
File: 912 KB, 839x1188, 1585075180689.png [View same] [iqdb] [saucenao] [google]
1960778

>>1960760
>>1960746
To add to that... the icesugar repo has some example verilog code, complete with Makefiles and such.
It also has the pcf constraints file for the pins, which you'll absolutely need if you want to get any work done.
Be careful that PMOD1 (the one @ top of board) shares some pins with onboard functionality, so it is usually best avoided. Specifically, some pins are shared with the UART and some are shared with the secondary USB port. Jumpers can be removed to release the UART.
The summarized flow would be as it follows:
yosys synth_ice40 --> nextpnr --> icepack --> icesprog.
There's another way to flash the board (mount usb and copy file, then umount... or mount with option "sync" to begin with.)
For a reference Makefile other than the crap examples from icesugar, look at my dbus_ti_link_uart_verilog project.
>>1960768
>Gentoo
The best distro out there. I use it since 2003-ish, but lately I've gotten lazy so I have a lot of Arch Linux, including the laptop I'm currently on.
>UART support
It uses the standard USB to serial thing, the one that creates ttyACM devices. Rather than a usb-serial converter, this board uses a stm32 µC which does a lot of crap at once, including the UART and the programming, both with the HID interface used by icesprog and the crap usb mass storage "drag and drop" bullshit they also offer, definitely aimed at Windows plebs.
Do note the UART implementation does only offer RX/TX, and no RTS/CTS handshake, which is desirable (e.g. on my project) as it allows you to easily throttle incoming data as your FIFO buffers are near full on your FPGA design. But nothing stops you from using a good usb-TTLserial like a FT232H. You could even connect RX/TX to the usual pins from FPGA view, thanks to the jumpers.
>>1960777
It uses ts100 tips. You can get those on aliexpress and other chink sources too. But do notice the pricing is not better than pine's shop. But you can still buy exactly the ones you want, rather than the 2x 4-pack.

>> No.1961006

Some aliexpress shit is cheaper now, because sale.

>> No.1961020
File: 225 KB, 583x340, 1596841407374.png [View same] [iqdb] [saucenao] [google]
1961020

I've purchased a RasPi today so I can run PiHole on it. I'm sick of fucking ads on devices where I can't run an adblock.

What else do you guys do with your RasPis? What other software should I run on it? Thanks for any tips bros!

>> No.1961023

>>1961020
I run Arch on mine. It's got a couple usb3 hdd enclosures attached, and does run transmission, weechat, ipfs, tor, synapse (matrix's), pdnsd and a few other things I forget about.

>> No.1961355

>>1960746
Got anywhere?

>> No.1961610

>>1961020
A lot of people hook up hard drives to it and use it as storage they can access throught the house network, or even through the internet. Some others use it to run servers so they can connect to their home network (and the pi storage) from anywhere.
Personally, I used mine to watch series and movies on the living room TV (both using a media center OS, and within the raspbian itself - I could even stream videos from websites that have them like YouTube or others with pirated series/movies).
I think I ran popcorn time on it for a while but that might've been a different machine.
I tried the other OS where you play retro games (retropi?) and it was ok but boring.
The media center OS I could connect to from my phone, so I had friends over, went to take a shit, and searched "gay music" on the youtube plugin, so the TV started playing the most outrageous party music on its own, was pretty funny but honestly for actual use just having raspbian and using firefox on there works fine.

>> No.1961633

>>1961610
I personally find it underpowered for TV use.
It can be decent as home server, but not for anything involving graphics and interactive use. Can't even play AV1 for that matter.
Ryzen all the way, for living room pc.

>> No.1961660

>>1961633
I had the 3B, with 1GB or RAM, and it worked fine except in the summer (overheated a little bit, but I didn't have any heatsinks or fans).
The new pi 4, especially the 2/4/8gb model can probably do anything you want to do with the TV if you get a case with a fan for it.
I wouldn't run a PC with a Ryzen just to watch movies on my living room (though I do on my laptop & desktop, both have a Ryzen 5 CPUs), too high power, an ARM CPU is way better for that application because it runs on 5V.

>> No.1961665

>>1961660
I do have the rpi4 with 4GB. I fortunately got a large heatsink for it; it does need it. It does home server stuff. I would definitely not use it as living room pc, it simply isn't fast enough for that.
>an ARM CPU is way better for that application because it runs on 5V.
The CPU doesn't run at 5v, neither does a Ryzen for that matter.
The rpi board's voltage regulator takes 5v as input, which is a different thing.
>too high power
The pi is actually quite inefficient. It draws a lot of power compared to other SBCs, and probably even compared to embedded (V series) Ryzen.

>> No.1961666

>>1961660
http://www.pidramble.com/wiki/benchmarks/power-consumption
Only the rpi1, 2 were nice and low power. 3 onward are dumpsterfires.

>> No.1961670

>>1961665
You're right, I meant the whole thing runs on 5V (obviously giving different voltages to different things) not the CPU.
I can't believe you can't stream video on a pi4 4GB, because as I said I used the 3B for a year or so with the only issue being overheating when it was >25C outside.
I'm not sure about embedded Ryzen, never looked into it.
>>1961666
Checked, satan. Compared to other SBCs it might be shit, but those values are nothing close to a desktop PC (and the pi can do the same job for browsing).

>> No.1961675

>>1961670
>it might be shit
It is shit. A board that size with not even a stock heatsink shouldn't be drawing that much power.
>but those values are nothing close to a desktop PC
Again, depends on the desktop PC. Any of the CPU series made for embedded (atom, ryzen V, they're SoCs) draws less on idle and average.
The maximum they can draw is definitely higher, but not by that much, and they're be equipped to handle that much dissipation, whereas the rpi is (shamefully) not.
They're also dramatically faster, as you'd expect. Great for web browsing, decoding videos, light gaming and emulation.
Re: the latter, for the platforms with good support, you should be using miSTer anyway. No rpi or anemic pc can compete with that.

>> No.1961897

>>1961675
Can you point me to boards that might be more suitable than a Pi for running Tensorflow Lite (no training, just inference) but at the same or lower price range? I'm looking for an edge device to use in a few planned projects. WiFi and Bluetooth are also required, but I guess I can use modules for those if the SoB is cheap enough to accommodate their cost.
For reference, a Teensy 4.0 can run a version of TF Lite for micros, which sort of works for some things, but I'd like to work with more advanced models and being able to install some minimal version of a linux distro would be great.
Not sure but TFLite might only run on ARM.

>> No.1962104

>>1961897
I heard something about k210 support, but that was a long time ago. You'd have to investigate whether or not that works, and how it performs.
That chip is interesting because it actually has hardware acceleration, but I wonder about actual support for leveraging it.

>> No.1962135
File: 768 KB, 1430x756, file.png [View same] [iqdb] [saucenao] [google]
1962135

Anyone has experience with pic related on linux
(Cypress CY8CKIT-059)

>> No.1962197
File: 1.94 MB, 1066x1454, 1592254619753.png [View same] [iqdb] [saucenao] [google]
1962197

>>1962135
I've heard about it before...
http://cowlark.com/fluxengine/doc/building.html
But I went the greaseweazle route, just because stm32's as friendly as 32bit microcontrollers go.

>> No.1962272

>>1962104
A Pi Zero W is plenty powerful for inference (actually, an ESP32 would be adequate for the task) so I don't need something more powerful, but something cheaper/with better consumption

>> No.1962294

>>1961665
>The pi is actually quite inefficient. It draws a lot of power compared to other SBCs, and probably even compared to embedded (V series) Ryzen.
Are you comparing the bare TDP of a Ryzen with a whole Pi board?
Regulator and peripherals draw quite a bit of power too.
I'm sceptical that you can build a complete embedded Ryzen system with less power draw.

>> No.1962312

>>1962294
https://www.tomshardware.com/news/asrock-ibox-v2000-ryzen
No reviews for these yet, sadly. The CPUs are 10-25w TDP (I understand configurable).
Besides being obviously much faster, I suspect they might draw less power than the rpi4 on average. The reason is simple: rpi4 average draw is high to a ridiculous degree. Thus it should be easy to top them.
As the AMD chips use TSMC 7nm, it's almost like cheating.
>Regulator and peripherals draw quite a bit of power too.
Yes, but careful, these take 12-18v as input (transmission and conversion should be more efficient than on 5v), and the main chip is a SoC (like the rpi's broadcom), rather than depending on an external chipset.

>> No.1962313

>>1962312
>No reviews for these yet, sadly. The CPUs are 10-25w TDP (I understand configurable).
The TDP of the Pi 4's SoC is 4W.

>Yes, but careful, these take 12-18v as input (transmission and conversion should be more efficient than on 5v
Why would dropping more voltage be more efficient?

>> No.1962318

>>1962313
>The TDP of the Pi 4's SoC is 4W.
The measurements for the board, however, are much higher (3+ idle, 6+ load).

>> No.1962319

>>1962318
That's my point. TDP alone doesn't tell you the power draw of the complete system.

>> No.1962321

>>1962319
And, as I told you, I have no reason to think the average will be higher on Ryzen embedded series, and an argument (12-18v input) favoring the Ryzen.

>> No.1962328

>>1962321
And I don't understand how higher board input voltage is supposed to increase the efficiency. Transmission losses are insignificant on a tiny board and conversion losses are smaller with smaller input voltage.

>> No.1962330

>>1962328
>Transmission losses are insignificant on a tiny board
Not at the currents the rpi board draw.
And they're a royal pain to power reliably. A major pain point with rpi boards in general, worse than ever on rpi4 due to the even higher draw.

>> No.1962336

>>1962330
>Not at the currents the rpi board draw.
No, the losses will still be insignificant with properly sized traces.
The Pi already becomes unstable below 4.8V - so there can't possibly be more than 0.2V drop in the traces. And even that would be less than a Watt of transmission losses.

>> No.1962337

>>1962336
The losses aren't from the traces, but the USB wire itself.
5v isn't a good voltage to carry over distances.

>> No.1962339

>>1962336 >>1962328
There's reasons qc3, usb-pd and so on use higher voltages.

>> No.1962342

>>1962339
There's also a reason to use 220V in your house wiring. None of those really matter in a tiny board that draws 10W at most.

>> No.1962351

>>1962342
>tiny board
Size of the board is irrelevant
>draws 10w at most
Actual draw of the board is indeed relevant
>none of this matters
If you plug your rpi straight to the wall, sure.
If there's a wire in between, 5v means a lot of loss on just the wire. The longer the wire, the more the loss.
I expect rpi5 to support usb-pd. It'd really be shameful if it still did not, but I wouldn't put it past the raspberry pi to do that.

>> No.1962354

>>1962351
What's shameful is how rpi4 are sold without a heatsink, and absolutely do need one.

>> No.1962360

>>1962354
The sole hardware UART is still occupied by bluetooth. Despite new SoC for rpi4 and everything. Raspberry is simply trash.
Hopefully there'll be multiple cheap SBC-capable RISC-V SoC in early 2021, thus the beginning of the end for rpi.

>> No.1962361

>>1962342
>None of those really matter in a tiny board that draws 10W at most.
It can pull over 10W, but losses come down to current over distance, not voltage.
For DC, trying to carry 2-3 amps across 5 feet of wire is much more difficult than even 500mA. That is why we use 5V a lot instead of trying to run even 3.3v across a wire.
PoE runs at 48V or even higher, then uses a buck converter to drop the voltage down. 48V at 500mA is 24 watts of power, and isn't too bad over long distances of Cat5/6 cable. You can buck it down to 5v at at least 4 amps at the end of the cable, but that 5V/4A won't travel worth shit over the same distance.

>> No.1962363

>>1962351
>Size of the board is irrelevant
Wrong. Length of the wire/traces is highly relevant for transmission losses and is obviously limited by the size of the board.

>If there's a wire in between, 5v means a lot of loss on just the wire. The longer the wire, the more the loss.
Which has absolutely nothing to do with the Pi itself. This is completely outside anything I'm talking about.

Use a better thicker wire or a shorter one.

>> No.1962366

>>1962363
>Wrong. Length of the wire/traces is highly relevant for transmission losses and is obviously limited by the size of the board.
No, you simply don't get it.
It is irrelevant BECAUSE we know the power draw of the board. The How it is achieved isn't relevant.

>> No.1962367

>>1962363
>Use a better thicker wire or a shorter one.
Or a board that doesn't suck, i.e. has a proper input voltage range.
The rpi is absolute garbage, designed by donkeys with not a clue about electronics.
>>1962361
>>1962360
>>1962354
>>1962339
These guys do get it.

>> No.1962374

>>1962367
>Or a board that doesn't suck, i.e. has a proper input voltage range.
>The rpi is absolute garbage, designed by donkeys with not a clue about electronics.
Even with 12V you'll get a significant power losses if you run it through several metres of aluminium wire.
There's absolutely nothing that forces you to do this.
What stops you from putting the power supply right next to the Pi? You know mains extension/power strips are a thing, right?

Now, I'm not saying that old USB is a great way to transmit power - it isn't. But it's done for very obvious reasons: it's very standard and everyone has a phone charger at home that can power it.
It's not because HURR DURR Pi engineers so dum I are so much smartester.

>> No.1962378

>>1962374
>What stops you from putting the power supply right next to the Pi? You know mains extension/power strips are a thing, right?
This reads like purchase rationalization.
Fact: Raspberry pi boards are shit.

>> No.1962379

>>1962374
>it's very standard and everyone has a phone charger at home that can power it.
This was a thing with the raspberry pi 1, which drew less than 1A.
The newer boards, not so much. Raspberry forums are full of people with issues to do with power supply.

>> No.1962383

>>1962378
I don't even use a Pi. (though the SBC I use also uses 5V - it's right next to a 5/12V power supply along with several hard drives in a case).

Your argument is still retarded. These power inefficiencies you talk about have nothing to do with the board itself but your setup.
Whether you use a 5V or a 12V board, they all need a 5V supply just for the USB ports. The only difference is that with the Pi, it's in your hands where it is placed.

>> No.1962384

>>1962383
>more purchase rationalization.
Stop already, it's unsightly.
>they all need a 5V supply just for the USB ports. The only difference is that with the Pi, it's in your hands where it is placed.
That's not an advantage. Converting to 5v at the very edge is the best, both for efficiency, and the fact you'd actually get 5v at the port, rather than less.

>> No.1962392

>>1962384
>more purchase rationalization.
You're like a broken record. I don't need to rationalize the purchase of a board 5 years ago as opposed to a board that doesn't even exist yet now.
I do have legitimate troubles with that board but they're about software support. Which for me would be the biggest advantage of an embedded Ryzen board - I couldn't care less about 5V or 12V.

>That's not an advantage. Converting to 5v at the very edge is the best, both for efficiency, and the fact you'd actually get 5v at the port, rather than less.
We're talking about something like 15cm as opposed to 5cm.
You save more power taking the LEDs of the board.
It's not a major source of inefficiency like you claimed unless you're setup is really retarded.

>> No.1962401

>>1962392
>You save more power taking the LEDs of the board.
It has nothing to do with saving power, but rather, with offering 5v at the us connector, and not any less.
USB devices do not like that. Refer to the polyfuse fiasco on the original raspberry pi, which could not even power a keyboard and a mouse under typical circumstances.
>It's not a major source of inefficiency like you claimed unless you're setup is really retarded.
Calm down. You're at the point of making ridiculous typos. There's nothing retarded or rather, there shouldn't be, in powering the board with a 1.5m cable to a phone wallwart. That's supposedly (comical as it is) why the rpi takes 5v in.

>> No.1962419

>>1962401
>It has nothing to do with saving power
This whole discussion has been about power efficiency!
A 20W SoC is somehow more efficient than a 10W board because of 5V. This is what the whole argument has been about.

>with offering 5v at the us connector, and not any less.
Oh god, a typo! Your argument is invalid.

But seriously, all very avoidable with a 5V board. You don't need the 5V regulator literally next to your USB sockets. A desktop computer doesn't do that either.
I don't know all the problems a Pi may has but it's not an inherent problem with a 5V supply.

>There's nothing retarded or rather, there shouldn't be, in powering the board with a 1.5m cable to a phone wallwart.
How is it not retarded to power a board with something that can't supply as much as it needs? There are plenty of chargers that can supply 5V 2A stable, any decent phone comes with one. Sure, there's lots of crap too that can't but I don't see how the Pi guys are to blame for that.

>> No.1962424
File: 242 KB, 941x841, 1585611816213.png [View same] [iqdb] [saucenao] [google]
1962424

>Raspberry Pi, the SBC for the masses! For children to learn about computers!
RPI1 preorder batches and the first batches after that shipped with unreliable non-working USB ports, due to low voltages. Soldering a bypass around the overcurrent protection fuses was required.
A firmware update changed the address at which the kernel is loaded, causing a lot of grief.
RPI2 was sensitive to light, rebooting at random, or reliably when hit with a camera flash.
RPI3 introduced bt support, occupying the hardware uart. A b0rked uart which clock tied to CPU clock replaced it.
RPI4 didn't solve the uart problem, lacks a heatsink despite needing one, and released with a broken implementation of USB power negotiation, causing it to not work with many usb chargers. It took several months for the rpi foundation to ship a new version of the board with a fix.
The power draw of ALL versions of the board has at the point of their respective releases been too high for the usb chargers common at the time. This actually got worse every release. The last few simply require the user to buy a purpose built usb power supply. No Raspberry Pi models support usb-pd or even the older high voltage fast charge standards such as QC, despite availability and ubiquity of these standards.
TL;dr: Raspberry Pi are garbage, and the Raspberry Pi foundation has consistently demonstrated lack of competency at designing reliable or easy to use hardware, and also at maintaining compatibility across hardware versions, down to basic peripherals such as the UART.
Marketing. Mindless drones will drone.
>>1962419
>This is what the whole argument has been about.
If you believe that, you're beyond salvation. This originally was about embedded Ryzen boards being better than rpi boards, which they are. They provide higher CPU and GPU performance, more peripherals, higher reliability, better compatibility (being amd64), and quite possibly, lower idle power draw. Taking higher input voltage is just the cream on top.

>> No.1962433

>>1962424
There's more. 3b+ shipped with a "gigabit ethernet" NIC that had latency spikes, packet loss or even connectivity loss unless forced to 100mbit. Firmware updates only partially mitigated this.
And there was the fiasco with the camera DRM.
>insert picture of wojak excited about some new Raspberry Pi release, I am too lazy to.
Raspberry Pi: Never fucking ever.

>> No.1962448

>>1962424
As a reminder, my original post:
>I'm sceptical that you can build a complete embedded Ryzen system with less power draw.
And all I get is retarded shit about insufficient power cables or general whining about Pis. But nothing to convince me about a possible Ryzen system with less power draw.

Okay, that's not completely fair - someone brought up better fab which is a completely valid argument. But even AMD's lowest number for the SoC itself are 6W @ idle/low load is higher than a whole Pi board idling.

>> No.1962454

>>1962448
>But even AMD's lowest number for the SoC itself are 6W @ idle/low load
They have ryzen chips with TDP at 6W. TDP definitely is not idle.
Full board idle power is unknown but presumed low, due to the use of a SoC rather than a chipset.
I wish there were appropriate reviews of these, but I sadly couldn't find any.

>> No.1962459

You all talk shit on the RPi but when I asked for alternatives you didn't specify any. What's an alternative to a RPi that can run some Linux distro at the same price point and supports packages like tflite?

>> No.1962465

>>1962459
Check archlinuxarm device list. Or netbsd's 64 bit arm port list.
Allwinner and rockchip are have cheap SoCs with very good Linux support. The makers of Cubieboard, Pine64 respectively have a bunch of boards with newish SoCs. They have consistently been more solid than anything from raspberry, and often they've been faster, have had better Linux mainline support, and more features (such as SATA).
iMX6/8 are really good chips, but less cheap. I'm not sure who makes boards with these at the time.
TFlite is a bit of a special case you'll have to research yourself. I don't think it uses hardware acceleration, so it likely actually works well anywhere Linux runs.

>> No.1962473
File: 56 KB, 1172x659, 1586459323599.jpg [View same] [iqdb] [saucenao] [google]
1962473

>>1962433
Yes, that's what happens when you put a gigabit NIC on USB 2.0.

>> No.1962474

>>1962454
>Full board idle power is unknown but presumed low, due to the use of a SoC rather than a chipset.
x86 SoC are nothing new. There are several SBC that use an Atom-based SoC.

>> No.1962477

>>1962474
>x86 SoC are nothing new. There are several SBC that use an Atom-based SoC.
Correct, and I have a few such boards. But I don't have a Ryzen one, nor a review that has done measurements, so I can only make educated guesses.

>> No.1962503
File: 75 KB, 482x427, d90.jpg [View same] [iqdb] [saucenao] [google]
1962503

>>1962424
>Over half of the seven million Raspberry Pi units we sell each year go into industrial and commercial applications, from digital signage to thin clients to process automation. Many of these applications use the familiar single-board Raspberry Pi, but for users who want a more compact or custom form factor, or on-board eMMC storage, Compute Module products provide a simple way to move from a Raspberry Pi-based prototype to volume production.
>from https://www.raspberrypi.org/blog/raspberry-pi-compute-module-4/
This is the current absolute state of modern meme maker hardware design. I dabbled with RPis years ago and they were flaky pieces of garbage. They aren't suited for realtime deterministic execution and don't even have a hardware watchdog and people are putting them in process automation, god help us.

>> No.1962521
File: 671 KB, 600x861, 1601765787379.png [View same] [iqdb] [saucenao] [google]
1962521

>>1962503
Better not read this article, then:
https://microkerneldude.wordpress.com/2020/11/07/no-safety-without-cyber-security/
The absolute state of mankind.

>> No.1962771

>>1961897
nvidia SBC boards. xavier, jetson, nano. all are better than the pi at processing speed. nano 2gb is the same price as a pi. for $100ish you can get a 4gb version.

>> No.1962920

>>1961897
What about sticking with Pi and getting a Coral TPU accelerator usb dongle thing?

>> No.1962962
File: 183 KB, 907x892, Capture.png [View same] [iqdb] [saucenao] [google]
1962962

Am brainlet trying to port some ugly ass C code to an 8051.

I have an AT89C51 and PICkit 4. Is the pin diagram shown correct or do i need some line driver bullshit?

Also, I have an external oscillator on the AT89C51 if it matters.

>> No.1963170

>>1962920
Or getting anything else than a Pi, and plugging the usb dongle all the same.

>> No.1963176

>>1962771
>>1962920
>>1963170
I am aware of those, but I'm not working with the meme of image recognition for video thing so I really don't need that much computational power for inference for these projects I want to do. As I mentioned, you can run it on a Teensy - but I'd like to have linux running on the board. I was thinking of just getting a bunch of pi zero w which are cheap as fuck, looked around and there's a few alternatives but the zero W is the cheapest.

>> No.1963179

>>1963176
>pi shit
Refer to >>1962503 and >>1962424.
Really, get anything else than a Pi. It's really hard to do worse than a Pi.

>> No.1963188

>>1963179
In practice, though, the pi zero w works fine for the thing I need it for, and it's cheaper than all the alternatives.
I asked for alternatives because I genuinely am willing to try something else if it can do the job better and costs about the same even if it has a learning curve, but I can't find boards that cost so little for the same specs (mainly the memory and connectivity).Maybe if I ever have issues with it or need something more powerful I will try harder to find something else but right now it seems like its fine for the job and you're just recommending other things based on your own emotions.

>> No.1963225
File: 11 KB, 296x170, smol_heater.jpg [View same] [iqdb] [saucenao] [google]
1963225

I'm a total noob. Is it possible to use a microcontroller to adjust temperature in my room ? I have an arduino uno and a small heater, but I don't see how they would interact.

>> No.1963267

>>1963188
Well, you were warned. It's up to you. Don't cry later.

>> No.1963321

>>1962962
looks ok to me, you don't need any line drivers for the pickit, its direct connection

>> No.1963386

>>1963225
this is potential dangerous project for "a total noob"

>> No.1963391

>>1963386
Yeah I searched a bit and you're right. I'll do something simpler before that. 15+Amp is a stinky.

>> No.1963445

>>1963225
What you're missing is that you need sensors first, then you need some way to control the thing. You need enough electronics knowledge to do all that (but less than you would need to make a radio), on top of needing at least a "code camp" knowledge of programming.
>>1963386
lol yes
It's bad enough trying to control something running on mains power (bzzzzt) without basic electrician's knowledge too, but an electric space heater adds a fire hazard on top of it. For that you also need to think ahead to what could go wrong and how to deal with it. There's a reason tilt switches weren't in the first electric space heaters. I'm even getting into the idea of using outdoor Christmas light timers (with the photocell covered) with soldering irons.

tl;dr: Microcontrollers aren't just about knowing how to CPU, but also all of the other stuff that you're making it work with. And all that RasPi shit should have been >>>/g/, almost anything with Linux is way beyond /mcg/.

>> No.1964238

>order some blue pills from chinks
>month later
>they arrive
>yaaay let's make some projects
>check out some tutorials on youtube on stms
>"do not buy blue pills! they are trash, get black pills instead, they are much better"
fuuuuuuuuuuuuuuuuuuuuuck

>> No.1964255

>>1964238
Even the blue pills are probably overpowered for whatever project you had in mind.

>> No.1964270

>>1964238
black pills are almost the same as blue pills. IIRC they even use the same microcontroller.
The differences are on the board itself... pin layout is different (supposedly better) and power design is also better.
Chances are, for whatever you will do, it won't matter.
See GreaseWeazle for an example cool use of blue pill.

>> No.1964273

>>1964238
>>1964270
GreaseWeazle also has a tool ("blink test") which will check if your bluepill's microcontroller is a fake.
It tests several parts of the hardware, then loop-tests the sram. Debug output is thrown out via serial pin.

>> No.1964286

>>1964270
i hope this was a troll post for your own sake fren

black pills use the 4 line of stm chips while blue pills use the 1 line, the 4 line has about 20 times more processing power and additional built in peripherals

>> No.1964288

>>1963225
I did this as my first project and stopped at the end. Used a DHT12 sensor connected to a relay that would turn power on and off for a certain temperature. The problem is, you need to connect it to power and would need to want having a self constructed power switch connect to cheap chinese copper in your house. You could use a strong servo arm to push a switch that turns the device you want to control on and off, but I haven't tried that myself.

>> No.1964295

>>1964286
>black pills use the 4 line of stm chips while blue pills use the 1 line
?!
https://stm32-base.org/boards/STM32F103C8T6-Blue-Pill
https://stm32-base.org/boards/STM32F103C8T6-Black-Pill
>i hope this was a troll post for your own sake fren
As you see, it wasn't. Your assumptions were, instead, wrong.

>> No.1964552

>>1964288
? You can just use a normally open relay. What the fuck are you talking about?

>> No.1964555

>>1964295
lmao you slapped him

>> No.1964560

>>1964286
They also cost more than twice as much as blue pills. I've already got a bag of blue pills from a couple years back. I dgaf about CPU speed, I've mostly been pin-limited anyhow. And I know blue pill works with mbed, one less thing to fuck with. And I've been working with 32F103 for 10 years now.
If I ever need the RAM or flash, then I'll bother.
>>1964295
>Google for stm32 black pill
>results say 32F401/F411
Maybe some old ones are F103, not new ones. That's the thing about keeping similar chip pinouts through multiple generations. Just drop the new one in instead.

>> No.1964580

>>1964552
This. I used to work on commercial lighting shit, the kind that you had to get professionally tested for safety ratings, and we always used relays to control AC power. Bonus: a sturdy enough relay will work on any kind of AC. SSRs are for amateurs. But a servo to turn a switch? That's Arduino-tier stupid.

>> No.1964597

>>1964580
To add to this, if you're so scared you can add redundancy using a second, normally closed relay (or normally open but set to closed) which you can turn off (open) in case things get too hot or too much time passes with the other relay closed.

>> No.1965104

Let's say I wanted to run a microcontroller for years without downtime and woth little maintenance. What is the 'best' microcontroller that can be bought, without reverting to TTL logic. I don't actually know what I'd use it for, I'm just curious about the lifespan of a microcontroller such as the classic ATmega328P. Theoretically, the 328P will outlive me. What other microcontrollers could outlive me?

>> No.1965114

>>1965104
I can't think of any single processor that is the best, there are lots of expensive options out there.
Google for "ultra reliable microcontroller" or "radiation hardened microcontroller" or "aerospace microcontoller" for a few examples.
For reliability you'll want a processor with a watchdog, long flash life (or even one-time-programmable memory), an internal clock which the processor will failsafe to, a high temperature range, and ESD safety.
Extreme very expensive example: https://media.digikey.com/pdf/Data%20Sheets/Honeywell%20PDFs/HT83C51.pdf
There are rad-hardened arms and atmegas.
You can even write your software to do majority-voting on all your memory variables and output pins, and stack-depth monitoring for all function calls.

>> No.1965143

>>1951821
It's easy enough to try directly, retard. Just do it and observe.

>> No.1965151
File: 168 KB, 310x510, Screen Shot 2020-11-21 at 14.21.20.png [View same] [iqdb] [saucenao] [google]
1965151

>>1956988
just order them PCBs
>but the waiting time!
you live in a third world country if you don't have local PCB makers

>> No.1965289

>>1965151
i do but what kind of degenerate retard wants to pay $30 + tip for 2 pcbs when you can pay $2 to chinks and get 10 of them with free shipping

>> No.1965292

>>1965289
Is this like the /fit/ tipping the receptionist meme? Why would you tip the factory lmao

>> No.1965299

>>1959853
>stm32 clone
Is there anything wrong with genuine STM32Wx series? I've never seen them being discussed. Everyone seems to use esp chips.

>> No.1965300

>>1965292
>ignoring the $30+
Unless you're selling these things or are building electronics in leui of buying some widget you needed, most of us do this as a hobby. $30 is a good chunk of a normal budget for small hobby shit. Might as well just buy the production widget at that rate.

>> No.1965304

>>1965300
No I agree with you (I checked in my country and one I found had them like 80 euro per 1 board or something).
I was remarking on how funny it seems to me that you'd tip the factory.

>> No.1965308

>>1965299
I don't know, I have never seen one myself.

>> No.1965338

>>1965114
Very interesting stuff. Thanks

>> No.1965353

>>1965299
I haven't heard much about them, so clearly they're still relatively new. New = chinks haven't had time to clone it yet, or to make "night shift" chips.
>>1965151
In a first world country they exist but they're not cheap because of first world wages. It's a trade-off between how fast you want it and how much you can pay. (the third side of that triangle is quality) Then January/February comes, and you have no choice because CNY.
I finally punched in a JLCPCB order for >>1956870 on Friday, it was 5 bucks for 10 boards and another 12 bucks for shipping. Maybe not the cheapest chink boards, but not the sketchiest of companies either. It says order complete waiting for pickup, so it'll probably show up early next week. I can deal with the wait time because I'm not in a hurry, it's not like was for a job or anything.

>> No.1965492

>>1965353
i use jlpcb, they make 5 boards for $2 and the shipping costs only $5
and they are a huuuuuge factory so the shit out the board within like 24 hours, and even do cheap 4 layers boards
like jesus christ, i pray there is never revolution in china to overthrow communisim like in other countries, because i chink workers start getting paid living wages and stop being treated as disposable drones prices of literally 90% of items i use in my EE hobby will go up ten times at minimum

>> No.1965645

>>1963225
>put a temprature sensor somewhere in the room, like get one of the cheap ESP boards with a temp sensor. Put it on the roof or wherever you sit for most of the day.
>have it send readings over to another ESP/Arduino over wifi or bluetooth or whatever interface you chose.
>the second esp/arduino is hooked up to a servo which turns the knob on your heater with some wooden or 3d printed contraption

Still probably a bit dangerous, like other anons said. Space heaters suck, remember to have your room well ventilated if especially if you leave it on overnight.

Rather, build a air quality/carbon monoxide detector that beeps your phone when it hits a certain level so you can turn off the heater or open your window for a bit.

>> No.1965671

>>1965645
Why would they need a monoxide detector for use with an electric heater?

>> No.1965680
File: 101 KB, 1105x960, 1598565961970.jpg [View same] [iqdb] [saucenao] [google]
1965680

This is perplexing to me. Maybe one of you geniuses can answer this for me.
I have two identical (same model) Raspberry Pi's. If I take the SD card from one and put it in another, it boots just fine and I can log in with ssh.
HOWEVER, when I try to sudo on the new one, I constantly get "wrong password".
I can SSH (with a keyfile) into it just fine.

RasPi #1: account's password was created on it and everything works fine
RasPi #2: micro SD card from #1 boots just fine but I can't sudo. can ssh in just fine (with a keyfile)

wtf is going on?

>> No.1965686

>>1965680
Welcome to rpi.
They a shit.

>> No.1965724

>wanna go the garduino route
>all of the moisture sensors last like a season and then crap out
any decent moisture sensors out there that don't cost an arm and a leg or a way to make a good one yourself?

>> No.1965737

>>1963225
You could go with an HVAC relay. They're meant for carrying quite large loads. They're called contactors for whatever reason in the HVAC field. As long as the original heater has it's original safety features still functioning I don't see how this could be dangerous unless you don't properly shield the contactor inside an enclosure and you electrocute yourself or some shit. You're essentially just unplugging the heater with the relay after a certain temp is reached. Unless the heater itself has some MCU fuckery inside it that gets reset every power cycle it'd work.

You wouldn't need to screw with the heater at all. you could just make an enclosure with a wall outlet in it that will only feed power to the outlet below a certain temperature

>>1965645
>electric space heater
>carbon monoxide detector
wat.

>> No.1965773

>>1965680
Keyboard / Usb issue sounds like. Using the same keyboard for both or do they each have their own keyboard?

>> No.1965775

>>1965773
Same keyboard, anon.
And I'm trying to sudo through the ssh so it can't be the keyboard. I can run any other command... but sudo password is not accepted.
Weird af.

>> No.1966078

>>1965724
If you use them as intended (reading every few minutes instead of constantly passing electricity through them) they last a long ass time.

>> No.1966227

>>1965775
MAC address related? some local login related service is perhaps tied to an ethernet port which doesn't exist.
Is linux calling ethernet interfaces the same in both boards?

>> No.1966286

>>1965775
>>1966227
On Mac, the "keychain" and other things apparently include the serial number of the machine that generated it. I've bumped a drive between different machines and it gripes about the keychain every time. But that's the keychain, which is just an encrypted store for you to save passwords. Everything else still works the same.
>MAC address related?
There's nothing to keep you from having more than one network interface. On Linux maybe it uses the CPUID? I still can't see how sudo would even know about that.

>> No.1966291

>>1966286
>There's nothing to keep you from having more than one network interface
Sure, but something login-related might be tied to it.
>I still can't see how sudo would even know about that.
A pam module is screwing you up. Or systemd-logind crap.

>> No.1966313

>>1965680
sounds like a you problem
i have moved sd cards between rpi 3bs several times before and never had any such issues

are you using raspibian os or some meme os?

>> No.1966610

Is there any danger with connecting a CR123A battery bank directly to a buck voltage regulator? Im using a TPS62050. I'm planning on putting one pair in series and one pair in parallel for max capacity at 6V. Do I need an additional protection circuit?

>> No.1966740

>>1966610
you should always put protection on your power inputs. for things like reverse voltage, over voltage and overcurrent protection.
I prefer to use an e-fuse since it's a all-in-one complete package and easy to integrate onto designs.

>> No.1966744

>>1966740
thanks, I'll look into that. Not familiar with one but I have my PCB printed already. I can find a way to add to the prototype.

>> No.1966860

Is there any decent secure encryption available for the arduino ide? i would like it to work on things like 328p and stm32
Regular encryptions used on normal computers are just too big and heavy for micros, so i am looking for something decent.
It doesn't have to be like NSA tier secure, but it should be able to fend off your typical neet hacker neckbeards

I basically want to encrypt a character string, send it wireless and then decrypt it on the other side, using some preshared key

>> No.1966964

>>1966860
For sending a string you can literally implement most encryption algorithms. I would use the one with inverse matrices.

>> No.1966971

if i use a chip that isn't vanilla arduino (atmega328p), but one like attiny85, or esp32 and i do something like
#include <SPI.h>
is it including the library for the uno, or a modified library the dude who created the say attiny85 support made?
I just want to make sure it's not including the vanilla libraries since they are of course not compatible with the different chips (different pins, registers etc)

>> No.1967012

>>1966971
#include doesn't include libraries, it includes header files, those simply tell the C compiler what functions are available. Libraries come in at link time, and there's going to be a set for each different chip hardware, selected by the IDE configuration for your project.
And the .h files also do things based on the chip type but usually by #if/#ifdef stuff.
This is one of those fundamental things that they don't teach in lrn2code boot camp.

>> No.1967086

>>1951783
Is there any significant power consumption difference between cheap arduinos? I am using a knockoff nano that will be idle 99% of the time and running off of a 1 cell lipo.

>> No.1967095

>>1967086
don't use a board then, use the 328p chip directly, or even better something like stm32l0 series (also compatible with fartduino ide)

>> No.1967133

>>1967095
>stm32l0
Is there a reason I would want to use the older version L0 instead of L4?

>> No.1967197

>>1967133
Not him but it's not an older version, but a different processor family. L4 would probably be overpowered

>> No.1967203

>>1967095
>>1967197
https://github.com/stm32duino/Arduino_Core_STM32
Thoughts on buying one of the Nucleo 32 L0 or L4 boards and using it as an arduino? I don't know enough about making custom circuits and pcb to buy the chip itself without a dev board.
Probably the L4 since it has more flash.

>> No.1967209

>>1967203
If you want an arduino get an arduino. I use stm32s (blue pills and a F4 board) and I like them but it sounds like you'd be more comfortable with an arduino or an ESP because of the libraries and support. ESP boards have low power mode and it's easy to use.
I'd absolutely get an STM32F103 board to fuck with though.

>> No.1967224

>>1967203
if you are an amateur stick to arduino pro minis, they are great, small, but exactly same chip as arduino uno, and have huge communities and libraries writter specifically for them

If you gonna go for the stms buy black pills, the ones with f411, they have probably the biggest fartduino community out of all stm32

>> No.1967278

>>1967203 >>1967197
>I'd absolutely get an STM32F103 board to fuck with though.
Seconded. Black pills are almost free. The F1 is a quite basic model that's been around for a while and is very popular and well understood. If you want to try stm32 out, get one of these to begin with. You can get something more fancy and expensive later, if you feel the need.
Despite, it runs laps around any atmega chip, while offering way better on-chip peripherals.
Refer to >>1954020
>>1967133
L0 isn't old. It's Cortex-M0+ based. It's merely lower density than, say, L4.
>>1967224
Why pro mini (micro?) over nano? Nano's the 328P. Most standard avr8 chip there is.

>> No.1967291

>>1967209
>>1967224
>>1967278
What are these blue pills and black pills you refer to?

>> No.1967294

>>1967291
>blue pill
thinking that you can get a woman attracted to you by having game, or a cool personality
>black pill
realizing that women only care about your physical looks and unless you are at least 7/10 it's over

>> No.1967296

>>1967291
dev boards with STM32 chips. Very cheap, really good debugging options with an st-link debugger.
>>1967294
kek'd, /r9k/ at it again

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

>>1967291
https://stm32-base.org/guides/getting-started
https://stm32-base.org/boards/STM32F103C8T6-Blue-Pill
https://stm32-base.org/boards/STM32F103C8T6-Black-Pill
TL;DR they're popular chink devboards.
The black pills are newer, slightly better, and have variants using other families like F4 or L0.
But STM32F103C8T6 is still the most popular stm32 µC. Get a black pill based on that if you never had stm32. That model is the atmega328p of stm32.
While they have a serial programming-capable bootloader, almost nobody uses it. You'll see guides and such just assume you have a stlink. The st-link v2 is pretty much standard and they cost next to nothing, so grab one.

>> No.1967299
File: 1.59 MB, 1656x1243, 1604545141783.jpg [View same] [iqdb] [saucenao] [google]
1967299

>>1967294
>>1967296
>>1967298
Thanks guys

>> No.1967303

>>1967299
have fun fren

>> No.1967349

>>1967298
>st-link v2
well no shit, i can't even imagine developing for micros without inline debugging and shit like breakpoints in my code

when i think back to using shit like blinking leds on my attinys, or printing to serial on fancier micros, to debug i get sick to my stomach

god bless insectoids for driving the prices into the floor, i can literally buy two high powered 32bit micros for the cost of one hotdog

one thing i don't like about the stms tho is that they require like trillion caps on their vccs if you want to run them properly, 328p doesn't need anything if you are okay with using the shitty internal oscillator

>> No.1967354

>>1967349
>328p doesn't need anything if you are okay with using the shitty internal oscillator
You should use at least use two caps one for VCC and one on the reset line. You need 2 more if you want to use the ADC.

>> No.1967355

>>1967354
>on the reset line.
?! why?
Isn't it internally pulled up? You can even leave it floating. It won't auto-reset.

>> No.1967356

>>1967349
I still print to serial for debugging sometimes even though I have an ST Link. I just find it faster idk.

>> No.1967364

>>1967355
The internal pullup is very high resistance so a strong noise can still interfere.

See Chapter 3 for Atmel's recommendation for the reset pin:
http://ww1.microchip.com/downloads/en/appnotes/atmel-2521-avr-hardware-design-considerations_applicationnote_avr042.pdf

>> No.1967367

>>1967364
I see. Neat application notes as always.

>> No.1967389

>>1967294
>unless you are at least 7/10 it's over
A faggot with no game and no confidence wrote this post.

>> No.1967531

>>1966860
>I basically want to encrypt a character string, send it wireless and then decrypt it on the other side, using some preshared key
use a micro with a hardware crypto module. even better use a nrf52 micro and use bluetooth encryption to send your data over the air.

>> No.1967533

>>1967086
msp430 in power save modes sip microwatts of power

>> No.1967563
File: 84 KB, 736x975, 1601922779941.jpg [View same] [iqdb] [saucenao] [google]
1967563

recently picked up some stm32 products. played with pic 10 years ago but basically no embeded dev skills. I know rust, am i a retard for using rust on stm32? should i use c/c++?

>> No.1967693

>>1967563
you can but in my experience the majority of code examples and libraries are in C and sometimes C++(though most "C++" use the C code as a base with extern "C" wrappers). Especially when starting with a new platform it is really helpful to be abler to find peripheral access examples in the language you are using but with rust if it doesn't exist and you cant write one you're going to be left with using an unsafe wrapper. Then what's the point of using rusts "safety features".
Unless you think you will be absolutely retarded when writing code and doing unsafe things, which C lets you do, and need the compiler to hold your hand then sure use rust.

>> No.1967732

>>1967563
Use stm32-base and c. That's the easiest path to take.

>> No.1967741

>>1967563
I'd try out using Arduino to program it at first, using PlatformIO or the Arduino IDE makes it super easy.
Another option is to use mbed, again with PlatformIO or Mbed Studio.
If you then want to learn how to get every single bit of juice out of your micro, you would do this >>1967732, although it's by far NOT the easiest path to take and IMO you should only do this if you are really interested in embedded development (even if it's still just a hobby, it might be fun to talk to an LCD screen by writing bits on registers - but if you just care about talking to an LCD, just use Arduino) and not just making projects.

>> No.1967754

>>1967563
like was said, use arduino, it's very easy to learn and it has many safe checks built into its functions so fucking up is really hard
and the best part is that stm32 maker officially supports arduino for many of its chips
Now do NOT listen to the autists who will tell you lies like "lol use assembly, arduino is for babbies". Developing code in arduino can be iterally 10 times faster and more stable than some autism language the local neckbeards use because it makes them somehow feel superior for some reason.
The only situation where you don't want to use arduino is when you need something happen faster than arduino can do (for example very fast sampling of analog pins, since analogRead from arduino takes extra time to read it because it also executes several safety checks to eliminates bugs like crosstalk and such) but this won't be the case in 99.9% of your project.

Stms have two big drawbacks though, the first is the have no eeprom, this means you have to use flash as eeprom and that is very shit solution for several reasons i won't go into.
The other is, its pins can't source or sink nearly as much current as avr chips
hope this helps fren

>> No.1967781

>>1965114
Hah, I have drawer of these Honeywell uCs! Good luck getting any again, Honeywell doesnt run this 800nm SOI fab process anymore

>> No.1968382

>>1967741
I'm the person you quoted,
Just wanted to add: stm32-base adds some degree of abstraction. It's not like you're out there naked.
See: https://github.com/STM32-base/STM32-base-F1-template/blob/master/src/main.c
Notice the include on top. You could use a different family, with different memory map, with minimal effort.
I do agree with you that for "put text on LCD" or "blink some LED", stm32duino is easiest. It is probably the best way to start, test that the devboard works and all that.
But please, if you want to continue and do more complicated stuff than testing, stm32-base + CMSIS &| HAL.
Refer to datasheet, and to the CMSIS/HAL documentation: https://www.st.com/en/embedded-software/stm32cube-mcu-mpu-packages.html#documentation
Plenty of examples are provided.

>> No.1968699

>>1968382
So you really believe someone who wants to make e.g. an HID or something to do cool shit with their christmas lights or essentially 99% of hobbyist projects should work with bit math on registers and write 200 lines of code to talk to something for which a library exists to do that in like 2 minutes?
Don't get me wrong, I know how to do it and I actually like to mess around with doing things that way sometimes, but if your goal is "I want to make X" then the best way to do that is using every tool available to make X as fast and as easily as possible, making it easy to change/expand in the future, while within the means of the micro. If you run out of flash or memory or something (has happened to me when doing on-node STFT), or going for a production build, maybe then try to optimize.
Telling a beginner to use stm32-base is not helping. Showing them that hey, this is one option if you really care about going deep into it, that might actually help.

>> No.1968838

>>1967356
It depends on what you are looking for. I love my debuggers/emulators to death, but sometimes its easier to shift out a few registers over serial for quick and dirty debugging.

>> No.1968843

>>1968699
I think you hit it right on the nose.
I used to think that Arduinos were shit, but if you're looking to learn as a beginner, or just make something really quick, its pretty useful.
I still believe that if you are going into very complex stuff that needs to be efficient and mass produced, you need to go deeper for the very fine detail control of your code and the micro.
I've seen a LOT of people really lose interest in frustration because they relied on libraries and very high level coding so much that they couldn't troubleshoot issues that didn't 'just work'.

>> No.1968899

>>1968838
My first ever job task as an embedded dev, my only actual debugging tool was a comm scope (pretty cool, but nobody was using it because they had started using PCs with this ware called COMLAB). I was working on code to talk to a little device over a serial port with a rather simple protocol. I quickly realized that I could just fuck everything and cram short debug messages over the serial output, then take it out when done.
>>1968843
I only avoid Arduino because I was already introduced to STM32 ten years ago. I had actually done some AVR code a couple of years before that, it's not a bad architecture if you don't mind separate address spaces. For me that's just too much fiddly, especially when I can get 32 bits for not much more cost. Really, the only true breakthrough of Arduino was that it came out just as MCUs started to have flash and cheap debug pods, and that Wiring library stuff too. And also it wasn't a fucking PIC, which (except their MIPS stuff) is horrible to compile C for.
I almost had to maintain some legacy 68HC12 crap, but we only had one good debug pod left (two hundred bux plz), and it was on the production floor, so I could only borrow it for short moments. My only actual maintenance of that code was a single-byte binary patch, and that still took days to fight the checksum shit and crazy loader hardware.
Also the first thing I did on STM32 was trying to get I2C working, their old (pre-HAL) hardware library I2C code was written by morons who thought it was sensible to compare a 32-bit status register against hex constants, yeah you gotta be able to write your own from scratch. The coolest was when I wrote an Ethernet driver for lwIP.

>> No.1968930
File: 308 KB, 800x600, printf-debugging-is-the-best-debugging[1].jpg [View same] [iqdb] [saucenao] [google]
1968930

>>1967356
>>1968838
>>1968899

>> No.1968934
File: 253 KB, 499x378, 1491775528664.png [View same] [iqdb] [saucenao] [google]
1968934

>>1968930
It's so funny because it's true.
I've spent hours shaving down debug messages to fit in the UART's transmit FIFO, and with enough delay so that they will have time to get clocked out before doing the crashy thing.

>> No.1968936

>>1968934
I know it is.

>> No.1968941

I want to send an array of floats from a blue pill to a Pi using serial.
I can already do that with printf by using a hack where I multiply each float by 100 and send strings, since mbed has a smaller subset of printf
I was wondering what the best way is. Should I write the float to a string and send the string? Should I send bytes and decode them as floats on the Pi?

>> No.1968992

>>1968941
bump, also someone make a new thread I'm phoneposting

>> No.1969011

>>1968941
The reason embedded usually doesn't have floats in printf is because it DRAGS IN THE ENTIRE FUCKING FLOATING POINT LIBRARY (whether you're actually using %f or not!), which can be pretty big if there is no floating point in your CPU. This is not a good thing when you only have 4K-16K of code space. A good IDE lets you choose which level of printf you want.
Where did these floats come from? Maybe you can send the un-scaled integers that they came from? At worst they should be in IEEE representation, so just send them in hexadecimal.

>> No.1969024

>>1969011
I have to work with floats because I'm doing Fourier transforms and math with complex numbers, but I figured I can use union to send the integer representation of a float. Now I need to figure out how to read that into a float in Python.

>> No.1969201
File: 325 KB, 828x467, B75EADE1-E625-4ADB-824D-8A21E143CA1A.jpg [View same] [iqdb] [saucenao] [google]
1969201

is there some magic way to push these little bitches into the holes, i feel like an actual retard bc they keep bending to the side instead of going in

>> No.1969207

>>1969024
It turned out to be really easy.

>> No.1969209
File: 98 KB, 1300x731, resistor.jpg [View same] [iqdb] [saucenao] [google]
1969209

>>1969201
Bend them like pic related and you can easily push them in by pushing down on the 90 degree angle

>> No.1969373

>>1968941
>I can already do that with printf by using a hack where I multiply each float by 100 and send strings
look up what fixed point math is. Though you should be using base 2 numbers instead of base 10.
The best way would be using fixed point math and send raw hex to be decoded at the other end. Its a basic tool for embedded systems that don't have hardware FPU's

>> No.1969375

>>1969024
>I have to work with floats because I'm doing Fourier transforms and math with complex numbers
no you don't. complex vectors are distributive with multiplication and division from real scalars.
A(B + Cj) == AB + ACj
(B + Cj)/A == B/A + (C/A)j
Scale your inputs lets say by Q12 so a float is multiplied by (1 << 12) and do all your math. at the end take your result and divide by (float)(1 << 12) to get back to a floating point representation.

>> No.1969380

>>1969375
and if you need more precision you scale by a larger Q. be careful though since your int container is only so large. int32 is usually fine but if you work with really large numbers and use a large Q for precision you might need to use a int64 container.

>> No.1969517

so the most popular stm32 chip right now is the stm32f411 ? I want to buy a bunch of them to have a supply. But i want to make sure i get one that has the biggest community support in the fartduino crowd.

>> No.1969558

>>1969373
>>1969375
That's what I'll do when it's time to optimize.
However right now the bottleneck is printing to the serial, it's too slow, takes more time than the fft itself. Experimenting with flushing after sending k values and so on, but nothing works yet.

>>1969517
I'd also like to know because I love working with stm32. If there was a board similar to ESP32 devboards but with STM32 I'd buy a bunch in a heartbeat.

>> No.1969559

>>1969558
>f there was a board similar to ESP32 devboards but with STM32 I'
there is it's called a black pill

>> No.1969563

>>1969559
It doesn't have BLE/Wifi connectivity

>> No.1969588

>>1969563
nobody uses ble, and wifi? you can easily design your own pcb with a wifi module on board and have chinks make it AND assemble it for few bucks

there are premade stm32 wifi dev boards but none are very popular

>> No.1969593

>>1969588
I guess you're right.
I wanted to have the option to use BLE because I have some planned projects that are wearables and also a few ideas of stuff I want to make that go on my bicycle and my car (different purpose) and connect to my phone.

>> No.1969649
File: 320 KB, 730x428, Screen Shot 2020-11-29 at 11.00.17.png [View same] [iqdb] [saucenao] [google]
1969649

>>1965289
>>1965353

so both of you do live in a third world country. It only cost 5$ for 10x10cm board on my local PCB maker, they are not jewish.

>> No.1969655

>>1967086
use ATTiny85 in deep sleep mode at 1MHz, it's going to last you thousands of years

>> No.1969761

>>1969649
You do know that manufacturing is cheaper in 3rd world countries, right?

>> No.1969763

>>1969761
yes, and? you still got kiked

>> No.1969889
File: 4 KB, 519x114, file.png [View same] [iqdb] [saucenao] [google]
1969889

fuck yes! i made aes128 work on my stm32 and with really gud speed. And now to write a simple library so i can just feed it arbitrary char arrays instead of having to feed in 16 byte blocks manually and i will be golden.
Finally my wireless iot projects wont have to communicate in plaintext, where any cuck with an antenna can spy on my shit

feels good man, i bet this is how germs felt when they finally finished their enigma machine

>> No.1969894

>>1969889
Good job anon. Put it on Github and I will use it some day.

>> No.1970068
File: 86 KB, 1632x1224, P1050323..jpg [View same] [iqdb] [saucenao] [google]
1970068

>>1956870
the boards just came in
that board on top was my prototype

>> No.1970132

>>1969558
>However right now the bottleneck is printing to the serial,
what's your baudrate and from what to what over serial.

>> No.1970137

>>1970132
921600.
I'm using an STM32F446RE discovery board, and I'm transmitting to my laptop where I read from the serial using Python.
Each transmission is an integer, for a total of 64 integers per frame. I send many frames.
The problem is on a per-frame basis, since I run FFT for each frame, and by counting cycles I saw that printf takes more than the FFT itself.
For context, for a full spectrogram of 128 frames I might need up to a minute with printf, and about 1.5-2 seconds without.
I tried buffering (not using \n until all integers of a frame have been transmitted) but the speed is the same.

>> No.1970139

>>1970137
your bottleneck isn't the serial or the printf on the micro. its getting the data from the virtual com port in python.
not sure how you're reading the data in python but if you're reading data frame by frame you might be able to mitigate some of the lag by checking how many bytes are buffered and then reading the whole thing into a buffer and parse that instead of reading a single frame at a time.
Alternatively switch to C/C++

>> No.1970143

>>1970137
I just realized you're printing the ints into a string then parsing the strings in python back to int? why not send raw data and use from_bytes to convert to the desired type.