[ 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.09 MB, 904x800, file.png [View same] [iqdb] [saucenao] [google]
1879918 No.1879918 [Reply] [Original]

Arduinos, atmegas, esp32, bluepill, shit man, ever raspberries, we are all inclusive

Microcontroller general, making leds blink since 2004

>> No.1880094

redpill me about FPGAs

>> No.1880110

>>1880094
hit the fpga general my dude

>> No.1880117

>>1880110
b-but it said "we are all inclusive"

>> No.1880129

>>1880117
That's why he said hit it

>> No.1880137

why are the majority of arduino sensors such shit?

>> No.1880150

>>1880137
...arduino makes modules, not sensors.

>> No.1880154

>>1880150
Why are the majority of hobby grade MCU sensors such shit?

>> No.1880167

>>1880154
sensors don't care what MCU you use them with. It's a poor craftsman that blames her tools.

>> No.1880211

>>1880167
I do blame my tools when they randomly stop working or they start spitting off erroneous values out of nowhere when no environmental variables have changed. So let me repeat my question;

Why are the majority of hobby grade MCU sensors such shit?

>> No.1880216

>>1880211
"hobby grade MCU sensors" is something you're literally making up, m8.

>> No.1880247
File: 6 KB, 126x114, laughingwhores1.jpg [View same] [iqdb] [saucenao] [google]
1880247

>>1880216
>can't answer the question
>pretends it doesn't exist

>> No.1880249

>>1880247
Ok, m8, pull one up.
> it's going to be a module
> "hobby" won't appear on the actual sensor's data sheet

>> No.1880250

>>1880249
> it will work with any MCU with appropriate peripherals
> the MCU won't say "hobby" either

>> No.1880257

>>1880250
>>1880249
>being this pedantic over the word hobby

>> No.1880258

>>1880257
it's not pedantic, you're complaining about something which LITERALLY does not exist. There is no such thing as a "hobby grade" sensor or MCU, however you want to spin it.
There's specs, that's it. avr's aren't hobby grade just because hobbiests use them. Chink shit servos aren't "hobby grade" just because they are small, weak, and inaccurate. They are all tools which have specs. Something isn't "hobby grade" just because it's rated to a low voltage or even low accuracy.

>> No.1880261

>>1880258
No you're right you're not being pedantic. you're being downright autistic. Maybe I should rephrase the question into a quasi-legal form?

Why are most sensors that inevitably end up in the hands of most arduino users(OR anyone that uses ANY micro controller unit 'as a hobby'(defined as anyone using such devices without the express purpose of designing a commercial product, intending to profit off of, or for use with any industrial or workplace purposes)) such shit?

Does that satiate your pedantic autism?

>> No.1880265

>>1880261
Considering I am an EE and do this shit "for real", and it's all the same shit, I'm going to go with my definition.
Again, post a sensor you're talking about. They are spec'd for usages. If you pick the wrong sensor, it's your fault. If you buy some retarded adafruit module that has an incorrect implementation, that's their fault, (and yours since you could inspect the design) but the sensor itself was probably fab'd by a real company.
So seriously, stop making retarded claims. Post a sensor.

>> No.1880266

>>1880265
>EE
that explains the autism.

You're still avoiding the question though.

>> No.1880271

>>1880266
the premise is fucking retarded, there's no answer because the question is nonsense.

>> No.1880292

>>1880266
not the same anon but I can't tell if you're just trolling so I'll bite:
The Arduino market is filled with people that don't demand high accuracy sensors, they just need to be easy to use and cheap. It's not rocket science to see this.
Want a 0.01° accuracy temp sensor? It probably exists but it won't come cheap at all as you need to make sure the circuitry itself doesn't influence your readings. Would a random person pay $50 just for such sensor board plus any extra materials?

>> No.1880296

>>1880292
Thanks for the non-autistic answer.

Basically it can be shortened to "fucking chinks, man", right?

>> No.1880330

>>1880154
two reasons:
the sensor is good but the user is retarded and uses it incorrectly
or the sensor is cheap and shit and the user is not willing to pay more for a quality sensor, and in most cases this is not needed anyway as the cheap sensor can do the job just fine

>> No.1880333

>>1880296
>"fucking chinks, man"
no, more like, you are being a stingy cunt and this is what you get

pay more, get better stuff, easy

>oh no bought this bag of 100 sensors for $0.5 total and they aren't performing the same way as the $100000 sensors NASA uses, how can that be?

>> No.1880334

>>1880296
I love how you can't even name one fucking sensor to give any kind of back up to your case. Like what are you talking about, a potentiometer? LIDAR? You probably don't even know what a sensor IS.

>> No.1880359
File: 139 KB, 327x239, file.png [View same] [iqdb] [saucenao] [google]
1880359

>assemble shit
>upload code to attiny
>doesn't work
>scream
>2 hours later
>scream louder
>finally figure it out
>when you use pins from A branch you call them PA1 PA2 etc, but if you use B branch and call the pins PB1 PB2, the code compiles and uploads fine, but commands like digitalWrite(PB1, HIGH) do nothing, you actually have to do pin_pb1 instead
words cannot describe how fucking livid i am right know, i want to find the cunt who came up with this piss poor design a kneel on his neck for 8m46s

i am just so tired.... so tired.... ;_;

>> No.1880366

>>1880359
its Port A and Port B, you should learn about general mcu memory and peripheral architecture

>> No.1880385

>>1880211
you are the shit one bro

>> No.1880414

>>1880359
It's been a long time since I did AVR asm, but yeah, GPIO access is usually going to be different between Arduino C vs asm on more than a few MCUs.
For digitalWrite etc, its a sort-of enum which refers to each pin individually, from a .h for the specific board you are using, which is then looked up in a table. This is done in mbed as well as Arduino.
In asm, you have each port as a register like PORTA, or PORTB, and have to mask out the bits. Depending on the MCU, the port register may be 8 bits, 16 bits, or 32 bits. Being able to access a single GPIO pin as a single memory address is uncommon. And when not using Arduino, that's also how you do it in C, and is a lot faster than using digitalWrite... because there's not that table lookup and shit all the time.
So basically you are raging that Arduino's convenient but slow GPIO mapping isn't there when you don't use the Arduino IDE and libraries.

>> No.1880575

Holy fucking shit this general is full of autistic cunts, lmao

>> No.1880591

>>1880575
takes 1 to know 1 fren

>> No.1880598

>>1880359
Hey fren, those are just variable names. IF you don't dig through the code to see what they mean, it's going to bite you.
Stick with pin numbers.

In MCUs, accessing GPIOs is not done "pin by pin". You have to access the whole register (if 8 bit MCU, register is 8 bits, so 8 pins at a time).
To focus on one pin, you use a bit mask to focus on the bit in the register that represents that pin.

so, for example, pi 14 might be the 5th pin in register PORTB. So you need to use a bitmask like 00100000.

so you read PORT B and get a value (01100101) and you and that value with the bitmask (01100101 & 00100000) = 00100000
If you get 0, the pin is lo. If you get anything other than 0, the pin is high.

PBXns are bit masks, not direct pin accessors.

>> No.1880629

>>1880110
What if my FPGA has an embedded MCU

>> No.1880655
File: 230 KB, 800x615, adafruit_products_2045kit_ORIG.jpg [View same] [iqdb] [saucenao] [google]
1880655

I'm trying to make a narrow frequency sweep for this thing, and it's giving inaccurate numbers.
Setting the PLL to 25mhz*90, then dividing it all by 168 should give ~13mhz. But the frequency I'm measuring is only ~4.4mhz.
I tried using the same multiply/divide ratio with a lower multiplier: 25mhz*24, then divided by 45. This gave an accurate 13mhz.
The inaccuracies only start to show up after 25mhz*60, and become grossly noticeable after 25mhz*70.

What could cause this? Why would a multiplier of ~64 be the upper limit, even though the manual says 90 is okay, and why would the deviation be almost logarithmic?

>> No.1880658
File: 8 KB, 240x240, 8357df30.jpg [View same] [iqdb] [saucenao] [google]
1880658

>>1880211

Where did you buy them?

How much did you pay?

>> No.1880687

>>1880575
I wouldn't want it any other way

>> No.1880787

>>1880655
Post code.

>> No.1880789

>>1880629
What's that have to do with redpilling on FPGAs?
> redpill me on hammers
It's a tool. do you need to use it? No? Then don't. It's not a political party or sexual proclivity.
> redpill me on
stop talking like a redditoid and go build something.

>> No.1880796

>>1880787
here's a simpler test that just scales up 25MHz, then scales back down to "25MHz". same problem.
Replace "int a" with different values and test with a scope if they're accurate.
If a=30, results are accurate. If a=50, output is a hair under 25MHz. If a>=60, freq is significantly lower than 25MHz.

#include <Wire.h>
#include <Adafruit_SI5351.h>

Adafruit_SI5351 clockgen = Adafruit_SI5351();

void setup(void) {
Serial.begin(9600);
Serial.println("Si5351 Clockgen Test");
Serial.println("");
if (clockgen.begin() != ERROR_NONE) {
Serial.print("No Si5351 detected Check your wiring or I2C ADDR!");
while(1);
}
Serial.println("OK!");
}

int a = 60;

void loop(void)
{
clockgen.setupPLL(SI5351_PLL_A, a, 0, 1);
clockgen.setupMultisynth(0, SI5351_PLL_A, a, 0, 1);
clockgen.enableOutputs(true);
delay(1);
}

>> No.1880822

>>1880796
Why are you doing config in the loop? That's gonna fuck shit up. do config once.

>> No.1880826

>>1880822
it's a sweep generator. It has to sweep several times per second, indefinitely. How else are you supposed to do it?

>> No.1880842

>>1880826
use setupRDiv instead?

Was there supported to be an "a++" or something?

Looking at the adafruit lib, the PLL divider can only be 1 of three values: 4, 6, or 8.

I think you want to change the clk divider, not the PLL divider, right? pretty sure you use setupRdiv for that.

>> No.1880853

>>1880842
if you reread the adafruit lib, they allow arbitrary multiplication and division of the form (m + n/d). But even with integers, even with config in void setup(), the problem remains:
Why does setting the PLL multiplier to 64, then dividing by 64, give a lower output frequency than the crystal frequency?

>> No.1880857

>>1880796
Is it okay do the setup again while it's already running? Should you stop the chip at the end of the loop before changing its settings? Just a guess, but my spidey sense says watch out for problems if you jam config settings into a running chip if you don't know for sure it's okay.
>>1880822
That's how you show how there's a problem with a chip, do something in a loop once a second and stick a scope on it or something.
>>1880826
>sweep several times per second
It says "Clock Gen" on the board. In my experience, a "clock" signal usually doesn't sweep its frequency. But maybe that's what "multisynth" thing is about. The word doesn't make me think of frequency sweeps, but whatever. It's just not obvious what the code is doing, and don't see how anything about the code implies "frequency sweep", or even what values it's sweeping between.
Anyhow there's a few magic numbers in there and I don't feel like looking up the data sheet or downloading Adafruit's code to see what it's doing, but just as a FYI, I like to do things like put short a /* foo */ comment after a constant parameter to explain it if it's important but not obvious. "60,0,1" doesn't mean anything without the secret decoder ring. It also makes it easier to notice you've fucked up if you take the time to explain a naked constant.
Also good is comments explaining these calls like "// set clock gen to 25MHz" and maybe a #define or something which derives a value mathematically from the number 25 or 25000000, which not only makes it more readable, but it's easier when you have to change the value to something else. Comments that explain what a line of code is supposed to do are a good thing, especially when nobody here is likely to be familiar with that specific chip or the Adafruit code. I know what a PLL is, I don't know what a "multisynth" is.

But you have looked at the data sheet for this chip, right?
Having pre-made code from Adafruit is no substitute for understanding the chip or the code.

>> No.1880880

>>1880857
the sweep code was omitted for clarity, because it was irrelevant. The problem is with the multiply/divide calculations.
The only two comments you may need are:

clockgen.setupPLL(SI5351_PLL_A, a, 0, 1); // multiplies 25MHz by (a + 0/1)
clockgen.setupMultisynth(0, SI5351_PLL_A, a, 0, 1); // divides by (a + 0/1) to give 25MHz, in theory

>But you have looked at the data sheet for this chip, right?
there's a massive power gap between the adafruits "trust me it'll work out" and the si5351 datasheet's "you should already know I2C protocol by heart."
If I could just write bits to a register I would do it in a heartbeat, but I'm not seeing any way how.

>> No.1880909

>>1880880
>If I could just write bits to a register I would do it in a heartbeat, but I'm not seeing any way how.
Just pull out the relevant functions adafruit is using. Switch the write8 and read8 to public in Adafucker_SI5131.h, then you can access them directly on the object.


> even with config in void setup(), the problem remains
Ok, that's clear, just understand it's hard for someone else to look at it and see..oddities in the coding. For example, the functions you're suing make a shit-ton of changes on the chip. It's not at all clear to me that's the intended usage of the chip.

>> No.1880913

>>1880880
Basically every I2C device that I've encountered internally is a few 8-bit registers with auto-increment addressing. If you can talk to an EEPROM you should understand how it work.
If it's just a byte spew in the data sheet, you can tell if there's a 00 at the start or something, because that's an address byte, even if the data sheet doesn't say so. Then you can select just the one register you need to write, but the "Arduino Way" is usually to blast everything out at once.

>> No.1881525

is it possible to drive those cheap chink tablet displays with for example a raspberry pi?

>> No.1882187

Anyone need a library written?

>> No.1882194

>>1881525
post a link. "Yes" but who knows what you're ACTUALLY talking about.
rpis have multiple display adapters, you can answer this yourself by matching the display's connector with available rpi adapter.

Great example of a "doesn't post anything useful to help us help them" question.

>> No.1882214

>>1880266
What’s even the question?

>> No.1882416

>>1880211
>>1880154
combination of outdated sensors with poor signal to noise ratios and the high likelyhood of it being a fake/knockoff since you say "hobby grade" it sounds like you bought it from amazon or ebay.
Besides that even the best sensors are never used "raw" they're used in filters to remove the variance

>> No.1883243

god damn it
so many projects to do, so little time
my box of chinkshit is full of components for like 10 projects now and i am yet to finish the first one

>> No.1883267

>>1880154
all MCU's i was using were pretty much good sensors that needed calibration in order to run decently. also there are a lot of things to consider in order to get viable data like sensors fusion etc.

>> No.1883386

Are raspi compute modules a meme?
Tons of people recommended I use one for an embedded project, but they seem to be constantly out of stock
Are the different pi boards not essentially interchangeable?

>> No.1883418
File: 1.81 MB, 1920x1080, 1579444012700.png [View same] [iqdb] [saucenao] [google]
1883418

>>1880094
Microcontrollers are programmed. You tell the µC what to /do/. You prepare instructions for a processor to execute.
FPGAs are configured. You tell the FPGA what to /be/. You literally do design the hardware your FPGA is.

>> No.1883517

>>1883386
>Are raspi compute modules a meme?
Sort of. If you have a bunch of hardware where you don't want to design the CPU part, they're okay. But for most people they are a meme.
What's really a meme is compute modules with a connector more complicated than a DIMM edge. Didn't those Intel Edison things require a really tiny-pitch connector? As if Intel's price, lack of support, and NDA obsession wasn't enough, nobody without an SMT assembly lab could build anything to plug them into.

>> No.1883526

>>1883517
You're pretty much spot on
I have a bunch of hardware and I want a low profile, low power Linux host to monitor shit and connect over the network

>> No.1883787

>>1883386
compute modules are for if you want access to all of the broadcom's IO to use for yourself.
for example the PI4 has sdio, uart, and pcie lines allocated to wifi, bt, and usb 3.0 respectively.
it's also really small so if you dont need all those extra peripherals you can make your design smaller and more targeted to the end application.

>> No.1883790
File: 127 KB, 568x538, 1596416726949.jpg [View same] [iqdb] [saucenao] [google]
1883790

>>1883517
>What's really a meme is compute modules with a connector more complicated than a DIMM edge
>nobody without an SMT assembly lab could build anything to plug them into.
you know that;s what they do right? people aren't assembling these boards at home.

>> No.1883872

>>1880094
Way too complicated for hobbyists.

>> No.1884187

>>1883787
does it have a standard lane pinout or do you have to manually configure everything yourself?

>> No.1884266

>>1883872
Not really...

>> No.1884471

>>1884187
I assume you're talking about PCIe.
what do you mean manually configure everything?
The hardware is there already and PCIe kernel api's exist already in linux. all you have to do is find and compile or write the driver for the device you are connecting to the lanes.

>> No.1884673

is it possible to add a method for counting clock cycles to the arduino ide for the stm32f1 using rogerclarks stuff.

>> No.1884683

>>1880094

They are amazing if you need what is essentially a programmable ASIC. But if you don't need that, there's really no reason to use one. Also they're expensive AF compared to standard solutions like a uC.

>> No.1884896

>>1884471
Bro, sodimm has 200 pins, are they all GPIO_0...199?

>> No.1884967

I am a machine learning engineer that wants to get into microcontrollers for physical applications to machine learning, but I'm too creatively braindead to come up with something actually useful and cool. Has anyone else built something cool and deployed a model on it? All I can think of are object detection things but thats kind of boring. What have other anons built? Thinking of some kind of robot that picks stuff up or something.

>> No.1884998

>>1884967
I've only seen machine vision with tiny yolo or imagenet stripped to a few classes, turns out the mcu hardware is not powerful enough to do neural processing. There are a few chink mcus that have some type of neural processing hw but it's a pain in the ass to work with incomplete datasheets or having to sign an NDA

>> No.1885008

>>1884998
Yeah it seems like theres some serious limitations to the scope of the models you can host on these things. I thought about just sshing into a desktop and sending the output back to the microcontroller, but that kind of defeats the purpose of having code on a microcontroller imo. You'd always need an internet connection which is not ideal.

>> No.1885086

>>1885008
Isn't running already trained network just matrix multiplication?

>> No.1885098

>>1885086
careful, there's no such thing as a "machine learning engineer" so you are trying to teach a retard.

>> No.1885120

>>1885008
>just sshing into a desktop
that implies a full OS running on the MCU, and at that point might imply a SBC rather than an MCU

>> No.1885223

>>1885086
Yeah but I'm not sure if an arduino could handle some of the larger models that are used for image recognition and language processing stuff. You usually need a pretty large amount of memory to hold weight data for text processing models. This also isn't including the actual libraries you'd need to run the code like pytorch and tensorflow. I'm not sure how this works with arduinos though so Idk if the libraries would be a bottleneck or not. Apparently they have lightweight libraries for the purpose of deploying to arduinos like Tensorflow Light.

>>1885098
Right, there isn't. I just build machine learning models on a daily basis for my job and don't know what else to call myself since its another commonly used buzzword in the universe of "artificial intelligence". I'm also a retard but thats beside the point.

>> No.1885250

>>1884896
read the datasheet
https://www.raspberrypi.org/documentation/hardware/computemodule/datasheets/rpi_DATA_CM3plus_1p0.pdf

>> No.1885254

>>1885223
if your goal is "put machine learning on a micro" it's under specified There's lot's a micros.
If your goal is "make machine learning work on an 8-bit architecture" that's better defined.

when you're dealing with micros, have a clear goal. Just receiving an image from a CCD is extremely intensive.

Like what, exactly, do you want to do?

It makes far more sense to select hardware to suit your problem rather than select hardware and try to cram software onto it for funsies.

If you want capable hardware that makes controlling hardware easy, rpi is just fine. It can run Open CV and you have direct access to GPIOs with libraries like gpiozero, RPi.GPIO and others in python.

Like if your goal is AI robot, just start with an RPi. Using other SBCs is possible, but they aren't as ubiquitious. You should select hardware that's easy (for you) to use at first.

If your goal is to understand hardware, then start with an arduino and drop the ML/AI until you understand what a UART is, what PWM is, and how to do basic motor controls.
Controlling things (sensors, motors, whatever) is about interfacing with MCU peripherals like GPIO, UART, SPI, I2C, etc.
IF you realyl really want to go with a micro, I'd suggest something like esp32. Has wifi connectivity out of the box, can run python if you want (micropython), and is 32 bit and 240MHz.
Trying to do "AI" (as opposed to just, like, stats) in 8bits and 16 MHz is not gonna be fun.

>> No.1885940
File: 56 KB, 734x311, 65 bucks.png [View same] [iqdb] [saucenao] [google]
1885940

>>1879918
I want my microcontroller to push a simple needle (let's say to blow up a baloon).
How can I achieve it?
Simple motor is overkill, this linear actuator would be ok (still too big) but 65$? Fuck that!
Using a coil and a capacitor for some kind of diy railgun?
There has to be a simple component, some "springloaded" cheap tiny thing.
Help me out here, guys?

>> No.1885955

Hey guys, New to single board computers.
Im looking for the cheapest solution to read an a sensor and trigger a servo, that's it. No networking or anything required.
It's for a pest repellent system for my garden.
I know arduino/Rpi exist, I'm looking for specific recommendations, if y'all would be so kind.
Thanks!

>> No.1885963

>>1885955
Thinking this
https://www.amazon.com/ELEGOO-Arduino-ATmega328P-Without-Compatible/dp/B0713XK923
Should work. And I guess I get two extra.

>> No.1886035
File: 65 KB, 948x948, 1579404799756.jpg [View same] [iqdb] [saucenao] [google]
1886035

>>1885940
get something like this Linear Screw Slider

>> No.1886085

I got a tm1638 module but teh IC is a

AIP1638 or maybe its A1P1638 or possible ATP1638
either way no results
Whats going on it says on the module on silkscreen its tm1638 on other side.

>> No.1886088

>>1885955
Pic16f18313
78 cents

What type of sensor?

>> No.1886360

>>1885940
You want solenoid

>> No.1887564

Any thoughts on this ideas? I have a switch that operates a pneumatic door. I would like to remotely activate it from a keyfob or Android phone. I can bodge together a phone app but would prefer a fob. Lots of simple fobs out there with zero security that rules them out. I have a few esp32 and a few arduinos around and a Linux system always running. A second big concern is not wanting to wait for wireless scanning and negotiation like wifi or normal Bluetooth. Android phone would be neat but am I better off using a 433mhz dongle? I'm open any suggestions.

>> No.1887626

>>1887564
Find a garage door opener receiver/remote set. Most of them should output "dry contacts", aka a relay.

>> No.1887636

>>1885955
>Im looking for the cheapest solution to read an a sensor and trigger a servo,
Any attiny will do this much for you. See digikey to figure out how much this µC cost. Virtually free.
But if you haven't messed with microcontrollers before, just treat yourself to an arduino uno or arduino mega 2560. They can also serve as programmers, for standalone projects with other µC chips like the aforementioned attiny.

>> No.1887654

>>1885955
>read an a sensor and trigger a servo
what kind of sensor?
what kind of servo?
How do you plan on driving the servo?
how do you plan on powering the device?
will you be making a pcb with all these parts or "slap together" dev boards and breakouts from amazon or something. All of these things will affect the cost.
Speaking of cost. what is your budget? $1, $10, $100?

Everyone here suggesting random cheap ass micros for under a dollar don't even know what it will be connected to. Not to mention the programmers for these so called < $1 chips cost more than $20 meanwhile basic stm32 dev boards are about $10-$15, programmer included. Arduino atmega328p knockoffs are around that too.

>> No.1887982

>>1887654
>Not to mention the programmers for these so called < $1 chips cost more than $20
These "programmers" include arduino knockoffs which can act as programmers.
I favor the seeeduino, as it has selectable 3v3 support.

>> No.1888845
File: 309 KB, 1600x960, IMG_20200817_173226.jpg [View same] [iqdb] [saucenao] [google]
1888845

>>1879918
I have a 1602A LCD I'm trying to use
but I suspect the second line is damaged
because even if I set the right function mode (00101000), the second line doesn't work, it doesn't even seem to have a backlight like the first one (pic related)
datasheet: https://www.openhacks.com/uploadsproductos/eone-1602a1.pdf

>> No.1889093

What's a good Windows SBC for a Labview-based HMI?

>> No.1889649
File: 77 KB, 1500x1363, 71EhuNDf8WL._SL1500_.jpg [View same] [iqdb] [saucenao] [google]
1889649

>tfw bought Teensy 4.1 for project
>tfw realizing just how powerful it is
>tfw

>> No.1889704
File: 13 KB, 480x340, dvd-player.jpg [View same] [iqdb] [saucenao] [google]
1889704

>>1880211
because they're hobby grade dumbass.

set up some software filtering and suck it up, because your tomato plants aren't going to catch fire and demolish a six block radius because one of the sensors fails. there's no point paying for premium german components when you're starting out. there are free libraries to help you get the most out of your components.

https://playground.arduino.cc/Code/Filters/
https://playground.arduino.cc/Code/PIDLibrary/

>> No.1889923
File: 77 KB, 486x1000, jank.jpg [View same] [iqdb] [saucenao] [google]
1889923

I'm sorry for what you're about to see.
Using
#include <IRremote.h>

#define PIN_IR 6
#define PIN_DETECT 5
//D3/D2
#define PIN_STATUS 13

IRsend irsend;
void setup()
{
pinMode(PIN_DETECT, INPUT);
pinMode(PIN_STATUS, OUTPUT);
irsend.enableIROut(38);
irsend.mark(0);
}

void loop() {
digitalWrite(PIN_STATUS, !digitalRead(PIN_DETECT));
}

to power an IR LED at 38khz and an IR receiver to see that LED.
Receiver works, LED does not. Running the LED with a 100ohm resistor on the anode side, cathode to GND.
>Yes, I'm new.

>> No.1889927

>>1889923
This is on a nano.

>> No.1889935

>>1889923
Switch to diode mode on your multimeter and touch ends of the LED. The LED should light up, check with your phone to confirm.

Otherwise, driving a LED directly is a bad idea, use a transistor to carry the power as your shitty MCU might not handle it.

Are you sure you're using digitalWrite correctly? I think you need some sort of irsend method to make it output in frequency, otherwise it would just turn the led ON the entire time. digitalRead is not going to work either b/c you might pick up random state from PWM when transmitting with 50% chance or nothing when off.

You have to take input legally and generste it legally. If you're doing blatant read/write bit by bit you're better hardwiring LED to a transistor that is hardwired to a receiver with no MCU whatsoever.

>> No.1889943
File: 1.96 MB, 4032x1960, 20200818_151819.jpg [View same] [iqdb] [saucenao] [google]
1889943

>>1889935
Interestingly I've checked every diode in the pack, and the the same result on all of them, pic related.
As for the code, I got it directly from
http://www.righto.com/2010/03/detecting-ir-beam-break-with-arduino-ir.html?m=1
And changed the pins so that the IR LED was on a PWM pin, I guess I'll grab a transistor and see what happens.
Thanks so much!

>> No.1889953

>>1889943
Looking closely seems like nano can push up to 40mA while IR led might eat up to 50mA. Judging on your resistor you expect it to eat it 35mA, which is on edge. Yeah, you need a transistor.

>> No.1889976

Hey! I'm doing a little dashboard project for a Honda Africa Twin RD07 to replace the stock known-to-be-a-timebomb tripmaster and add some extra functionality. Currently I'm trying to get the distance measurement right. I need a way to convert the amount of pulses coming from the spedometer to actual distance. it sends 12 pulses every rotation of the front tire, so for this setup each rotation is 2.2 meters, if we multiply that we get 545.45 ticks per 100 meters. I have an integer with the current tick count. I just have no clue how to convert it to 100s of meters.

>> No.1889982

>>1889953
Sheeeeit.
Didn't even consider the resistor, the LEDs are 30ma.
Thanks y'all.

>> No.1890001

>>1889982
Success!
Just whacked a random NPN in and it lit!
Time to rethink how to power these LEDs now, considering I'm pretty sure they have to be driven at 38khz so the detector can see them. Thanks y'all!

>> No.1890115

>>1890001
I've seen actual IR remotes with very low resistances (under 10 ohms) to the LED. Normally that would over-drive it, but since there's a ~50% duty cycle during xmit, and it's off between codes, it doesn't kill the LED. (also they run from AA or AAA batteries which have an inherent current limit)
I still need to get back to my own LED remote driver project someday, I got a cheap chink logic analyzer months ago, and I've got a pretty good work area set up now too.

>> No.1890215

>>1889976
>12 pulses every rotation of the front tire
>each rotation is 2.2 meters
Each tick is 2.2 / 12 Meters
DistanceInMeters = 2.2 / 12 *tickCount;

>> No.1890297

>>1879918
name a better mcu than the esp32

>> No.1890317

>>1890297
msp430, if it does the job. Cost and power efficiency.

>> No.1890332

>>1890317
I mean ones with built in wifi but the current draw from the esp8266 is the biggest fault with it

>> No.1890335

>>1890332
>I mean ones with built in wifi
Classic goalpost moving.
>the current draw from the esp8266 is the biggest fault with it
Deal-breaker for an important group of use cases.
The bottomline is that if you don't need wifi, you should probably be using something else. There's a wide range of options, all with their pros and cons. esp8266/esp32 are just two more options.

>> No.1890439

Working my way through PIC assembly at the minute starting with baseline chips.
I have a quick question if anyone can help.

So in order to do any operations on data or move data to a register you usually have to move it into the working register first.
So most things have to be done through the working register.

There's a BCF and a BSF instructions to set or clear a bit in a register directly so I'm just wondering, do these instructions not have any effect on the working register?

Like if I have a value in the working register and then I do a few BCF or BSF on GPIO registers, will the working register still contain my original value?

>> No.1890504

trying to make a HID class USB device from scratch with an MCU and it's astonishing how few documentation/source is available
picked a few ATTINY85, i know there is the V-USB library but wanna do it on my own to learn more about the USB protocol, has any of you done this before? if so do you have any interesting documentation/project that i could read?
every single question of this kind is just answered by hords of "just buy an arduino leonardo and use the Keyboard library dude!!!!!" or "use X library it's so simple" brainlet stuff

>> No.1890519

>>1890115
Same shit. I've built one prototype and it's already built in my head, my brain already received reward for work it did not even do. Lazy fuck.

>> No.1890520

>>1890504
There's a whole CCC talk about USB bitbanging:
https://www.youtube.com/watch?v=GFY_A3jcI28

They use a more powerful micro than an attiny though.

>> No.1890637

>>1890504
Slightly unrelated, but I love the attiny85 so much.
Yeah, you could do this type of shit much easier on larger mcus, but it's the challenge that makes it cool.
Now if I could just sit the fuck down and actually complete one of those challenges...

>> No.1890642

>>1890504
Why dont you look at code that has all the answers? Like an existing implementation? There's no difference from looking at a reference implementation and a specification.
You are looking at the USB protocol specifications, right?

>> No.1890767
File: 3.66 MB, 6528x4896, out4.jpg [View same] [iqdb] [saucenao] [google]
1890767

I did a Arduino/Bluetooth project a few weeks ago and while it worked it was awful (as you can probably guess the soldering job didnt hold up to real world stress and vibration), I ordered a pcb (last pic) and it turned out fine. Going to do one more iteration where I fit it properly to the enclosure I'm using and with M8 connectors instead of screw terminals with exposed inner wires

>> No.1890861
File: 174 KB, 394x539, bitmap.png [View same] [iqdb] [saucenao] [google]
1890861

>>1890767
You know you can just use the VBUS and GND pins, yah? Check with multimeter, they are directly connected.

>> No.1890864

>>1890861
yeah its fixed on the pcb version

>> No.1890867

>>1890864
ah, ok, good, nice work

>> No.1890958
File: 3.77 MB, 2500x3333, Bluetooth in the 90s.jpg [View same] [iqdb] [saucenao] [google]
1890958

A while ago I hardwired a bluetooth receiver into the tape deck of my stock car stereo. Had to get a dc/dc converter to isolate a very loud ground loop.
Also got a wireless, watch-battery-powered bluetooth media controller to control the music with a physical button.
It's a bit thrown together, the boards are in a tape cassette case, and a galaxy buds box.
It works close to flawlessly. Fails to connect 1/50 times I start the car, and the receiver boards BT connect sound is loud and annoying.

I want to simplify this and add a "now playing" display, that could also display temps for oil, coolant, etc.
I've looked into programming an esp32 for the music display but it's way over my head.
Would a raspberry pi with pi musicbox be simpler?
Would it be able to turn on and begin playing music within 5 seconds of starting the car like my current setup?
And maybe a button to switch between music display and temps.

>> No.1890963

>>1890520
will watch, thanks
>>1890637
you only learn thru challenges, otherwise it's either for money or a waste of time
>>1890642
>Why dont you look at code that has all the answers? Like an existing implementation? There's no difference from looking at a reference implementation and a specification.
already started doing that, also it's been a while since i've done things with MCUs, wanted to do this to get back into the subject
USB protocol is a pain in the ass to learn and implement
will get into this more seriously tomorrow

>> No.1890976

>>1890958
>I've looked into programming an esp32 for the music display but it's way over my head.
>Would a raspberry pi with pi musicbox be simpler?
not really. You have to interact with the low level stuff. If you know linux well, then they are about even. ESP32 runs micropython so it is just as easy to program.
Raspberry pis are easier to manage in general because they are a full computer, so people can just use it. But you aren't trying to use it as a computer, you are using it to control hardware, which is the hard bit.
rpi will give you more resources to shoot yourself in the foot. Like you will need to run your simple program as a OS service with systemd or something annoying like that, while ALSO solving all the hardware interface stuff.
I highly recommend micropython on ESP32. Since you have the BT solved, you dont need ESP32's BT.
> Would it be able to turn on and begin playing music within 5 seconds of starting the car like my current setup?
in any case, yes, just delay start-up. RPIs take forever to boot regardless.
> And maybe a button to switch between music display and temps.
yah, buttons are hilariously non-trivial compared to what they do. You'll have to look into "debouncing" the button in software. It's not hard, but if you don't know to do it, buttons are impossible.

>> No.1891025
File: 585 KB, 496x960, BT.webm [View same] [iqdb] [saucenao] [google]
1891025

>>1890976
I know a bit of linux but not too deep into command line stuff.
I might just get an RPI and give it a shot.
>Since you have the BT solved, you dont need ESP32's BT.
I was hoping to ditch everything besides the dc/dc converter, and have the RPI handle recieving audio, displaying metadata, displaying temps, and add hardwired media control buttons. Is that too much for a quick booting RPI in a car?
If I kept the current receiver, the RPI would still need to connect to my phone for the song metadata.
>in any case, yes, just delay start-up. RPIs take forever to boot regardless.
Im confused. They take forever to boot, but can play music within 5 seconds? What do you mean by delay startup? Like I wait for it to turn on before going, or can I load music before the rest of the system?
>"debouncing"
Hey that's something I learned in my intro college course!

>> No.1891279

>>1879918
Are Arduinos still good? Or only known for their name?

>> No.1891297

>>1891279
for what, specifically? It's a micro controller. good depends on what you want to use it for.

>> No.1891350

>>1891279
good to begin with MCUs but not if you already have experience

>> No.1891400

How's the Tiva C Launchpad for someone new to embedded programming?

>> No.1891425
File: 27 KB, 1080x1104, cap.jpg [View same] [iqdb] [saucenao] [google]
1891425

How do I figure out what is the cathode and anode of this dielectric ceramic smd capacitor.
The datasheet says nothing.
Does it even matter?
>https://www.digikey.dk/product-detail/da/avx-corporation/06033G104ZAT2A/478-1259-1-ND/564291
if this is the wrong thread, please re-direct me.

>> No.1891441

>>1891425
Those brown ceramics are not electrolytic, so it should be non-polarized.
>>>/ohm/

>> No.1891687

>>1891441
thanks

>> No.1891706

>>1891350
huh? So if I'm an expert and all I need is an 8-bit AVR, I can't use an Arduino??
hardware doesn't have an experience rating, they have specs, and you pick hardware based on specs.

>> No.1891721

>>1891706
not what i meant, but what's stopping you from buying the mcu and not the whole board?

>> No.1891733

>>1891706
>if I'm an expert and all I need is an 8-bit AVR, I can't use an Arduino??
legal issues, cost at scale
though I wouldn't be surprised if pro developers had a couple lying around

>> No.1891929

Arduino was basically the first of the modern era of mass-produced quick-prototype MCU boards. Before that they were usually expensive kitchen-sink evaluation boards with a ton of other chips from the semi manufacturer built in to demo those too, with the intent that you would buy 10,000 chips to put on your own custom board. And then you still probably needed a $200 debug probe to use it.
Now we have ST Nucleo and Discovery boards, TI Launchpad boards, etc. as well as Raspberry Pi and Beaglebone for the embedded-Linux space.

>> No.1891940

>>1891733
> legal issues, cost at scale
oh, please do elaborate on this fantasy.

>> No.1892087
File: 203 KB, 2358x536, 1584638266084.png [View same] [iqdb] [saucenao] [google]
1892087

>>1891706
>So if I'm an expert and all I need is an 8-bit AVR
even if that's the case, there are cheaper, faster, more powerful, and more I/O MCU's out there nowadays. no reason to "just use an 8-bit AVR" except for the arduino software library. Though stuff like stm32cubemx and atmel start make arduino's software advantage mostly moot if you know what you're doing.

>> No.1892094

Sup /mcg/,

I have a decently sophisticated project written in Python running on a Raspberry Pi that communicates with several sensor breakout boards over serial (GPS), I2C (Gyro/Accelerometer) and SPI (RF24 Radio). After breadboarding it all out I manufactured a PCB that accepts the Pi's 20 pin headers into some female receivers on the PCB, which routes all the connections to the sensor breakout components, which I soldered to the board.

I'm getting ready to take it to the next level to develop a production ready device by getting rid of the breakout boards on the PCB I designed and draw up a new PCB with those components soldered directly onto the PCB itself. However I'm still left with the brains of the board being bound to the Raspberry Pi and the speed of the software limited by the Python interpreter.

My main question is what are my options for getting rid of the Pi and having the brains of the board be part of the PCB I'm planning on designing? My Python software depends a lot on the multithreading abstraction provided by the Linux kernel, and I'm not sure whether its worth the massive effort it will take to rewrite in C directly to an MCU capable of running the software.

In the case that I end up sticking with the Pi and having it just be another component to the production ready device (The Pi Zero is 5$, beating out a lot of the development boards I compared it to), is there a way to get rid of the removable flash on it and burn the software to some flash ROM so it can't be ripped or inspected by a user of the device?

>> No.1892095

>>1892087
> compares specs and prices
This is correct. Nothing about "hobby level" or "amateur" or other ill-define concepts. Specifications (including footprint) and prices.

>> No.1892121

>>1892094
One thing you forgot to mention is what you are doing with this data.
Everything you did mention, you can do all this with a basic micro and an RTOS. the multithreading is handled by the RTOS kernel and all you implement is the interrupt handlers for the hardware interfaces with DMA transfers.

For example lets say you want to read from GPS over UART. get a MCU (ATSAMD21 for example) and get an example project with FreeRTOS and UART HAL libraries set up(see https://start.atmel.com/).).
You "could" implement the async scheduling yourself with a big main loop and flags in interrupts to inform main that data is ready from an isr but it sucks to do.

If you decide the RTOS route you just implement 2 functions, one is a callback when the UART DMA transfer is done. here you want to memcpy the data from the DMA buffer to a safe buffer to process later. then flag the main task through a FreeRTOS notify event. Then Reset the DMA RX buffer and return.

The next function is a FreeRTOS task which will be waiting for the notify event in a while loop. when woken by the interrupt notify it will process the received UART data then go back to sleep waiting for the next event.
The great thing about this is tasks that are waiting for events are suspended and the single core cpu is free to process other tasks (multi threading).
Rinse and repeat for the other sensors you have.

>is there a way to get rid of the removable flash on it and burn the software to some flash ROM so it can't be ripped or inspected by a user of the device?
not unless you use a compute module and put a spi flash on your pcb. even then I could de solder the flash chip and dead bug mod wires from the data lines to an SD card adapter and get all your code.
Using an MCU you can disable the programming interface once flashed in software so there's no practical way to get the code off.

>> No.1892179

>>1892121
This was a really awesome response, thank you Anon. Per your question, the raw sensor data is being written to a file and then is pulled off the Pi manually and processed later by other software I've written on the desktop.

>Compute module
Didn't know about this, and is actually really interesting, but I'm so reluctant to spend 25$ on the lowest model when the Pi Zero is so damn cheap. Even looking at some of the more capable MCUs (even the ATSAMD21 you mentioned, priced at roughly 3 bucks) I'm finding hard to justify a purchase when the Pi Zero with it's capability and ease of use is so attractive.

>FreeRTOS
This may sound like a dumb question but is FreeRTOS meant to be flashed directly to the flash memory of the MCU alongside your program? I'm worried about the flash capacity of many of these MCU's and whether or not my Python software can fit if I decide to port it. I'm sure there is another way for an MCU to read larger programs than their internal flash capacity but I've never done any embedded programming outside of AVR (attiny included) and Pi, so I'm not sure what kind of complexity I'm looking at to make this possible

>> No.1892190

>>1892179
you might want to check out micropython, runs on some popular SoCs. It's a stripped down interpretter running on top of FreeRTOS. You get a repl prompt, and can run python files. You can't run ANY python code, but you can run python code.
side note: you really should be doing async in python and not threading unless you literally need threads (complex share state even though there's a GIL). You should check out reymond hettinger's talk on it.

>> No.1892196

>>1892179
FreeRTOS is just a bunch of source files just like any other code project.
I don't know how much C programming you've done or if you've ever used an IDE before but typically you would have a folder in your project containing all the .c and .h files with a main.c. The IDE builds all the source files into a single .elf or .hex file that gets flashed to the MCU.
It's no different than if you wrote your own library and included it in your project.
if you still are unsure download the rtos demo example project and look at the code to see how it's setup. Just rename it from atzip to zip and open
https://start.atmel.com/#examples/rtos
If that's to much you could always try arduino for an extra layer of abstraction to get started.
https://create.arduino.cc/projecthub/feilipu/using-freertos-multi-tasking-in-arduino-ebc3cc

I would at least try to do it in C/C++ if you do take the MCU route vs >>1892190 and using micropython. Interpreting python on a microcontroller is extra unnecessary overhead since you need to string parse everything and then execute the instruction in C/C++ code why not just do it in C/C++ and skip parsing.

>> No.1892203

>>1886035
yeah just pull one out of a cd drive or something

>> No.1892209

>>1892196
Ahh I see, the Arduino article explained it quite nicely, except that it seems to use FreeRTOS as essentially another library rather than an 'operating system' or 'kernel' per se, but I guess those are basically just semantics when you're writing embedded code on an MCU.

Yeah without a doubt if I go with the MCU (which I likely will because there doesn't seem like a feasible way to keep the source secure on the Pi) I'll be re-writing the project in C++, and if I pick an AVR MCU seems like I'll be saving myself a ton of headaches. Raspberry Pi and Python to me fulfill the purpose prototyping and prototyping fast.

>>1892190
>you really should be doing async in python and not threading
Yeah I'm not all too familiar with Python async, but I am very familiar with writing multithreaded code in other languages, and since the idea behind the Pi was quick prototyping I wrote it like I would have wrote it with C++. Nothing too technical, but because the code is also operating and responding to button clicks and events that correlate to the OLED screen (basically wrote an OLED user facing GUI), and each sensor on the device is collecting data simultaneously and independently, I have threads to manage each process.

>> No.1892226

>>1892196
>Interpreting python on a microcontroller is extra unnecessary overhead since you need to string parse everything and then execute the instruction in C/C++ code why not just do it in C/C++ and skip parsing.
No argument here, but just to clarify, you can "freeze" the modules which is basically compiling them to bytecode as the standard interpretter would do on first execution. However, for micropython, you need to include them when flashing.
http://docs.micropython.org/en/latest/reference/packages.html?highlight=frozen%20modules#cross-installing-packages-with-freezing
Everything else you said stands, freezing doesn't make it equivalent to C (it's not machine code, it's python byte code), so it's still running an interpreter on top of FreeRTOS and therefore it will be slower. Just not AS slow as paring as well in this case.

>> No.1892228

>>1892209
>it seems to use FreeRTOS as essentially another library rather than an 'operating system' or 'kernel'
it's a lot simpler than that. FreeRTOS has no process isolation, memory isolation, privilege rings or virtual memory support so it can't really be called an OS. Maybe a barebones kernel, or probably better just an advanced function scheduler.

Created tasks reserve "stack space" on the heap (or statically depending on how you configure it) for each function.
When you call vTaskStartScheduler there's a main loop inside that will setup the scheduler then call the task with a reserved block of stack for it.
Which boils down to, in assembly, changing the stack pointer to the next task to be executed's stack then branch to the task function. when task's are scheduled or suspended, you can't return like a normal C function, instead you call vTaskSuspend which will save off the current registers to the task stack and context switch to the next task SP popping their registers back and branching to it.

>> No.1892290

Why in the hell has the new Raspberry Pi have not one but TWO shitty micro HDMI ports?
I would've been okay with one normal HDMI port.

>> No.1892320

>>1892290
dual head, brah

>> No.1892542
File: 226 KB, 1183x426, 1579420156329.png [View same] [iqdb] [saucenao] [google]
1892542

>>1892290
because they need backward comparability with the existing rpi B form factor while also breaking out as many IO as possible. if you don't want a pi get something else.

>> No.1893212

I want to passthrough a USB device through arduino and switch it on and off using digital logic. Is there any way to do this without extra MOSFETs or relays?

I'm thinking about connecting USB-IN and USB-OUT to 8 analog pins and monitoring the voltage. Once there is a voltage change on either side (IN/OUT), propagate it to the other side's matching pin. I know that USB is bidirectional, but I assume host and device are not going to change the voltage simultaneously, so this might work, right?

>> No.1893546

>>1893212
Just monitor the 5v and gnd lines to check when it's plugged in?

>> No.1893641
File: 33 KB, 550x393, 1592743691026.jpg [View same] [iqdb] [saucenao] [google]
1893641

>>1893212
If you want a way to make usb lines go highZ then this would do it, though you probably should explain what you're trying to do since there is most likely a better way to do it than what you think.
Whatever you were thinking before with detecting voltages and switching whatever won't work/ usb is to fast and you'd loose information.

>> No.1893706

>>1893546
>>1893641
Sorry, I actually want to build a USB switch for N devices, controlled by a digital signal. I just picked turning a single USB on/off as a first step, so no need for high-Z.

I think the correct way to do this is to either use a multiplexer IC or to use an NMOS to control each USB lane, so 4 MOSFETs per each device. I'm not going to have enough analog pins on Arduino for switching multiple USBs anyways, so that was just playing around.

>> No.1894907

Is there a way to program Arduino boards in pure C instead of C as a subset of C++?

>> No.1894934

>>1894907
Yes, just use avr-gcc directly instead of the Arduino IDE.

>> No.1895145

Will 2 pi compute modules fit side by side in a double sodimm slot?

>> No.1895208

>>1885086

Ya if you think its easy go make some parrell circuits

>> No.1895227

>>1894907
Why?

>> No.1895528 [DELETED] 

hey guys, is there a guide on buying one of those ESP32 + mini-display thingies off aliexpress? I'm wondering if it could help me build a project.

>> No.1895532

hey guys, is there a guide on buying one of those ESP32 + mini-display thingies off aliexpress? I'm wondering if it could help me build a project.
are all of them the same thing? from what I can see, people ask vendors about firmware versions. how do they differ?
here it says that old versions of the ESP32 had temp sensors:
https://makeradvisor.com/esp32-vs-esp8266/
what are some other differences?

>> No.1895564

>>1895532
I'm buying a few of these things: https://www.aliexpress.com/item/33048962331.html
do you think they are worth it?
my idea is to build a web server in a separate device and make it connect to the ESP32 (through whatever means there are: USB OTG, wifi, serial,...). the device will display a WPA2 password or a bluetooth PIN with which an user will connect to the device. from there, the user will browse this website and do stuff, and then they will be disconnected after a while. is this possible with the ESP32?

>> No.1895576

>>1894907
Yes, considering the boards run binary firmware and not C code.
avr-gcc is the tool chain, avr-dude is the programmer.
You can write C directly and compile/upload with the Arduino IDE as I assume that's what you mean.
Instead of "assvibrator.ino" just write your own main.cpp file. The main file Arduino uses is just a simple file with main.cpp which includes your sketch as a library and runs the setup onces then loop function.
Look through the arduino libraries. I've documented some of this kind of shit here but haven't updated it in a bit, got busy at work.
http://exiting-arduino.readthedocs.io/

>> No.1895584

>>1895227
>C++ bloat on an MCU

>> No.1895590

>>1895584
Just write C then. You can write C in C++ simply by avoiding any C++ features

>> No.1895635

>>1895564
> is this possible with the ESP32?
Yes.

>> No.1895639

>>1895635
cool, thanks m8!

>> No.1895748

>>1895584
delete iostreams.h

>> No.1895941

>>1895564
Look for "esp32 pico kit", also in aliexpress.
Official expressif devboard, vs random third party crap.

>> No.1895977

>>1880094
To add to what other anons said, they’re very useful when you have to work with parallel computing, such as signal processing

>> No.1896087

>>1891400
I really like them. Their libraries and example tutorials are great. If you're just trying to hack sonething together i'd reccommend an arduino instead but Tiva is solid if you want to learn a bit more about the underlying hardware in MCUs.

>> No.1896128

>>1891400
The worst thing about it i've found is using code composer studio with it. They give a GCC compiler option but have shit default configs for it and the Ti compiler is still on C98 with a bit of C99

>> No.1896223
File: 14 KB, 209x200, Daww+this+is+good+_927b43398ade0f90558aaf5a19cc96ef.png [View same] [iqdb] [saucenao] [google]
1896223

>>1880687

>> No.1896684

I'm looking to create a custom DJ controler over USB with a microcontroler. It should be using quite a few potentiometers, maybe like 25 and a few buttons, around 5-10. My friends tell me I should be using a STM32 Nucleo, or even a raspi since I kinda sucks at hardware and it'd be easier with the USB, but I wanted to get you guys input.
Also, do you have any documentation or tutorial on those kinds of projects ?

>> No.1896709

>>1896684
Can you code?
You can get analog multiplers which will help reduce the GPIO that you need to manage "quite a few potentiometers".
Using RPI isn't easier when you want to do hardware. It is easier if you want to do like, networking or run a server that talks to hardware. Kind of. It's also a powerful MCU so it means you can be bad at coding and have sufficient clock cycles to make up for it.

Draw a diagram of how things connect and what each thing is responsible for and post it.

Like if you twiddle some knobs, where does that information go? Is is midi data into a computer? etc.

>> No.1896726
File: 337 KB, 2172x1674, baseSketch.png [View same] [iqdb] [saucenao] [google]
1896726

>>1896709
Yeah, I can code, I'm actually finishing up a computer engineering master degree lmao. I'm specialised in Machine Learning and most of my projects were software and math oriented. I haven't touched resistances and breadboards in quite some time though...
I drew some basic plans, using 3 74HC4067 muxes. I send the same address at each mux at a given time, but only enable one via a 74HC4052 decoder. I then catch the output on an analog GPIO. I can manage up to 48 inputs with this setup, but on a second though the decoder might be necessary as I can just use 3 GPIO... The diagram is of course simplified.
I watched some videos, and people seemed to like the Arduino Uno for those kind of projects. There's even a MIDI library that I could use. This probably means that I'll need to get some MIDI/USB interface, but I probably should be getting one anyway.
I was just wondering if anyone here had experience with those sort of things, but thanks for the input !

>> No.1896730

>>1896726
>This probably means that I'll need to get some MIDI/USB interface, but I probably should be getting one anyway.
There are Arduino / Arduino IDE compatible boards which can do MIDI out of the box, so you can have the controller in firmware/software.

>> No.1896780

>>1896726
The preferred board for MIDI projects seems to be the Teensy, it's apparently got an easy to use library for being a USB MIDI device, which is what almost every DJ controller is.

>> No.1897032
File: 132 KB, 872x803, LPC1768.jpg [View same] [iqdb] [saucenao] [google]
1897032

Well, I fuckin have pic fuckin related, an LPC1768 mbed piece of shit.

I'd like it to emulate an USB keyboard.
Compiled something like this:

>#include "USBKeyboard.h"
>main() {
>USBKeyboard k;
>k.key_code('c', KEY_CTRL); }

...and nothing happens.

Basically USBKeyboard class instance gets stuck while initializing (even using "false" as first parameter to get the initialization delayed). The USB major/minor don't change. The /dev/input/by-name doesn't get any new entry. The lsusb only shows the original id/model of the mbed.
Literally the fuckin nothing happens.

Guess what? That USBKeyboard class is still "unofficially" part of the standard mbed-os 6.2, yet the last guys who apparently used it successfully were on mbed-os 2.0 nine fuckin years ago.

Also, the level of chaotic fuckin madness is astonishing. Every time you search for mbed LPC1768 examples or source you only get:
- people asking for shit and no real answer (if any) given
- source possibly related to different boards (F401RE and other fuckin shit)
- forum scalpers and wikipedia scalpers with their fuckin copies of fuckin old unmodified pages from browser caches from fuckin decades ago.

Basically this board has *always* been useful for only blinking a few LEDs and nothing more.
Yes, I bought it long, long, long ago, only to find out that its development environment was on the fuckin web. The fuckin fucked up web editor and compiler! The literal fuck!! Wasted money that could have better gone to a couple high-end Arduino's.

Many years later I eventually managed to build LPC1768 binaries on Linux command-line (the fuckin fuckedupry you have to have is so hard you have to literally download an entire custom gcc 9.x package). Wow. Yet the only interesting libraries are either obsolete or non-functional because the fuckedup fuckin mbed-os got insane amounts of breaking changes on every minor version. The fuck, the literally fuckin fucked up fuck.

>> No.1897042

started last week. i fixed a radio and mouse working on a laptop and keyboard

>> No.1897095
File: 46 KB, 610x383, lpc1768_pinout.png [View same] [iqdb] [saucenao] [google]
1897095

>>1897032
>...and nothing happens.
Are you even connected to the right USB? The 1768's USB is on p31 and p32, not the programming port. If you don't do that, nothing is exactly what will happen.
Also the 1768 is like six years old at least. These days when I do mbed it's with a Blue Pill board. I'm more familiar with STM32 anyhow, been using them for 10 years.
>instance gets stuck
Sounds like you might have an object declared as a global, that's a general C++ problem, there is no defined order of constructors between different .o files, and quite a few things in mbed depend on their class being initialized first. One way around is to declare them as pointers to an object and declare and initialize the "real" objects in main(), but that's jank as fuck.
Also welcome to the whole point of mbed and arduino, to keep you from having to build your own compiler and environment. But I will admit that they make it WAY too hard to build mbed from a local compiler. I've tried a couple of times when IRL wasn't in the way, but the only success I had was building my own mbed-like environment from scratch, and my GPIO was probably faster too because I didn't use any digitalwrite compatibility layer bullshit.
Being able to build local would also make it possible to use an actual fucking debugger too. IAR may not be cheap (at least the older versions have broken DRM), but I could get in there and single step and set breakpoints and shit.
>the standard mbed-os 6.2
I've had more problems with the "new age" mbed than just sticking with the old version. Can you try to start a project using the classic mbed? I mean I appreciate how they tried to put some kind of better timing model in there, but everything else is so much more of a pain that I never got around to using it.

If you really just want to make fun USB devices, the Teensy guys seem to have that more under control than anyone else.

>> No.1897147

>>1880211
>buy chinkshit
>"why is it shit?"

>> No.1897234

Busybox's CSLIP crashes my shit but it's SLIP does not. I wonder why.

>> No.1897444

>>1894907
http://brittonkerin.com/cduino/

>> No.1898077

>>1897095
>teensy
>mbed
The hell's wrong with you. Stop buying development boards that are tied to the damn cloud.
It's not like you don't have choices.

>> No.1898183
File: 88 KB, 445x508, HERO.jpg [View same] [iqdb] [saucenao] [google]
1898183

>>1897095
>p31 and p32,

WTF gonna try asap, if it works I owe you a huge beer.
BTW I bought that mbed 1768 no later than 2009. I'm still amazed Pololu and others are still selling it in 2020 (at the usual stupidly insane price above $50). I also hate its blue LEDs.

>>1898077
Back in the day it was an impulse buy "woo hoo so many features, 3.3V I/O, up to 9V input (six AA NiMH cells is safe)!" (see here >>1897095 ) and because I read somewhere there was a tutorial for compiling shit at home. (instructions at https://os.mbed.com/docs/m>bed-os/v6.2/build-tools/install-and-set-up.html don't mention anything about pip3 and other shit)

>> No.1898192

>>1898183
>iostr
I got started when the NXP guy was trying to get us (where i worked) to use some of their chips, he left behind a 1768 and a couple of LPCXpresso boards. The LPCXpresso boards were crap because the codered guys kept the debugger part proprietary, though I did manage to hot-wire one with a 20-pin JTAG header just for lulz. In the end we never bought NXP chips, so they had to buy Freescale, whose chips we were already using. (that's a joke)
But getting to play around with mbed taught me how to use C++ as C-with-classes, where a class is a device's API, which works very well in an embedded environment. Again, delete iostreams.h, that's where much of the C++ bloat comes from.
So anyhow my 1768 is still in a breadboard that I rigged up with a salvaged USB B connector and an Ethernet jack with built-in magnetics that I salvaged from an old DSL modem. I think I just sawed out chunks of their circuit boards to make it easier to breadboard them.

>> No.1898710

With Flight Sim 2020 jacking up the prices of peripherals I wondered how hard it was to make one yourself. I work at a machine shop so I could get a rough sheet of aluminum cut out to accommodate whatever switch types I fancy

>> No.1898729

>>1898710
make one WHAT

>> No.1898732

>>1898729
Just a sheet of switches and knobs that you can map buttons to like a gamepad. I don't know what kind of drivers or actual hardware it would require

>> No.1898746

>>1898732
They usually map to keyboard / mouse bindings.

>> No.1898757

>>1898746
>they
That's the part I'm wondering about, what would I need to plug a toggle switch in to for example to make the computer read it as a mappable thing

>> No.1898758

>>1898757
look into QMK/custom keyboards

>> No.1898759

>>1898757
Any arduino which supports USB HID will do it. I suggest arduino to start with, not to end with. There's a LOT of tutorials on line for this line for this kind of thing, and you'll level up quickly.

>> No.1898761

>>1898759
Thank you

>> No.1898763

https://youtu.be/Z7Sc4MJ8RPM

>> No.1898776

>>1898183
My advice if you want to mess around with microcontrollers would be any of these:
- esp32 pico kit (amazing cheap and powerful microcontroller with wifi/bt)
- mega2560 (the "arduino" (avr8) board to get, fattest chip, shitload i/o, dirt cheap in china)
- msp430 launchpad (very low power optimized µC family, clean 16bit ISA, very friendly to asm programming, gcc support)
Aliexpress is your friend for the first 2.
Avoid anything that ties you to some shitty (or even worse cloud based) proprietary SDK.
mbed and teensy were unfortunate purchases.

>> No.1898779

Also if any of you nerds want some marketable ideas right now flight sim peripherals are in hot demand

>> No.1898799

>>1898776
>Avoid anything that ties you to some shitty (or even worse cloud based) proprietary SDK.
>mbed and teensy were unfortunate purchases.
Where does Teensy require that? It maybe *supported* by mbed, but it is (apparently) primarily used with the Arduino IDE. I can't even find a reference to mbed on pjrc.com except as forum threads.
But in fact anything that works with mbed can be supported by a naked compiler.

>> No.1899346
File: 6 KB, 413x114, IP.jpg [View same] [iqdb] [saucenao] [google]
1899346

If you were trying to make something like this that head 20 total inputs (13 rocker switches, 6 potentiometers, 1 toggle) would I need a controller that has a full 20 inputs or would those be able to be combined in some way?

>> No.1899419

>>1899346
https://en.wikipedia.org/wiki/Keyboard_matrix_circuit
The pots could be selected with an analog switch chip, but the big thing is to take those 13 switches and wire then up in a 4x4 matrix. If they are independent and you want to press more than one at a time, you will have to put a diode on each one.
The other way would be to use a couple of shift register chips, then you just have load and shift outputs and one data input, and it's easy to add another chip or two. This is how NES and SNES controllers work.

>> No.1899428

>>1884967
Speech recognition

>> No.1899441
File: 64 KB, 1200x630, thruster.jpg [View same] [iqdb] [saucenao] [google]
1899441

>shift register ships
Interesting, thank you for that

I imagine to replicate a thruster qudrant you could use horizontal potentiometers?

>> No.1899507

Anyone tried BeagleBone Blue? I hate soldering sensors and it looks like it has a built-in LiPo charger so seems bretty good.

>> No.1899511

>>1899346
This is what multiplexers are for. You sacrifice a few outputs to control which 'channel' you input from, then sample each input in very quick sequence.

So if I had 16 inputs, I could use 4 outputs (since 2^4 is 16) to select the channel (e.g. 0011 for channel 3), then have only 1 input wired. I sample channel 0, channel 1, channel 2 etc by changing my outputs to the desired channel then sampling on my input. There's an associated lag but for most multiplexers it's tiny tiny tiny (like microseconds).

>> No.1899718

>>1880359
this is what happens when you use shit tier arduino garbage instead of actually understanding how an AVR works

>> No.1899733

>>1899718
It's safer dealing with commodities.

>> No.1899777

I have a little device powered by a single 18650, I also have a 10p pack I made to try spotwelding
Is there any way I can make a "booster pack" circuit that, once connected, discharges whatever battery is at a higher voltage, then bridges them in a single pack?

>> No.1899950

>>1899511
Gotcha, thank you for the tip

>> No.1899964

>>1899346
More questions for this, what type of rotary switch am I looking for to replicate that? I'm seeing ones that have pins for every single position and I'm still new enough to not know if it's a software or hardware thing

>> No.1899973

>>1899964
nvm found it, but now I don't know what to do for that vertical knob(?)

>> No.1900039

fuuuck I don't wanna have to drop $10 on a jtag programmer
I just want my $12 fpga damnit

>> No.1900053

>>1900039
Just grab an icestick or tinyfpga bx.
Or save up for a BlackIce Mx.

>> No.1900057

>>1900053
>spend 2x more
what

>> No.1900066

>>1900057
The assumption is you don't know any HDL and want to learn.
The investment in time even to get good enough to do basic shit won't be light.
The cost of your blackice devkit will basically be negligible next to that.

>> No.1900088

>>1879918
someone point me to the fastest fucken arduino graphics library for ili9341. i'm running a 328p at 12MHz and trying to receive serial info to parse and draw to a screen, but the fastest libraries i've tried so far (PDQ_GFX and Ucglib) slow the chip down to the point that some of the serial messages "bleed" into each other. i almost want to just get a monochrome oled cause i know itll be faster but the cheap ones are like 1 inch and the bigger ones are like 2-3 times the cost of an identically sized ili9341. so i think i just need a quicker library than the ones i named, if it exists.

side question, do you think slowing down the serial rate might alleviate this problem? i'm working with 115200 currently

>> No.1900094

>>1900088
>i'm running a 328p at 12MHz
Why not 16 or 20?
>do you think slowing down the serial rate might alleviate this problem?
This chip has hardware serial, so it shouldn't alleviate it. It should make it worse.

>> No.1900099

>>1899718
with arduino ide you can grab literally dozens and dozens of various chips and upload your code to them out of the box
Without arduino you have to waste hours by studying datasheets and write different code for every single chip you want to use. with arduino you take a chip you enver used before and upload your shit to it with barely any modifications
but stay mad shitter

>> No.1900101

>>1900094
>Why not 16 or 20?
virtually every other component i'm working with is only 3v3 tolerant and i don't have a level shifter and don't really intend to buy one, especially since theres quite a few pins that would need to be taken down, like for the TFT screen. i know you can very safely run 3v3 at 16MHz but its technically out of spec and it's for a product, and though i routinely ask myself if i should just say fuck it and sell my thing slightly out of spec, i usually answer "no" lol
>This chip has hardware serial, so it shouldn't alleviate it. It should make it worse.
i don't understand why but i'll take your word for it lol

>> No.1900111

>>1900101
>3v3
Is there any reason you're stuck with avr8?
You could use esp32, stm32 or any of the alternatives, easily at 100MHz+.

>> No.1900128

>>1900111
i've thought about getting a bluepill but i'm too retarded to leave my comfy arduino ecosystem and even with something like the stm32duino bootloader i'm afraid the shit won't do what I'm trying to get it to do. one thing's for sure, the graphics library i'm comfortable with isn't going to work with the bluepill out of the box. i might get it anyway and fuck around, its got a ton of inputs which would be great to cut down the amount of shit i have to deal with. im actually having to use 3 atmegas for everything i'm trying to do, and one of them has multiplexers on every pin, so ¯\_(ツ)_/¯

and i'm just really attracted to dip packages, mainly because i don't know shit about PCB fab companies like if any of them would have that specific stm32 on deck that would be soldered on via a robot. if thats not the case i would have to hand solder these qfp chips for every unit and thats a lot of drag soldering. DIP just seems much easier to deal with when I'm just one guy producing a bunch of units of something

>> No.1900132

>>1900128
>and one of them has multiplexers on every pin, so ¯\_(ツ)_/¯
You know there's friendly chips with more i/o pins, right? Even atmega ones. Even dip and soic for airsolderingstationlets.
https://www.digikey.com/products/en/integrated-circuits-ics/embedded-microcontrollers/685?k=&pkeyword=&sv=0&pv155=188402&pv155=261544&pv155=86506&pv291=120264&pv291=168098&pv291=227724&pv156=168098&pv156=227724&pv156=108015&sf=0&FV=-5%7C22385%2C1989%7C0%2C-8%7C685%2C16%7C214670%2C1112%7C134947%2C1112%7C61334&quantity=&ColumnSort=0&page=1&stock=1&nstock=1&pageSize=25
Should reduce your shift register needs.

>> No.1900149

>>1900128
You don't need to solder when you can slap a two dollar bluepill onto socket pins or a breadboard. Well you need to solder the pins onto it when you get it, but no SMT shit. And the chip it uses is as common as you can get with STM32, it's even got chink clones.
Of course STM32F1xx has been my comfy ecosystem for 10 years so there.

>> No.1900151

>>1900128
You can have pcb fabs produce you a stencil. Then you just to smear it with solder paste, place your components, and put it in an oven.

>> No.1900161

>>1900132
huh. neat.

>>1900149
>You don't need to solder when you can slap a two dollar bluepill onto socket pins or a breadboard
for a personal project maybe, but for a product? idk it feels kind of janky but maybe it's not

>>1900151
will jlcpcb? ive heard theyre good

>> No.1900163

>>1900161
>will jlcpcb? ive heard theyre good
Yes.

>> No.1900164

>>1900101
>>This chip has hardware serial, so it shouldn't alleviate it. It should make it worse.
>i don't understand why but i'll take your word for it lol
Software serial is bitbang crap. You'd need a timer interrupt calling a handler polling the serial. The higher the bitrate, the more the CPU time stolen. Libraries just hide this from you.
Hardware serial doesn't use much CPU time... buffers incoming data on its own. If you don't use interrupts to receive the data, but rather poll once in a while (as I imagine you do), the shorter the time taken for the full message to be received the better. Higher serial rate means less time to transfer a given message.

>> No.1900166

>>1900164
>Higher serial rate means less time to transfer a given message
that makes sense, and i am indeed polling

>> No.1900170

>>1900166
Yeah, I imagined you'd do this totally synchronous. Like send a "send me more" to the other end, then loop until you receive the whole thing.

>> No.1900172 [DELETED] 
File: 77 KB, 1024x768, 44C11014-168B-4BFD-A0D8-840761EAB83B.jpg [View same] [iqdb] [saucenao] [google]
1900172

>LE EBIN HECKIN LEGO ARDUINO-INO
>WEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE!

>> No.1900296
File: 91 KB, 1000x750, EUDDBWWWAAIFPBq.jpg [View same] [iqdb] [saucenao] [google]
1900296

where can i get a bluepill with the headers already soldered hnnnnnggggg

>> No.1900310

>>1900296
learn to solder.

>> No.1900335

Holy fucking shit. I'm stuck on this all day and I feel retarded. I'm making a MIDI device on arduino mega. 10 analog inputs are sliders, 5 analog inputs are potentiometers. There's other stuff connected too but I CAN NOT get the 5th potentiometer to work. I just rewired it again and gave it it's own vcc and gnd dedicated ports and for some reason the analog input just reads it completely flat. I tried other pare potentiometers and nothing works.

>> No.1900337

>>1900296
why would you want that? Kills the aesthetic form factor

>> No.1900362

>>1900335
You must learn ohms law and look into arduino datasheet... its not easy but I assure you it, will be worth it. Goos luck.

Rahul

>> No.1900386

>>1900362
thanks rahul i fixed it i just replaced it with the last potentiometer that i have and now it seems to work

>> No.1900422

>>1900296
wtf. Buy an iron.
Suggested: ts80 or pinecil (ts100 with risc-v microcontroller, by pine64 people).

>> No.1900514
File: 44 KB, 600x312, 1548370301223.jpg [View same] [iqdb] [saucenao] [google]
1900514

>realized I can now salvage components from all my scrap tech

>> No.1900539

>>1900422
>ts100 with risc-v
what benefit does this have over literally any other MCU such as MSP, ARM, AVR, etc.
feels like they just used risc-v as a marketing thing to differentiate from the other 10's of ts100 clones.

>> No.1900540

>>1900539
Absolutely none, but they have people that were involved in the original ts100, and the new design isn't a clone, but an actual improvement, starting with usb power, while retaining full compatibility. It's been years since ts-100 after all.
It being risc-v is just nice extra value for nerds.

>> No.1900567

>>1899964
Today I learned the difference between a rotary switch and a rotary encoder

I hope I don't lose interest in this like everything else, constant fomo has left me a blank slate

>> No.1900704

>>1900337
...how else are you supposed to use it

>> No.1900721

>>1900422
>pinecil
shit aint even available to buy yet

>> No.1900722

>>1900721
But the hype is real.

>> No.1900723

>>1900722
lol
its supposed to be 25 bucks, i'd cop one

>> No.1900726

>>1900723
sore aru

>> No.1901059

>>1900726

>> No.1901095

RISC-V is a big deal because its open source.
Meaning anyone can take the blueprints of the architecture and create a custom chip of their liking.
ARM does the same thing. "ARM" is an architecture, and big companies pay for the rights to make their own ARM based controller/processor/SoC ect...
So if someone wanted to make a custom chip, they can pay big $$$ for the rights to use some proprietary architecture, or the free-to-use RISC-V.

>> No.1901191

>>1901059
https://www.youtube.com/watch?v=U5e-5--TaTc

>> No.1901193

>>1901095
The main point is that it is actually a quite good ISA. If it was shit next to ARM, it'd make sense to license ARM. But as it is good, it makes no sense to pay ARM tax.
Thus pretty much the whole industry is backing risc-v.

>> No.1901601

Anyone ever tried driving DDR3 RAM with a microcontroller/SBC? It has a hell of a lot of pins but it should be possible to group a lot of them and drive them with a single IC, e.g. write a memory address to an I2C register and a chip translates that into calls to the 12 address pins.

>> No.1901611

>>1901601
Why?
A regular PC has special circuitry to talk to it, if you try to bit bang it you lose the only advantage of DDR3, which is speed.

>> No.1901614

>>1901611
Idk. Just thought it'd be cool.

>> No.1901975
File: 812 KB, 600x600, file.png [View same] [iqdb] [saucenao] [google]
1901975

Is there any way relatively simple and cost-efficient I could turn this grid of LED's into LEDs with a button input in front of them? Any idas welcome. I'm thinking maybe a translucent capacitive button with a PCB with holes in it

>> No.1902699

>>1901975
Anything conductive could be used as a capacitive button, maybe use a thin wire if you want it to be discrete

>> No.1902803

Does anyone still make physical ANSI-type terminals? I don't mean using a terminal emulator, I mean a full-on dumb terminal that supports RS-232 like the VT220.

>> No.1902857

>>1885940
if you want to just push a needle and not actually shoot it, you can just make a 4links linkage actuated via a servo, there are very simple constructions that enable you to make linear motions

>> No.1902943

>>1902803
Im building one rn

>> No.1903027

Can a keypad matrix work with on/off switches rather than buttons?

>> No.1903040
File: 902 KB, 2448x3264, 123412341341234234.jpg [View same] [iqdb] [saucenao] [google]
1903040

>>1902803
Man how fucking cool would it be to have a mini amber crt terminal that's hooked into one of the non-gui VT's on an otherwise normal desktop linux install?
Fuck I bet people would buy the shit out of this.
>>1902943
What sort of design are you looking at? Is it like I mentioned? Did you get an actual CRT for it or is it just a normal screen?

>> No.1903041

>>1903040
i wanna cum on that keyboard

>> No.1903042

>>1903027
Yes

>> No.1903044

>>1903042
Thank you, I know it's a silly question but for some reason I panicked after ordering rockers

>> No.1903045

I can get cheap Nema motors, but with board they are more expensive, twice the price sometimes. Do I need those, or can I go with Arduinos? Also there are always cheap stepper boards for sale on Ali, which create a signal. What's the best way to do it?

>> No.1903046

>>1879918
now lets say "hypothetically" you wanted to make a arduino remote controlled turret what would be the best controller for the turret

>> No.1903070

>>1903046
"best" is the one that fits your budget and requirements.
when people ask for the "best" thing, it's an immediate indicator they have no idea what they are doing.
Do you want a turret for ants or for castle walls?

>> No.1903075

>>1903046
esp32 maybe :>

>> No.1903128

>>1903027
Yes but you need to put a diode in-line with every switch.

>> No.1903317

>>1903040
>Man how fucking cool would it be to have a mini amber crt terminal that's hooked into one of the non-gui VT's on an otherwise normal desktop linux install?
>Fuck I bet people would buy the shit out of this.
I know I know. The crazy thing is, I've got the tech specs for the VT220 and it's basically all centered around an 8051 microcontroller. Like, okay, there's other shit for driving the display and presumably for making the serial interface work, plus whatever software they have in ROM... but it should be eminently doable using off-the-shelf controllers, at least as far as typical I/O and driving a display of some kind.

What's psychotic is how much these fucking things are selling for on eBay. DEC video terminals are easily $300 and up. I saw a Wyse terminal for about $200. It's insane.

>> No.1903656
File: 57 KB, 640x640, 2341341234134.jpg [View same] [iqdb] [saucenao] [google]
1903656

>>1903317
Damn I see what you mean, pickings are kind of slim and pricey, and it doesn't look like there's anyone still manufacturing them.
You could always try getting one of those mini color tv/vcr combo units like pic related. It seems like you can still get them under $100 on ebay. Picture probably wouldn't be the best, but it still might be cool. I might have to look into this myself.
As a sidenote, if you somehow replaced the VCR slot on these with a raspberry pi with retro pi installed, hooked up a few USB ports for controllers, and got the display working, you could probably sell them on etsy/ebay to capitalize on the new fad of mini retro consoles.

>> No.1903659

>>1903317
That's because now they're basically antiques. There's no point because first telnet/ssh makes them mostly obsolete, but also because you can plug a USB serial adapter into a RasPi and run a terminal emulator on it, and not have to tote around 10 kilos of leaded glass with it.
t.been refurbing an ADM-3A (kino as fuck) and have a few VT-100s in storage

>> No.1903660

>>1903656
Color TVs have a filter because of how the chroma works, and you basically can't get more than 32-40 characters per line unless you go S-video. Commodore was even doing that before the 4-pin plug became a thing.

>> No.1903704

>>1903660
Yeah, this. Try plugging an Apple II in 80-column mode into virtually any TV via composite.

>> No.1903707
File: 52 KB, 620x455, 4x4matrix.png [View same] [iqdb] [saucenao] [google]
1903707

>>1903128
Thank you, can you expand a bit on why? Still new to electronics in general

>> No.1903724

>>1903707
>turn on 1 2 and 5
>see 4 as on

>> No.1903775
File: 87 KB, 633x937, scroll.jpg [View same] [iqdb] [saucenao] [google]
1903775

>>1903724

>> No.1903812

>>1903707
You don't need diodes, you need to be efficient with your scanning code. Learn to do it from scratch and not through a library. I've made 64-switch matricies (16 data lines) with only switches and nothing else.
The different I/O pins on a microcontroller can be switched between an input or output to allow you to scan specific parts of the matrix. You'll have to use patterns to cover everything.

>> No.1903823

>>1903812
He was talking about matrixing SWITCHES, not buttons, and there is basically no way to do that in a 4x4 matrix without diodes to prevent phantom paths. You have to go full nkro.
I have no idea what he meant with the picture in >>1903775, other than not reading that should have been on the next page if it wasn't a shitty "lrn2code" tier tutorial. Like I said, trace the connections with three buttons pressed in an "L" pattern and you'll understand.
Sure, you can do crazy charlieplexing shit if you can switch your GPIOs between input and output, even crazier with diodes, but not with that pic. And if you don't understand phantom paths first, it'll just blow your mind.

>> No.1903824

Nah, you know what, I thought about it for a second, and I don't think there is a way to matrix toggle switches to avoid phantom paths without diodes. Go ahead and show me your schematic, I'm certain I can find a way to generate a phantom path.

>> No.1904190

Bumping so thread doesn't die on the raid.

>> No.1905026

>>1903040
Im slowly building a 6502 computer and I got a 5inch monochrome crt for the little display. Ben eater videos as well as the "tv typewriter cookbook" are good resources to understand how to make a picture on the screen and what a character generator is for example. Mine is gonna be hardwired to the 6502 basically, and I wanna dress it up like a commodore PET in a little case with a crt monitor and mechanical keyboard, write my own os for it as well probably a forth interpreter it sounds like. I always thought it would be cool to build a whole computer from scratch like Woz did.

>> No.1905039
File: 2.60 MB, 2160x3840, file.jpg [View same] [iqdb] [saucenao] [google]
1905039

>>1903040
>>1905026
As for using it as a standard terminal, I figure I might port my dumb terminal program over from my other project where I made a c64 into a dumb terminal. That's currently getting redone as I gotta become an actually /good/ programmer and use a proper pty instead of this bullshit I was doing with tmux buffers. Here's a pic of that running nethack. Afterthought: my crt is monochrome black so I gotta figure out where to get a small green or amber filter to put over it once it works, vectrex style.

>> No.1905103

>>1880359
Heh do you even PIC asm, bro?

>> No.1905262

>increasing the number of buttons on a gamepad should be easy
>suddenly 34 page HID pdfs
Cause I'm in too deep

>> No.1905288

>>1905262
>tons on a game
pretty sure the HID payload for a gamepad is just a byte array bitmask. just find out how big the payload is and add more bits for each button.
Should be easy if you have the source available

>> No.1905290

>>1905262
>>1905288
>>tons on a game
meant
>buttons on a gamepad

>> No.1905292

>>1905290
>Should be easy if you have the source available
https://www.freebsddiary.org/APC/usb_hid_usages.php
https://os.mbed.com/media/uploads/wim/hid_usb_intro_an249.pdf
I'm looking at this usage table for the AN249 (arduino leonardo) and trying to reverse engineer the examples I've been able to come up with, but just when I feel like it's within my grasp there's a new line of code or new reason to have code that completely shuts that down
> just find out how big the payload is and add more bits for each button
I have much more reading to do because this doesn't translate in my head

>> No.1905299

https://github.com/GAMELASTER/ArduinoGamepad
This is the specific .cpp and .h I'm trying to figure out

>> No.1905324
File: 74 KB, 1597x564, 1584936645711.png [View same] [iqdb] [saucenao] [google]
1905324

>>1905299
so without looking at any documents and just the comments here's what I think it does. Just play around with these definitions and see what happens.

>> No.1905326

>>1905324
also just in case you don't know hex, the second value of each line in the struct definition is the value you should be changing, the first is a HID specific identifier for the data type.

>> No.1905327

>>1905324
It can get confusing to figure out which descriptors do what, but they literally describe the format of the data message.
One good way to get used to the descriptors is get something that dumps them and try it on a bunch of different USB devices.
>>1905326
I had played around with making C macros to make the descriptors more readable, but that was a while ago and I never got around to getting a device working.

>> No.1905341

So far all I can think to do is, assuming we're aiming for 36 buttons leaving the joystick function untouched, is to change the 0x10 in USAGE_MAXIMUM, REPORT_COUNT to 24

Which results in it showing up as a gamepad, but doesn't let me see it's properties and only has the troubleshoot option. I thought because I'm using 24 rather than 10 as my value, I should try REPORT_SIZE 02 but it's the same. I'll keep poking away at it but I also don't know if the rest of the code or the .h is dependent on anything or if I'm too retarded to realize that sounds silly

>> No.1905344

>>1905341
I didn't try switching the uint16_t though, maybe that's where I'm slipping up

>> No.1905373

>>1905344
>>1905341
I DID IT!

>>1905324
Thank you for leading the way

>> No.1905383

>>1905373
I got 32 buttons working, and seems like 64 is the next logical step up but now it's not working. Time to keep poking but now I'm where I wanted to be by today so thank you

>> No.1905711
File: 1.11 MB, 795x787, Annotation 2020-09-09 143514.png [View same] [iqdb] [saucenao] [google]
1905711

https://www.amazon.com/EL-KIT-001-Project-Complete-Starter-Tutorial/dp/B01CZTLHGE/ref=sxin_7_ac_d_pm?ac_md=5-3-QWJvdmUgJDUw-ac_d_pm&cv_ct_cx=arduino+uno&dchild=1&keywords=arduino+uno&pd_rd_i=B01CZTLHGE&pd_rd_r=dc18a54f-155a-4fed-96b4-ae2f1dee3bf4&pd_rd_w=846o7&pd_rd_wg=qyVSJ&pf_rd_p=03c604b9-aff8-43e1-ae09-374522ec365b&pf_rd_r=X8MR6BGCH3YGRQQXA69H&psc=1&qid=1599676196&sr=1-4-22d05c05-1231-4126-b7c4-3e7a9c0027d0

Is this a good starter kit? I'm like completely new.

>> No.1905805

>>1905711
It's nice, it has a lot of components and sensors to get started with basic projects i'd say go for it and have fun :)

>> No.1905893

>>1905711
https://youtu.be/fJWR7dBuc18?list=PLGs0VKk2DiYw-L-RibttcvK-WBZm8WLEP
Good box

>> No.1905933

>>1905893
Heyyyy! That's neat, thank you so much! I'll be following this series!
>>1905805
Thank you! I'm really excited to get started on arduino because I've been slacking and not doing much!

>> No.1906298

with an atmega328p, what is a method OTHER THAN UART where the chip can reliably receive messages from a computer, which are to be drawn to an ILI9341, at a pretty fast rate, like as fast as a human can turn two knobs? I'm running at 115200 and the messages just aren't being sent reliably if the knobs are turned too fast, the messages get garbled and thus what gets drawn on the screen is garbled shit.

Basically, I'm trying to control a computer program with 8 knobs, and have that program send numbers to the atmega328p to be drawn to the ili9341

>> No.1906307

>>1906298
It sounds like your protocol is pretty inefficient.

115200 should be plenty to transmit the values of 8 knobs. What space do you need to represent the value of one of your knobs? Maybe 2 bytes?
Even including a checksum you should be able to send all the values several hundred times per second.

>> No.1906312

>>1906298
You're using ASCII messages, aren't you?

>> No.1906347

>>1906312
yes why
>>1906307
yeah but keep in mind it's drawing the incoming value to a color screen at the same time

>> No.1906364

>>1906347
>yeah but keep in mind it's drawing the incoming value to a color screen at the same time
Receive the raw values through interrupts while you draw the latest value on the screen.

>> No.1906379

>>1906347
use binary messages and increase the baud rate. Otherwise just drop the atmega328 and get an arduino with usb built in

>> No.1906407

>>1906347
That's not the fault of the baud rate, it's because you're not using interrupts (or maybe you are, with too small of a receive buffer) and the screen draws are taking so long that it's dropping data.
Also I'm pretty sure I've used a 9341 before and you can make it a little faster if you don't send an address before every byte for sequential pixels. But then I wrote my own and didn't use someone else's general purpose library, so font rendering was down at a lower level.

>> No.1906584

>>1906407
>it's because you're not using interrupts
this is one of the reasons I have arduino. none of the examples they give to beginners use them and people complain when their shit is slow

>> No.1906586

>>1906584
>have
hate*

>> No.1906601

I want to make a function generator using an STM32 but I'm tarded with programming.
I have one half-period of a sine wave interpolated into an array. I can output the array via an analog pin.
But I have no idea how I can dynamically vary the frequency

I know you can express the frequency of a digital sinusoid via f=ωR/2π and time as t=R/n where R is the sample rate and n is the sample size
but this doesn't help much since I don't actually know what to do

>> No.1906629

>>1906364
hmm ill have to read into that

>>1906407
and you can make it a little faster if you don't send an address before every byte for sequential pixels.
does that mean you're setting up a drawing buffer or something?

>> No.1906649

>>1906629
IIRC it has an address register and a data register. You set the address with the address register then read or write data with the data register.
The trick is that most people make a "write byte to display" routine which does both of these and then use it exclusively. If you write ten words of data to consecutive addresses, that's 20 accesses. If you have code which knows that you're writing 10 words in a row and only writes the address once, that's only 11 accesses.
>>1906584
To be fair, it's not a trivial topic, the head of the average "lrn2code" type would explode if you tried to explain interrupts and re-entrancy, and it's one more thing can cause shit to lock up hard if you don't know what you're doing. The usual "blinky my LEDs" project doesn't use serial input anyhow. It's sort of the comms equivalent of using vinyl.

>> No.1906668

>>1906601
vary timing of the output of the array values.
e.g. change the index of the array every 5 ms, or 10ms, or whatever.
idx = 0
// array is your array you constructed
for(;;) {
analogWrite(pin, array[x]);
delay(5);
x = (x+ 1) % (len(array));
}

>> No.1906672

>>1906649
hmm. the register stuff seems bit over my head but i'm definitely going to read about interrupts. whats the process by which you would use interrupts to take in a message and draw it? for now, i'm polling and it's obviously shit

>> No.1906675

>>1906672
interrupts is about the serial port not the display, interrupt-driven serial I/O is a fundamental thing in embedded systems programming

>> No.1906686
File: 3.71 MB, 1700x3023, IMG_20200910_172014_tigr.jpg [View same] [iqdb] [saucenao] [google]
1906686

Hey, hardware goys
(not sure where else to post this)

How the fuck do I go about learning what all these things mean? I want to figure out how close to the “factory default” firmware setup/settings this laptop is using; but I’m not sure what even the factory defaults are “supposed” to be, and even then I know I wouldn’t actually understand it anyway. look at all this shit

Why did Intel have to turn everything into a goddamn acronym

>> No.1906691

>>1906686
You google the hardware, look for datasheets for the chips, and read the kernel driver code for the modules / drivers being loaded.
I have no idea why you want to do this, the stated goal doesn't make any sense.
The kernel module is deciding how to configure your hardware, not intel (intel may have written the driver, but maybe not). the hardware is configured on every boot.
Your complaint about acronyms instantly bring NGMI to mind.

>> No.1906707

>>1906686
>I just wanted to check my emails not jack in to the matrix
Someone call a nurse we got another escapee

>> No.1906917

>>1906707
This universe is just a simulation running on some esp32 equivalent at a higher dimension of existence

>> No.1906922

>>1906917
Who knows anymore man

>> No.1906930

>>1906675
so if i want to interrupt the drawing routine until the ISR is done receiving a uart message, how exactly would i trigger that interrupt on one of the hardware pins? or can the interrupt be done in software entirely?

>> No.1906967

>>1905711
>amazon
Try aliexpress for random electronics.
You'll be surprised just how much stuff you can get at once at like $10.
The kit is nice but at $54 it is steep. See e.g.:
https://www.aliexpress.com/item/4000146196267.html
https://www.aliexpress.com/item/32713761744.html
https://www.aliexpress.com/item/32542616423.html
https://www.aliexpress.com/item/32808337361.html
https://www.aliexpress.com/item/4000238240904.html

>> No.1907067

>>1906930
you need to look up how isr's work, particularly vectored interrupts.
you enable a peripheral interrupt for uart and when that peripheral receives data it will call the interrupt function.

>> No.1907069

>>1907067
The interrupt pins on the 328 are the same as the UART pins, thus can't be used at the same time

>> No.1907109

How do I exactly set a 200Hz PWM with adjustable duty cycle on an atmega328p?
Even if I have my clock at 1 Mhz a 1024 prescaler would put it down to to ca. 1kHz. Now I could program it that only every 5th sawtooth period would change the pin state but then I wouldn't know how to implement the adjustable duty cycle

>> No.1907276
File: 30 KB, 640x427, brass-spacers.jpg [View same] [iqdb] [saucenao] [google]
1907276

What size do your pcb spacers for the Raspi3/4 have? M2 or M2.5 and 2 or 2.5cm in hight? 2.5 seems to be right, bc PC mainboards. Any reason to buy brass over nylon? Anything else I should know about it?

>> No.1907282

diy noob here, i've never messed with electronics before, where is a good place to start with a simple project such as a fan pwm controller.
i'd like to use a rotary encoder for voltage control, have a seven segment display for the rpm & voltage and a 5v output for the fan.
is this feasible with an arduino?

>> No.1907295

>>1906967
Fuck you're right, I saw your message too late and has already bought it but I'll be on the lookout in the future using this site. Is there any item from this site that you'd recommend or just advice in general for buying online on sites like these?

>> No.1907324
File: 3.60 MB, 4032x3024, 20200911_173648.jpg [View same] [iqdb] [saucenao] [google]
1907324

Is this a potentiometer? It doesn't have the three pins that I see on every picture in Google

>> No.1907327

>>1907324
Encoder?

>> No.1907331
File: 2.77 MB, 4032x3024, 20200911_175537.jpg [View same] [iqdb] [saucenao] [google]
1907331

>>1907327
I don't know what you mean, sorry, I just started today...
It came with this thing on the left in a small plastic bag though.

>> No.1907342

>>1907331
No, I mean
If it looks like a potentiometer, but takes more inputs it might be an encoder...?
It's got a clock input I dunno

>> No.1907347

>>1907324
>>1907331
It's a rotary encoder. As you turn the shaft one direction or the other, it pulses outputs that can be decoded by a microcontroller to know which direction its turning. See if you can get a datasheet.
I can't tell what the other thing is, its too blurry.
Maybe some kind of LED?

>> No.1907371

>>1907069
what kind of interrupt are you talking about? The interrupt is not on a pin, its a generated interrupt from the uart peripheral when an event condition is met (byte read, dma buffer full, fifo full, etc)
what >>1906675 is talking about is basic real time context management for embedded systems.
here's an example:
>enable uart ISR
>main loop does things not related to uart such as display rendering, etc.
>uart hardware receives data, generates an internal interrupt. isr vector is called
>PC moves from wherever it is to the isr function
>in the isr function you move the data from the register/dma buffer to a working buffer to process later then set a data ready flag.
>exit isr
>PC returns to main, main is checking for this flag. if flag is set it processes the uart data buffer.
rinse and repeat.

>> No.1907373

>>1907282
yea sure, but not just with an arduino. you'll need some external circuitry like a mosfet to drive the fan since arduino pins cant drive that much current.
you also might need resistors in line for the 7 segment, the led's in the segments will burn if you drive it with too much current.

>> No.1907437

>>1907347
>>1907342
Thank you bros, I managed to find the potentiometer, I didn't know that it was "two-pieces" that combines together and is actually really small so it was in front of me the whole time but I didn't see it.

>> No.1907445

>>1907371
okay, does this have something to do with timer interrupts/should a timer interrupt be used for my purpose? or is this something totally different

>> No.1907481
File: 29 KB, 925x222, 1579386941785.png [View same] [iqdb] [saucenao] [google]
1907481

>>1907445
>or is this something totally different
read the datasheet
http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdf

>> No.1907541
File: 1.58 MB, 1920x1080, 1589098528634.png [View same] [iqdb] [saucenao] [google]
1907541

>>1907295
> Is there any item from this site that you'd recommend
- A bunch of usb serial converters (typically based on ft232rl, cp2102, pl2302, ch340, I'd grab one of each).
- A bunch of Arduino Nano r3 clones (under 2€ a piece).
- A bunch of attiny85 digispark clones (tiny devboards under 1€ a piece) & a bunch of bare "attiny85" DIP chips (should easily be less than 50c a piece).
- A couple of ESP32-PICO-KIT (under 10€).
- A few hd44780 (very standard 16x2 LCD displays, less than 3€ a piece).
- A basic logic analyzer ("saleae" clones, under 10€).
- An Arduino Mega 2560 r3 clone (try to get one with the atmega 32U4 for serial, under 20€).
- A ft2232h breakout board (a bit fancier usb-serial converter, typically 15€).
- A soldering iron (ts80, should be around 70€).
- A multimeter (Fluke 17b+ is the peak, 18b+ is imho worse, should be under 100€).
These are some worthy things that I am aware of, but I'm sure there's plenty more.
>Fuck you're right, I saw your message too late and has already bought it
Well, you'll get your kit faster, that's the silver lining.
>just advice in general for buying online on sites like these?
There's a general specifically for this. It goes by /csg/, in /g/.

>> No.1907549

>>1907295
Forgot to write some
>tips
- The "delivery method" is a dropbox. Try to select the fastest non-expensive shipping (cents of difference, but typically much faster, you'll see in droplist).
- Harmonize the shipping method across your shopping cart. The more on the same method the better.
- When deciding how many of a cheap thing to get, pay attention to the effect altering the quantity has on the shipping price.
- Read the reviews for items, if present. E.g. A while ago, I learned some board I ordered was being sent with the wrong resistor value for a specific resistor on the board, which causes some issues. Once it arrived, I just replaced the resistor with the correct value. I needed more, I ordered them from a different seller, which didn't have the issue. This kinda thing isn't common, fortunately, but it pays to at least skim the reviews.
- Check prices for things too. On Amazon, digikey, mouser or the like. It does not happen often, but sometimes, aliexpress is actually more expensive. Of course be extra careful for any item that costs a lot, individually or overall for the amount you're getting.

>> No.1907567

>>1907549
>I learned some board I ordered was being sent with the wrong resistor value for a specific resistor on the board
Blue pill? That's a USB detect resistor and a common problem with those boards. I just got a strip of the correct resistor value and keep it with the boards, pretty easy to fix, but haven't needed to use them yet.

>> No.1907570

>>1907567
No, it was a W5100 ethernet arduino shield. Too high resistor values near the ethernet port itself, media wouldn't come up.

>> No.1907608

>delete a bunch of comments
>rotary encoder problems go away
I don't know what to believe anymore

>> No.1907685

anyone ever play with the stm32f4 black pills?
https://stm32-base.org/boards/STM32F411CEU6-WeAct-Black-Pill-V2.0.html
you can solder on your own spi flash on the back and it can run micropython supposedly

>> No.1907742

>>1898776
>- msp430 launchpad (very low power optimized µC family, clean 16bit ISA, very friendly to asm programming, gcc support)

I've got a couple of them back in the day they were insanely priced @ $4.30

Never had a chance to do anything with them because:

- internal clock is wigglier than your usual angry obese feminazi
- it ain't 3.3V or 5V
- I/O pins can't source more than a very few milliamps (GRUNT!)

>> No.1907755
File: 1.06 MB, 1920x1080, 1587081060144.png [View same] [iqdb] [saucenao] [google]
1907755

>>1907742
I also got a few @4.3, and a bunch of ez430-f2013 sticks at $1.5 (!).
AFAIK the chips themselves do support 3.3v. I don't remember if that's the launchpad or not, but the launchpad board might allow you to configure them to 3.3v if you wanna, via the usb interface or via the jumpers.
Whole msp430 deal is obsessive low-power target. The launchpad board has got instrumentation related to that; It has builtin meters for power usage.
>internal clock wiggles
It's better than AVR8's internal oscilators as far as I remember, but I know they even sent smd xtals with them, and there's pad+throughholes on the board for smd or non-smd xtals, so you can use whatever clock of choice.
>I/O pins can't source more than a very few milliamps (GRUNT!)
These are for actual i/o, not for plebs to drive arrays of leds directly. It seems like an arduino would be more your speed (j/k).
>Never had a chance to do anything with them
If you've got some time and you're bored enough, check this out: https://embedded.fm/blog/ese101?format=amp

>> No.1907946

>>1907541
>- A basic logic analyzer ("saleae" clones, under 10€).
where can one find those? the original ones are bloody expensive

>> No.1907956
File: 976 KB, 1920x1080, 1573353208626.png [View same] [iqdb] [saucenao] [google]
1907956

>>1907946
Search for "saleae logic" and you'll get a bunch of these.
https://www.aliexpress.com/item/4000755596172.html
https://www.aliexpress.com/item/4001276094992.html
https://www.aliexpress.com/item/4000773672232.html
Any is good. 24MHz and 8ch is what you get. Pretty basic, but drastically better than trying to use some microcontroller board to do the sampling (e.g. arduino manages to capture a meager 1024 samples at 1MHz with 6ch, which is next to useless, with horrible trigger functionality).
Should you need more sampling power than this, investigate "dslogic". I got one of these because I needed 100MHz and more channels.
Both these suggested boards work great with sigrok / open logic analyzer interfacing software.

Offtopic: Currently I'm playing with FPGAs and having a shitload of fun. Spent most of my free time this week learning verilog and making my own very basic interface stuff w/o using anybody's libraries, using the open stack.
Open stack means iCE40 or ECP5. The latter is expensive territory, thus iCE40. For that there's:
- tinyfpga bx (sparkfun has them I believe, Good at up to 50€. Got mine in akiba at around 6k yen or so)
- icestick (sometimes on sale in major online electronic vendors. Good at up to 30€. Got mine at 19€ on a sale at rs components)
- icestorm mx (currently unavailable, some guy on UK makes them in batches, I'm on the notification list for new stock as I want one)
If you want to get fancy with ECP5, look at ulx3s and the not-yet-available tinyfpga ex.

>> No.1907972

>>1907956
Cool, thanks. Bought one, I hope it doesn' take a decade to arrive.

>> No.1907978

I have plans to make some device that reads data from a website, change the color of RBG led and generate a read out on LCD screen.

Would esp32/86 be good or would a Pi Zero be the preffed opition?

>> No.1907981

>>1907972
It should be there quickly if you considered >>1907549

>> No.1908018
File: 12 KB, 1460x391, wave.png [View same] [iqdb] [saucenao] [google]
1908018

>>1907109
I think I found an idea
For simplicity reason I assumed the counter signal would be a 600Hz signal with 255 steps
Since I want 200Hz I would have the pin to change it's state every 3rd period or 765th step

The variable duty cycle at 200Hz could be implemented like this:
1 period would be 756x2 steps so 1512 steps
The duty cycle is controlled by an 8-bit ADC
Said ADC would be at an integer value of 200

The amount of steps the pin state needs to be low can be calculated like this:
t_off = 1512 - ADCx6 = 312

The amount of steps the pin state needs to be high can be calculated like this:
t_on = 1512 - t_off

t_on would be transfered in a while loop together with a variable that counts the steps over multiple counter periods

while step_count != t_on
LED = 1

and then

while step_count = 1512
LED=0

Only think I'm uncertain of is how to count those steps over multiple periods

>> No.1908064

>>1907978
Both are good options, just go with what you see as more convenient to work with and also how much web scrapping is needed.

>> No.1908068

>>1908064
I am gonna make something that reads the GCP dot that everyone freaks out about as a starting point, then eventually see what else I can use it for.

>> No.1908102

>>1908064
I got a new problem the LCD I have for the PI goes into all the pins and I don't think I could run a RBG led.

>> No.1908179

>>1907956
those also work with the saelae logic software

>> No.1908191

I'm compiling and uploading the sketch using arduino-cli. It works, however I can't read the serial output via tail -f /dev/ttyACM1

Strangely, If I use Arduino Studio to upload the sketch, then I can access the serial from the command line. Any idea?

>> No.1908198

>>1908191
Turned out you need a special serial terminal which would send DTR/RTS signals to the device.

>> No.1908241

>>1908198
you mean XON/XOFF? arduino serial doesn't use hardware flow control

>> No.1908246

>>1908241
I guess. I just saw people writing small C programs to call ioctl to set DTR to solve this. Ended up using "cu".

>> No.1908409
File: 1.02 MB, 1920x1080, 1584511458716.png [View same] [iqdb] [saucenao] [google]
1908409

>>1908191 >>1908198
Basically, one of those control lines is wired to the microcontroller reset, which in turn is used for programming, else you'd have to press the button yourself for the bootloader to run and programming to be able to happen, every time you want to upload a sketch.
... and the sketch is uploaded through the regular RX/TX lines.
I don't recommend interfering with the serial while the programming is happening.

>> No.1908533
File: 48 KB, 1662x997, Raspi-Enclosure2.jpg [View same] [iqdb] [saucenao] [google]
1908533

Are there any options for /diy/ enclosures, besides 3d printing?

>> No.1908605
File: 1.81 MB, 1920x1080, 1572984555349.png [View same] [iqdb] [saucenao] [google]
1908605

>>1907946 >>1907956
It also samples at 48MHz (!), but it can't stream the data fast enough then. You just get a snapshot of 1024 samples or so.
At 24MHz, you can sample as much as you want (e.g. 1T samples) as the data is streamed as it is captured, and your computer's the limit.
Cheapo saleae clone has helped me a great deal figuring out what's going on with FPGA hell™.

>> No.1908606

>>1907981
Yeah, I'm other anon, I've been buying on AE for a decade, but since I moved to a different country and after the corona stuff, I've been waiting for months for some packages...

>> No.1908713

New thread:
>>1908711
>>1908711
>>1908711