[ 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: 247 KB, 486x460, MCP2221.png [View same] [iqdb] [saucenao] [google]
1784995 No.1784995 [Reply] [Original]

Previously /amg/ - arduino & microcontroller general.

Quarantine means tinkering edition.

Microcontrollers (esp32, blue pill, arduino, ...) & single board computers (Raspberry Pi, Banana Pi, ...) welcome.

>What to post
- Questions regarding microcontrollers & single board computers
- Discussion regarding microcontrollers & single board computers
- Projects you are working on

>What should I do with my [insert hardware]?
Look here:
https://hackaday.io/
https://www.instructables.com/
https://www.reddit.com/r/raspberry_pi/ (everyone is making magic mirrors)
https://www.reddit.com/r/cyberDeck/
https://www.adafruit.com
- This is not an idea thread. Check the catalog, or make a own thread for it.

>Usefull resources:

>Software
Ki-CAD
Your chipsets default IDE

>General electronics, also check their OP
>>>/diy/ohm

>Questions regarding software/OS on single board computers, unless specifically about GPIO
>>>/g/
>>>/g/fglt

>I have junk, what do?
Get rid of it.
Old thread: >>1758827

>> No.1784997

>>1784995

Showcased IC: MCP2221, USB to I2C/UART Bridge

>news
>>1765621 - Anon is very passionate about the RPi zero
>>1769200 - Anon asks about weird hexapods
>>1771671 - Anon showcases his pi hat and shills JLBPCB
>>1772457 - Anon plays himself
>>1778414 - Somewhat notworthy discussion about using other boards than arduino/raspberry as a noob.
>>1778661 - Anon showcases how he made his keyboard wireless
>>1765876 - Anons RPi4 arrived
>Unanswered questions from last thread:
>>1768157
>>1769737
>>1770089
>>1771634
>>1778290
>>1780845

>> No.1785000

>>1784997
>news
Based
>unanswered questions
doublebased
except for the half dozen anons seeing a (You) rushing to the thread to see if their question was answered, only to realise all you've done is reposted them

>>1768157
Might a 74HC165 work? Not as fancy as a dedicated IO expander, but not as expensive either. I have a 20-pack of them lying about exactly for multiplexing buttons. If I wanted to do I2C or some other 2-way protocol I'd definitely go for a proper IO expander, but for buttons it doesn't really matter. Have fun debouncing them though.

>> No.1785001

>>1771634
I never used that board, but frankly, just make a quick sketch where it prints all data (x and y axis) to the console. That should be the easiest and fastest way to figure it out, unless you got some information in the documentation it ships with.

>>1785000
>only to realise all you've done is reposted them
Annoying, but not avoidable. Maybe this way they get some form of an answer after all.

>> No.1785004

>>1785001
>Maybe this way they get some form of an answer after all
I agree, it's a necessary evil. Less overall annoyance than anons constantly reposting their questions themselves.

As for that anon's question, I don't know how he got to this point without any trial and error. I suddenly have a fear of having a fully stocked workshop with all my MCUs being one-time-programmable. That's a scary thought, I tend to reprogram my MCUs once or twice in a minute when I'm really in the thick of a troubleshooting session.

>> No.1785007

>>1784995

Very good work OP. This general has a definite reddit vibe going and that's what 4chan needs.

>> No.1785034
File: 211 KB, 376x240, Capture.png [View same] [iqdb] [saucenao] [google]
1785034

Anyone here ever used one of the Holtek MCUs?
It's very basic and lacks common interfaces like SPI or I2C. I recently bought a thermometer that apparently implemented I2C in software with this thing.

>> No.1785037

>>1785034
>that apparently implemented I2C in software with this thing.

and that's trivial. older AVRs do that using ordinary GPIO pins and a pretty small include file. I2C is pretty simple.

>> No.1785071
File: 126 KB, 573x505, mc68000-L_Motorola-MC68000L8.jpg [View same] [iqdb] [saucenao] [google]
1785071

>>1784995
FYI OP, next time please put /mcg/ in the SUBJECT field, not the NAME field so it will show up in the catalog.

>> No.1785329

>>1785071
That's... Quite an embarrassing mistake on my part. Didn't notice it. You recon it's worth staying or better to make a new thread? If so feel free to do so and copy the news etc.

>> No.1785360 [DELETED] 
File: 20 KB, 470x654, Atmega328.png [View same] [iqdb] [saucenao] [google]
1785360

Can anyone help me with why my PWM duty cycle won't update? I've cobbled this together from examples on the internet. I've tried a couple different ways to update OCR1A but nothing seems to work .Current configuration was stolen from this Youtube video.
https://www.youtube.com/watch?v=ZhIRRyhfhLM
His works. Mine doesn't. Both PWM duty cycles can be set on boot but I cannot change them on the fly.

>> No.1785405

>>1784995
based quarantinkerer

>>1768157
74xx165 for the inputs, 74xx595(or similar) for the outputs

>>1785000
debouncing is easy. just AND or OR multiple samples and/or don't sample them too often

>> No.1785427

>>1785405
>don't sample them too often
That's all I was going to use, just have the latch period be longer than the largest possible bounce period. The project being a musical (midi?) keyboard. But now I'm wondering if I can use oversampling to deliberately detect the bouncing, quantify some sort of bounce intensity or duration, and use that as key velocity data.
What sort of buttons do midi keyboards use for key velocity data in the first place? I can only assume they'd have to use analog sensors of some kind, like hall sensors or reflective optical sensors. At the very least they don't have the typical detent/hysteresis of most switches I know of.

>> No.1785435

>>1785427
>But now I'm wondering if I can use oversampling to deliberately detect the bouncing, quantify some sort of bounce intensity or duration, and use that as key velocity data
probably not reliably
>What sort of buttons do midi keyboards use for key velocity data in the first place?
something like the Playstation 2 rubber dome switches, with a rounded (not flat) conductive rubber contact, feeding an ADC, possibly via an analog mux
maybe you could try an optical velocity sensor with two switches having precisely staggered operate points

>> No.1785531

Can anyone recommend any modern book on electronics that includes using microcontrollers?

My knowledge level is:
CS degree, currently a Data Science postgrad, have aced physics II (electromagnetism) & digital design courses in undergrad.
Have tinkered with arduinos implementing some easy projects guided by a leaflet that came with my arduino kit.

Would like to learn:
How to work with audio signals, distorting, amplifying and doing other weird shit with them, and understand the principles behind why and how much I need to amplify something, what components I have to use, getting into schematics and even physics if possible (not a put that there, done kind of thing)
IoT, specifically set up some esps or arduinos and use web apps to control shit in my house (if this is not in the book but it teaches fundamentals so I can later understand what I'm copy pasting off the internet, its fine with me.
RF and IR controlling projects
How to make something work with USB, MIDI, HDMI, whatever protocol.

>> No.1785536

>>1785531
Some example projects I want to do are:
Guitar pedals
MIDI controllers
USB controllers (keybind switching workspaces or launching applications to physical switches and buttons)
IoT (eg automatic plant watering and monitoring environment, logging everything to some cloud DB)

>> No.1785557

>>1785531
>>1785536
Art of Electronics is good if you already have a basic grasp of the fundamentals.
For audio as well as RF you need a foundation in Signals and systems, and there will be math involved but it should be manageable with your background. Oppenheim is good for that.
Supplement that with the sections of Art of Electronics that focus on analog op-amp circuits and talk about decibels, bandwidth etc. If you get a good understanding of that you can start looking at projects step by step and fill in gaps as you go.

For IoT, USB etc. you will be dealing with communication protocols. It's not as math/hardware heavy but still a lot of info to process at once. This is where AoE starts getting dated and you might get away with lesrning stuff from online resources. DMX and CAN are good for learning basic comms but the hardware varies from protocol to protocol so be aware of that. With those projects you will mostly be writing software but if the projects get complex you may need to look back at analog for signal conditioning circuits.

For supplementing AoE, look at Hughes' Electrical and Electronic Technology, it casts the widest net but it's not too great for in-depth. It wss my uni textbook for all EE courses in first two years so it should csrry you well enough. If you're struggling with more fundamental concepts, also look at Electrical Engineering 101 by Ashby, it's very good for explaining the fundamentals practically.

Good luck anon, and remember to have fun.
t. electrical engineer

>> No.1785565

>>1785557
This is exactly what I was looking for, thank you! I actually had a signals and systems class during undergrad and I did well. My only issue with AoE is that I can't find it in Epub format and I prefer to do my studying from a kindle. I guess I'll study from my computer screen and buy it if I need to later on.
Thanks again mate. I'll post my progress here along with some notes so that it's easier for people to get into this stuff in the future.

>> No.1785679

>>1785565
Calibre is the Kindle users friend

>> No.1785713

>>1785565
does libgen not have an epub mirror?
also try for the new edition from 2013 or w/e, it's slightly more up to date but the core chapters are consistent.

>> No.1785724

>>1785713
>>1785679
I got the 3rd edition, there's no epub. I tried to convert with calibre but it came out fucked up. I found a command line program and did a passable conversion.

>> No.1786290
File: 879 KB, 888x996, bluepill.png [View same] [iqdb] [saucenao] [google]
1786290

I want to buy a Bluepill STM32 board but I have found there's two versions apparently one with fewer passive components (resistors, capacitors...)
does any one know if there's a problem with this? can't find schematics but the only difference I can see is a missing header of the BOOT pins

>> No.1786293

>>1786290
BTW I have model B and I just found out there's a "bug" with R10's value (pull-up resistor in USB's D+) but everything works ok

>> No.1786303

>>1786293
I bought a bunch of Bluepills a while back. I bought a small tape of SMD resistors at the same time and stuffed it into the same bag. When I want to use one for USB, I'll swap out the resistor.

>> No.1786308

>>1786290
>1k pullups for SWD port
lel, must be meant for a hard electrical environment
>BOOT
BOOT1 is mostly useless and you can get to it via GPIOB2. I definitely prefer A's boot jumper config
>fewer passives
they might have dropped the series resistors for USB, which is mildly questionable but far from a show-stopper. they also might have ditched one of the decoupling caps for the 32F103's power rails, which is a bit more questionable. or maybe it's on the other side
personally I like board A better. the extra footprint for choice of I2C EEPROM is a nice touch, since the STM32F103 has no internal EEPROM and if needed you would have to simulate it (poorly) by using program flash

>> No.1786320

>>1786290
I've only got B style myself. The BOOT0 jumper will let you use a serial loader instead of SWD, but I've never needed to use BOOT1. I worked on real products with STM32 years ago, and we only ever cared about BOOT0. If that single jumper is BOOT0, then it's cool. I would be happier with NRST brought out to the programming pins, but I guess the SWD works well enough without it.
I kind of like how A style has pads for an EEPROM.

>> No.1786330

>>1786303
>>1786308
>>1786320
thanks mates

>> No.1787196
File: 61 KB, 600x797, fug.jpg [View same] [iqdb] [saucenao] [google]
1787196

Guys how should I go about learning to program for cortex m0+ in c? I can't find any concrete guides on it.

>> No.1787213
File: 79 KB, 1280x720, starting_voltage_and_current.png [View same] [iqdb] [saucenao] [google]
1787213

Got bored so I programmed a nano to monitor the voltage and current at my truck's starter motor. Sensor is linear hall AH3503. I used a few lams from an old starter motor to concentrate the flux. In pic related the voltage scale is misleading because I wanted to see the actual 0-5v from the hall; the green plot is the voltage at the starter and is about 9 volts maximum for most of the plot.

>> No.1787384

trying to make an arduino i2c software controller
wondering if there are gonna be problems if i have one pin outputting high and another pin outputting low connected together

or should i add an external pullup resistor and set the pins to high impedance instead of pulling them high

>> No.1787391

>>1787384

i2c SDA and SCL always have external pullup resistors. i2c devices NEVER drive SDA or SCL high. i2c devices only pull SDA and SCL low. I have a file that I can't find on the internet and it's not convenient to upload, but it is AVR assembler for software I2C, and the way it handles SDA and SCL is first it clears the bits in the PORT and DDR registers. This sets them as high impedance inputs so the line is pulled high by the external pullups. To pull a line low it sets the bit in DDR. To release that line it clears the bit in DDR. The PORT bit is always left clear.

The way I2C bus works is that any device can pull either line low but no device can force a line to be high. A line goes high only if all devices release it, which is how bus arbitration works.

If you want to see the file I can pastebin it tomorrow.

>> No.1787392

>>1787196
program what? C is C. libc usually handles all the magic for you then calls main(), where your code will probably be running at a slow but not glacial pace. you will then need to play with the particular chip's clock controller and other hardware to set the performance to the desired level
maybe start with libopencm3 and their library of examples for several chips

>>1787384
I've burnt out several EEPROMs when I inadvertently accidentally just like that. never strongly drive I2C high, use pullups and simulate an open-drain output with the DDR bits. the built-in GPIO pullups would be non-compliant, technically, but if your wires are short they're good enough for government work

>> No.1787403

>>1787391
>>1787392
>when I inadvertently accidentally just like that
based

thanks brehs, will set the pins to high impedance instead of driving them high

>> No.1787762

>>1784995
So for my first big robotic project I'm making slide guitar. I've got everything planned out besides the movement of the slide itself. I know I need some kind of linear moving system, but I'm not really sure how to pick a good system to do it. Can anyone recommend something from experience or a good resource to figure it out? I'm not too keen with the mechanical side of things.

>> No.1787763
File: 48 KB, 740x400, Belt-Tension-Feature.jpg [View same] [iqdb] [saucenao] [google]
1787763

>>1787762

Stepper motor with a belt will probably move fast enough with decent precision. Stepper with screw will be more precise but a lot slower.

>> No.1787808

>>1784995
Can someone answer me what I think is a simple question?
I got a sim800 (SIM card) hooked up to a 3.7V battery source and a 3.7V Arduino micro clone.
When the sim800 sends a message, starts a call, or anything basically, its current use spikes and resets the Arduino.
I am clueless about electrical engineering at the finer level, but wouldnt a capacitor be the solution?
This is the simcard board
https://nettigo.eu/products/sim800l-gsm-grps-module
It consumes 2A at transmission.

Also, if it's not the answer, can point me in the right direction?

>> No.1787816

>>1787808
capacitor can work. size it so the voltage sag from transmission pulses doesn't drop the voltage low enough to reboot the tarduino

>> No.1787819

>>1787763
You think it would be able to hold the weight? The plan would be to have two of them parallel to each other, with a bar (probably metal?) between them where the slide would be attached. It would also need to be sturdy enough to keep a steady pressure on the guitar strings.

>> No.1787821

>>1787816
So the voltage dropping is causing the Arduino to reset, and the voltage drops because the.. current .. increases?
How would I go about sizing it?

>> No.1787856

>>1787821
MCU's usually have "brown out" reset, which is a reset when the current drops too low.

When something draws more current than is capable of being supplied, voltage drops. If you are trying to use the 3.3V pin on the arduino, it cannot supply that much current.

You need:
- a power supply capable of producing 2A
- a 3.3V regulator capable of producing 2A


There are cheap breadboard power supplies which you can probably use for this.
e.g. https://www.ebay.com/sch/i.html?_from=R40&_trksid=p2380057.m570.l1313.TR3.TRC1.A0.H0.Xbreadboard+power+supply.TRS0&_nkw=breadboard+power+supply&_sacat=0

The capacitor cannot supply 2A if you don't give it 2A to begin with.

>> No.1787862

>>1787808
>and the voltage drops because the.. current .. increases?
yes, because the battery has a non-zero effective series resistance intrinsic to its construction. even the wires have some non-zero resistance, Pic related. the important resistances are drawn as red zigzag, the less important but nonetheless present resistances are drawn as red lines over black wires (but are actually a lumped quantity over the entire wire, as resistances in series are additive)
allow me to oversimplify some basic circuit laws:
>Ohm's law: across a given resistance, voltage is proportional to current
>Kirchhoff's current law: I is going to be equal around a circuit
>Kirchhoff's voltage law: the sum of all voltages in a circuit is zero
the E=IR dropped across the battery/wires is that much less E to reach the duino. at 2A, even half an ohm of wire/battery R means a full volt dropped
>How would I go about sizing it?
just go big, like 1000µF 6.3V (or more). you generally want to de-rate elcap voltage ratings by a factor of 2 or more

>>1787819
>electronics guys, tell me how to build my slightly odd mechanical application
you could have gotten on jewtube and looked at more than one existing robotic slide guitar project, some of which might have been presented with design discussion including valuable tips and gotchas of this particular application. why would you even skip this step?
don't be a pajeet on stackoverflow, or worse, an amerifat on stackoverflow. do your homework and learn to draw inspiration and knowledge from the works of others

>> No.1787873
File: 231 KB, 433x687, arduboyplay.gif [View same] [iqdb] [saucenao] [google]
1787873

Are you guys familiar with the Arduboy?
https://arduboy.com/

Would it be possible to make a USB and Bluetooth controller in the same credit-card form factor that instead of having games inside and a screen, it just controls a smartphone or computer?

The Arduboy has an 8hr battery life.
Would the Bluetooth consume more power than running the games and screen?

Obviously I'm not talking about an amateur project with off the shelf parts, but something with a custom printed board.

>> No.1787896

>>1787819
belt drive to something that itself is running on linear rails of some sort

>>1787873
It sounds possible, but you'd have to look up the kind of specs that bluetooth controllers use. You might have to do it via wifi if BT doesn't do it, which would be a pain. BT might have significant latency too.

Alternatively, and this is a real stretch, you could use your cellphone's FM radio with your headphones as the antenna, such that the controller feeds it latency-free information via FSK or CW or something. Naturally you'd need to have an app that specifically supports that method of control.

>> No.1787899

>>1787896
Thank you very much.
I'll look those things up.
But I was thinking it would be something like this:
https://www.8bitdo.com/zero/
My issue here is that it being so flat there might be some serious limitations in terms of battery life.

>> No.1787906

>>1787899
How flat do you want it to be?

It's not hard to get a lipo that's a few mm thick with like 800mAh capacity. That's around 10 hour battery life for a wifi module, which I believe is more power hungry than Bluetooth.

>> No.1787912
File: 226 KB, 1500x1000, 155f195232dc65.jpg [View same] [iqdb] [saucenao] [google]
1787912

>>1787906
About as much as the Arduboy (0.25in/6.35mm) would be ideal.
The whole point is that it should be very flat and maybe even fit inside a wallet kinda like a Victorinox Swisscard (pic related).
I imagine a couple of mm thicker would be acceptable, but I'd have to make it a bit smaller to account for the wallet pocket being filled more in the z axis.

>> No.1787914

>>1787873
sure it would be possible. you'll almost definitely be using a different micro for the job, maybe two. micros with both native USB and a bluetooth radio are a bit uncommon. the question, then, is whether you wish to use a micro with native USB and a separate BT radio peripheral, or a micro with native Bluetooth and a separate USB-HID interface
>inb4 V-USB
low speed USB is fairly limited. you may not be able to run a bootloader over low speed USB so easily
>consume more power
if you're not careful, yes. power management is an adventure that demands thoughtful effort and careful measurement
you can manage the power consumption by how often and regualrly you send reports to the host, how aggressively you underclock and disable peripherals when you're not using them, and the capacity of the battery you choose, among other things
but this is engineering. *you* have to do the math

>> No.1787920

>>1787914
I see, thank you (Sorry I don't know much, I'm a complete layman).
What about something that has nothing to do with Arduino, and is just a regular custom printed board?
Would that be possible to power with a super thin 180mAh LiPo battery like the Arduboy has (assuming good power management)?

>> No.1787926
File: 43 KB, 800x800, HTB1s0VyoN6I8KJjy0Fgq6xXzVXaj.jpg [View same] [iqdb] [saucenao] [google]
1787926

>>1787912
I like to use old phone batteries for projects - they're 5mm thick.
And they are (usually) in a sturdy case.

You can easily find thinner, though. Just search for lipo cells on ebay and you find a ton of those internal batteries in metal foil.

You could also check HobbyKing, they have this neat search thingy that let's you search the dimensions you want really easily.
They offer decent and cheap batteries but they are for RC and aren't the thinnest, and also don't come with a protection circuit.

>> No.1787929
File: 296 KB, 1052x1052, Screenshot_2020-03-27 Thin (1 mm to 2mm) to Ultrathin (0 5 mm) Rechargeable Lithium Polymer Cells from PowerStream.png [View same] [iqdb] [saucenao] [google]
1787929

>>1787926
I know they exist, the Arduboy itself uses something similar to this:
https://www.powerstream.com/thin-lithium-ion.htm
What I need to know is if it's going to be enough to power it for an acceptable amount of time.

>> No.1787931

>>1787929
I'd guess you'd get maybe an hour of use out of such a 50mAH battery.

But it's impossible to say without knowing exactly what you're gonna power.

>> No.1787932

>>1787931
Got it, thank you very much.

>> No.1787985

Im working with the same module powered by some 18650, adding a big capacitor (im using an 4700uF) works perfect for me

>> No.1787988
File: 488 KB, 2250x2313, ArduCAM_ProtoboardVersion_bb.png [View same] [iqdb] [saucenao] [google]
1787988

It must be as close from the SIM800 as possible

>> No.1788076
File: 321 KB, 2058x1461, 1554997943666.png [View same] [iqdb] [saucenao] [google]
1788076

>>1787920
arduino isn't engineering, so all that advice is still good :^)
in the datasheets of MCUs and external chips you will usually find a section of characteristics which lists, among many other things, current consumption of the device under a number of different specified conditions. I looked up the STM32F072, which has some nice features (USB DFU bootloader, crystal-less USB, good power management, cheap, available), picrelated
the STM32F072 draws 5.6mA worst-case executing code from Flash with all periphs enabled. the nRF8001 Bluetooth transceiver pulls 20mA total, typical, when the receiver is on 100% of the time (implausible worst case). there's probably several hundred µA on the board in analog portions of the F072, GPIO pins, leakage and otherwise not being accounted for, so let's just round up 20mA+5.6mA = 27mA which we now divide into 180mA for a ballpark absolute minimum run time of 6.66 hours on battery. actual power usage depends on your Bluetooth profile and configuration info. also there may be more power-efficient Bluetooth radios out there
if you wanted to, you could also look at sleep mode consumption which, for the F072, is about <1mA with everything off, and <3-4mA with everything but USB on. another table on p58 (not shown) shows the analog Vdd current consumption, which is approximately 10% additional, not more than 354µA in any case. the nRF8001's input power can be cut with a MOSFET to zero its power consumption
note, zero fucks to give about the high power consumption while the USB peripheral is active because you would probably not be discharging the battery at that time anyway

>>1787988
good point, bypass caps should be very close to the loads they are to serve. inches matter

>> No.1788108

>>1787821
>and the voltage drops because the.. current .. increases?
Yes
Are you asking because you're thinking "but V = IR" ? Batteries are often approximately modeled as a voltage source in series with an internal resistance. That voltage across the internal resistance increases with current and that's why the voltage at the battery terminals drops when more current is drawn.

To fix your problem, maybe use more batteries in parallel.
You might also be able to isolate the controller part of your circuit with a diode and capacitor so that the sim800 can't pull power from the controller's power capacitor when sending a msg or whatever. But then you have to concern yourself with the diode voltage drop.

>> No.1788114

>>1787856
Okay cool.
>>1787862
Thanks a lot! Really appreciated.
Is there a good source of information on beginnner EE that can teach me some basics? Should I just read a textbook on the stuff?

>> No.1788116

>>1788076
Wow, thank yo so much.
This is all above my paygrade so if this ends up being built, it won't be by me, but thanks or giving me a clearer picture of the situation.

>> No.1788122
File: 44 KB, 458x347, 1583215286791.png [View same] [iqdb] [saucenao] [google]
1788122

>>1788114
if you can read science, you might find The Art of Electronics a good on-ramp. pause reading and use google to fill in the cracks if needed
also
>>1787862
>pic related
>doesn't pic related

>> No.1788247

>>1788122
>The Art of Electronics
I'll look it up, thanks again.
>>doesn't pic related
Yea no sweat, I got the basics of what you meant.

>> No.1788253
File: 30 KB, 480x481, a68c69_73ef1bf05e8143538b0f4ca20f736847~mv2.jpg [View same] [iqdb] [saucenao] [google]
1788253

so I have this wemos d1 mini, was thinking of making some project where I would use it to push some binary data through USB, so what exactly would I need to look for to add a USB interface? A usb host shield?
I only found stuff similar to this but no idea if it'll be compatible https://www.banggood.com/Mini-USB-Host-Shield-2_0-ADK-SLR-Development-Tool-p-1175308.html

>> No.1788256

>>1788253
Do you just want to send raw data to a PC or other USB host?

Then you don't need anything, there's already a USB serial chip on it - which is used to program it but you can also communicate through it.

>> No.1788263

>>1787988
Thanks, this is great.

>> No.1788273

>>1788256
I was meaning to use its USB port just for charging. I'm trying to connect it to a nintendo switch and send some data but I'm not sure if the switch powers the wemos by itself since the switch's usb c port is usually used for charging the switch and connecting it to the dock. Maybe I should check that first

>> No.1788335

I have an incredibly autist question.

I have several raspberry pis and while I have several ideas on what to do with them. I can't exactly justify all those projects. Think about it, a 35 USD credit card sized computer is STILL 35 USD and that's without a HAT, case and whatever other electronics attached to your GPIO.

For example, I can justify a use of a pi as a NAS server (because a NAS is expensive), but a raspberry pi as an AVR programmer or a raspberry pi as a wireless speaker...probably not as much.

How exactly do you justify a raspberry pi project if you have both limited pis and other opportunity costs (other pi projects)?

>> No.1788358

>>1788335

So that's what austism is, huh? To me, you are way overthinking this. Use a pi for something it is good at. Use a microcontroller for something it is good at. Do projects you can afford. If you already own something, then it might make sense to use it for a task that doesn't really use all its power. It all depends.

>> No.1788480

>>1788247
no prob, and if you want something suitable for someone with a less scientific education, Forrest M. Mims III wrote a bunch of "Engineer's Mini-Notebooks" and primers for Radio Shack years ago, you might be able to find reprints

>>1788273
you might want something with a more suitable power scheme for your application. little details like diodes to prevent back-powering the USB host are important
USB is a pretty big rabbit hole. you should read the base spec and, for what you're probably trying to do, the HID class spec. USB 1.1 is enough. hope you didn't have plans for the rest of the weekend

>>1788335
it doesn't help your immediate problem very much, but I tend to design/assemble projects so that I can easily swap out the pi by disturbing as few connections as possible. eg building a custom hat or a custom "Dupont" wiring harness that plugs right onto the GPIO or module header, aligned with one end of the connector, and other connections/wires to the corresponding GPIO ports for the facility needed. one corollary is that I can recommission a Pi quickly. shutdown, pull one thing off the GPIO, pull one SD card, install one SD card, put one thing on the GPIO, power up, rock
>AVR programmer
I have one Pi system image for my test bench that includes AVR/serial flash programming plus a few scripting languages for exercising serial buses and controlling signal generators. I built a little level-shifter for AVR programming with a 1x7 socket header and dotboard. I also built fly leads with a dual-row shell and sockets on one end and single Dupont pins on one end, to plug into a breadboard or chain
fortunately, the GPIO headers of other cheap ARM SBCs (Xunlong, FriendlyARM, Sinovoip, etc.) are broadly compatible with the pinout and special functions of the rasPi, and you might be able to drop-in replace the ras in a less ras-specific rasPi design to reclaim rasPis later on. with the other SBCs the trails are less clearly marked and there's little hand-holding

>> No.1789378
File: 182 KB, 756x1008, IMAG1270-756x1008.jpg [View same] [iqdb] [saucenao] [google]
1789378

>>1784995
Hi, I would like to make a custom webcam out of an OV7670 camera I have laying around, give it a nice small wooden case etc. I could use it with an arduino but it's probably too slow and too large for what I have in mind. I have some micro arduinos too but they're even slower. Is there any way to do this? Preferably I'd hook it up to a pc directly but I have very little knowledge about this.
Any ideas?

>> No.1789470

>>1788335
>autism blah blah justification
Who cares besides you? Get over yourself and the problem goes away.

>> No.1789495

>>1789378
use a pi, it already has some sort of drivers
https://www.arducam.com/tag/raspberry-pi/

>>1789470
/thread

>> No.1789681

>>1788335
Either:
- Actually do something worthwhile with it (almost never)
- use a zero. Justifying 5$ is much easier and it can run what 3/4 of people do with Rpis.

>> No.1789683

Does anyone know if on a Raspberry Pi the Pins for 3.3V, 5V and GND are shorted? I mean each of them with their own type of course. In theory does it make a difference if I use all the ground pins or attach the same load to a single ground pin? Should I use half my 3.3V to one pin and the other to the other 3.3V pin or doesnt it matter if I just use one?

>> No.1789694

>>1789683
yes, they are all connected to the same node, and you can use as many or as few as you like. as a general rule, prefer the ground pin closest to the other signal/power pins used by that piece of equipment

>> No.1789850

>>1789495
Thanks, that would be a solution but permanently dedicating a pi to such a small project seems a bit of a waste. They're still €30+ even on Aliexpress. I could accept a (very) low framerate and image quality, even b/w would be acceptable, it would be more like a useful small fun project.

>> No.1789851

>>1789495
Basically this sums it up, replied before I read this post:

>>1788335

>> No.1789852

>>1789850
bruh
https://www.aliexpress.com/store/1553371

>> No.1789868

>>1789852
Kek ty, I'm going to buy some of these for future use. Still, for the webcam project they're a bit bulky.

>> No.1790002

>>1789694
Thanks man. I assumed so, but I wasn't sure.

>> No.1790147

>>1789851
"web" is a lot to ask of an AVR duino. TCP alone is a lot to ask of an AVR duino. the limiting resources are RAM and flash, not IO. the mega2560 might be just enough to manage it, via Ethernet, for a couple of clients at a time, using a monospace font in one color and an iframe. maybe
a bluepill might be a better choice for the application, having a bit more RAM and better math skills. depending on whether you can pull frame data out of the camera at your leisure, it may be possible to send uncompressed PNGs with pixel data straight out of the camera module. better if you can find one with 128k flash, you might be able to do some lossy image compression then

>>1789868
52mm square isn't that big
you can always design your own board and make it as small as you like
anyway https://circuitdigest.com/microcontroller-projects/how-to-use-ov7670-camera-module-with-arduino

>> No.1790167

>>1788335
It's a thing. If thing does what you want, use it for the thing. It's a $35 board. You already have it. Stop overthinking it. Just make the projects you want and if it keeps you awake at night computer a few dollars in cost justification, ask your doctor for xanax

>> No.1790172

>>1790147
I see, thanks for your insightful reply. I still can't really understand how normal chink webcams handle this kind of data then, they have very tiny pci's. Wouldn't there be a way to just transfer the raw data to the pc via usb and have driver software convert it to video image?

>> No.1790187

>>1790172
>how normal chink webcams handle this kind of data then
micros designed for the purpose, including more RAM, DMA from the GPIO ports, native hardware USB 2.0, and so on. something like the EZ-USB FX2 would also be a capable little MCU for general high-speed USB 480Mbps interfacing
>just transfer the raw data to the pc via usb
sure, if you can capture it from the camera. but it looks like the camera outputs bytes faster than the mega can consume them
https://www.voti.nl/docs/OV7670.pdf
anyway why didn't you just search for an OV7670 library and follow directions? this is the correct and most fruitful first course of action for almost any piece of hardware

>> No.1791470
File: 2.75 MB, 320x180, 1539824155519.webm [View same] [iqdb] [saucenao] [google]
1791470

Anyone with pspice experience here?
used it years ago in school, but only dabbled a bit with it.

recently read that you can emulate an arduino in it.
curious if someone did a project completely virtual already

>> No.1792055

>>1791470
>emulate an arduino in it
i would not recommend this. spice is best used for testing idealized circuit blocks to verify the assumptions behind your design, and then maybe to throw some parasitics in to see step responses or bode plots etc. arduinos are just too easy to debug physically out of circuit to be worth emulating them with some miserably outdated software.

>> No.1792060

>>1792055
>miserably outdated
>>>/g/

>> No.1792065

>>1792060
if your software isn't written in node with a pastel color scheme and cheeky millenial tooltips then it's out of date

>> No.1792135

>>1792055
>arduinos are just too easy to debug physically out of circuit
Or even in circuit, especially with the serial printing of debug data.

>> No.1792325

Does anyone own a GreatFET One? What can I do with it in terms of hardware hacking that I can't with a Raspberry's gpio? Can it substitute a logic analyzer?

>> No.1792469

I was looking for books on assembly and I found those two comments:
>>A lot of modern Assembly Language classes use AL as a sort of “introduction to computer architecture”, rather than treating
it as a useful programming language. That’s one path, and certainly valuable, but you might be better off finding a book from
the 70s or early 80s, when actually writing in AL was one of the few high-performance alternatives around.

And
>>Modern architectures (ARM, MIPS, x86) make it really annoying to try to learn their assembly languages, since architectures
are no longer “aimed” at assembly programmers. The instruction sets are easy for a compiler to deal with, but awkward and poorly
documented for humans.

Do you guys agree? Especially with the second comment?
Not sure if i should ask here or in /g/.

>> No.1792473

>>1792469
Sorry for the bad format with regard to the text that should be green.

>> No.1792485

>>1792469
As someone who has had the (dis)pleasure of having to work with x86 (16 and 32-bit), ARM, aarch64, gbz80 and PIC, I can comment on the second statement.
I definitely agree with it. The most blatant example is ARM. This architecture is extremely simple for compilers to deal with: All registers are general-purpose, all instructions can be made conditional, one operand of nearly every instruction can be shifted or rotated, there's instructions for "multiply and add" which is _clearly_ designed with array access in mind (base pointer + data size * index), and accessing a structure as in `val = *(basepointer + 3)` is a single instruction without having to use an intermediate register.

Contrast this with a simpler architecture like gbz80 (I don't know proper z80 so bear with me). You have no multiplication, most registers are 8-bit but can be combined into a 16-bit register by forming pairs, one register (hl) is specialized for use as a pointer, the result of any arithmetic is stored in the `a` register, and much more.

The difference that this makes is that compilers are very bad at dealing with a lack of pointer+offset and array access, and special-purpose registers. https://retrocomputing.stackexchange.com/questions/6095/why-do-c-to-z80-compilers-produce-poor-code

And now, you may think, okay, aren't all these added features also really useful when writing assembly manually? And, don't get me wrong, they really are, but when there's so many ways you can write the same thing depending on how you arrange the instructions and manage your registers, some more optimal than than others, it becomes nearly impossible to find the "good" way to write something. Older assembly languages like z80 and 8080 are much more focussed, the registers have specific uses and you can keep the full instruction set in your head at all times, making it easier to figure out how to write something and in my opinion, much more fun.

>> No.1792583
File: 28 KB, 543x606, 1564343196970.png [View same] [iqdb] [saucenao] [google]
1792583

>>1792485
>This architecture is extremely simple for compilers to deal with
>all instructions can be made conditional
lolno, they pulled that out of AArch64 precisely because that feature was targeted toward compact hand-written assembler programmers. they make advanced/multiple execution units harder to manage at the hardware level, and compilers also fail to deal well with a given generated instruction participating in multiple conditional paths without being a fork per se. the usual example given is the Euclidean algorithm for GCD, picrel
>actually liking special-purpose regs
even if the first implementations were slow af, the M680x0 was the absolute pinnacle of assembly language programming. change my mind

>> No.1792604

>>1792583
>that feature was targeted toward compact hand-written assembler programmers
Huh, I actually didn't know that. I guess I just assumed it since I've seen many compilers play with it, and the fact you can choose whether an instruction sets the status flags or not, in weird ways, usually to save a few branches, which avoids invalidating the pipeline and whatnot.

>>actually liking special-purpose regs
Like I said, modern features are definitely nice to have, but the more moving parts a programmer has to keep track of the more annoying it is to write, imo. I guess my main point is: It's better for a programmer to have a simpler instruction set with not too many surprises and quirks, and ARM really does a lot of the latter down to the stupid simple shit like loading a constant, reading memory from unaligned addresses (referring to the old behavior of shifting), and branching (especially when you take THUMB into account). The more the programmer can keep in their head at all times and predict, the easier it is to read and write.
I've yet to have the pleasure of writing a simple assembly language with modern conveniences like multiplication and simple ptr+offset access, but thus far I've had most fun writing gbz80.

>> No.1792618

>>1792485
>>1792604
Thanks for the information. I only have an interest in assembly, so microcontrollers and microprocessors that focus on compilers go completely against what I'm looking for. Do you know which other architectures are focused on the assembly programmer instead of the compiler (The more the focus is on the programmer, the better.)? I'm interested in taking a look at them in the future as well.

>> No.1792626

>>1792583
>>even if the first implementations were slow af, the M680x0 was the absolute pinnacle of assembly language programming. change my mind
Thanks for the information. Maybe I'll take a look at this one too. It's just that I don't have much time. But I've already made a note of the M680x0 name.

>> No.1792630

When does arduino falls short when compared to going for a bare microcontroller?

I mean, I was looking at the ventilator that the MIT has been putting forth and they are controlling it all using an arduino, and we are talking about makeshift medical equipment.
What could be an example of something concrete that would make you say "sod this. hanz, bring the STM32".

>> No.1792631

>>1792630
>What could be an example of something concrete that would make you say "sod this. hanz, bring the STM32".
3d printers

>> No.1792635

>>1792630
>What could be an example of something concrete that would make you say "sod this. hanz, bring the STM32".
Any sort of USB support, need to have more storage/memory, or a specific form factor that isn't easy to work a fucking devboard into. (not to mention that devboards are shoddy to use in anything other than y'know, development. pin headers aren't designed for long-term usage)

>> No.1792636

>>1792631
Why? I mean is that something on the lines of "the microcontroller that is in a regular arduino is not one that would be useful for that". or more of "arduino in itself is no use here"?

>> No.1792638

>>1792630
Ventilators aren't all that complicated so not a terribly good example.
to answer the question where an stm32 would be better:
engine control unit
any appliance or handheld with a graphical display

>> No.1792639

>>1792638
>Ventilators aren't all that complicated
Could you make them with half a dozen op-amps or comparators? Probably more expensive than a cheapy micro, but still an interesting thought.

>> No.1792640

>>1792636
It's a joke since a lot of 3d printers use Arduinos.

But they do suffer for it because 3d printers have to do a ton of calculations quickly (like interpolating positions or calculating speeds and accelerations) while they also have to precisely time all the steppers. They can't always keep up despite the massive effort people put into optimizing the firmware and it causes problems.

>> No.1792645

>>1792639
A rudimentary one, almost certainly.

>> No.1792646

>>1792626
no, really, the 680x0 (and the VAX which it was sorta kinda modeled after) are the co-stars of a major chapter in computing history, the pinnacle of the CISC machine
quick rundown: variable-length CISC instructions, 8 data regs, 8 address regs (A7 reserved for stack pointer, A6 conventionally used as frame pointer), a PC, a supervisor SP, condition code regs, few supervisor-only regs, complex addressing modes, highly orthogonal (e.g. memory-to-memory moves and register-to-register moves are of the same MOVE instruction)

>>1792618
>The more the focus is on the programmer
complex addressing modes are harder for the chip and the compiler to use, but easy for a human. that's why RISC machines have relatively simple ones (yes, scaling indexes is considered simple, from the data flow perspective): easier for a compiler to schedule and use, and the complexities just slow the whole thing down (see Amdahl's Law)

>>1792630
>arduino falls short when compared to going for a bare microcontroller?
when you don't need what the duino ecosystem has to offer
>UART bootloader and startup delay
>C++
>the arduino HAL
>all those libraries
or do need something it doesn't contemplate
>control of highly specific hardware facilities e.g. core-independent event systems, extended timer features, maybe interrupts
>RTOS
>native USB
>smol AVRs with little flash or RAM
reaching for the STM32 is fine but don't neglect the option of coding AVR to bare-metal, just using avr-libc and direct hardware register access. for example: setting the control voltage of an LED driver IC to maintain a specified output current, with commands/status and process/set values sent over an opto-coupled 2400bps async serial link with 16-byte soft FIFO, the ADC running continuously in the background, and a few limit monitors and watchdogs. with a bit of care and the -Os gcc option, I managed to fit all that into an ATtiny402 with its 4kB program flash and 256 bytes of RAM

>> No.1792647

>>1792645
>almost certainly
Wait, as in it will almost certainly be rudimentary, or it will almost certainly be possible?

>> No.1792648

>>1792647
it would almost certainly be possible to build a rudimentary ventilator with a handful of opamps as the control circuitry

>> No.1792657

>>1792640
AVRs don't math very well. for a CNC machine with many axes, you'd want hardware multiplication and division, and you'd also want more and better timers with more outputs than the megaAVR line offers

>>1792639
sure, but it will only be a toy since you can't prove anything much about it

>> No.1792659

>>1792657
>you can't prove anything much about it
What does this mean? Prove? If it works it works. Getting it to spec would just be a matter of using precision parts and high-linearity analog IOs.

>> No.1792666

>>1792659
>If it works it works
children playing with toys think this. now prove it can't ever fail

>> No.1792668

>>1792666
My thought process was that an analog circuit would be less fail-prone than something programmed in the arduino environment, not like a feedback loop can crash.

>> No.1792679

>>1792668
>less fail-prone than something programmed in the arduino environment
while true, I think implementation variations are dominant e.g. a skilled medical device programmer could structure their code to cover more failure cases, identify the faulty component, and respond sanely and safely, compared to a skilled analog designer who doesn't into medical devices very much
>a feedback loop
that's not the whole package tho. you will want to monitor many conditions, recognize states, impose limits (which may vary according to setup parameters), and alert the user to quickly and appropriately react when those limits are exceeded. maybe you'll want to constrain/force/stop the control loops to avoid blowing out some kid's lung due to a misconfiguration, which is a hazard in a fast-paced emergency environment. maybe you'll want to recognize the patient's respiratory efforts (as distinct from pressure or suction by the ventilator itself) and support/encourage those efforts as appropriate (esp when weaning the pt off the ventilator)

>> No.1792681

>>1792679
I guess it's a more nuanced device than I gave it credit for. I'd ask if there were room for 7400 ICs, but digital logic + analog control loops isn't the smoothest combination out there, requiring analog switches and maybe even DACs of some variety.

>> No.1792687 [DELETED] 

>>1784995
I have an RPi3 and two RPi0s. What the fuck can I do with them? I already have a retrocade. It'd be fun to have a project I have to be creative with rather than following a guide.

>> No.1792771
File: 164 KB, 752x900, 1578285647598.png [View same] [iqdb] [saucenao] [google]
1792771

>>1792681
automatic life support equipment, by definition and design, interacts with and supports the functionality of another apparatus that is of high value but currently malfunctioning. the equipment has to compensate for errors and intermittencies throughout the connected system while minimizing further damage to the other apparatus
I'm not a respiratory therapist so I can't speak with professional weight on what it takes to hook someone up to one of these things and what sorts of parameters one might configure or are automatically configured by rule, so I'm using a simple model of inflating and deflating a machine of like type but varying/uncertain size and poor condition, not especially considering lung physiology

>> No.1792806
File: 142 KB, 1280x960, photo_2020-04-04_23-45-14.jpg [View same] [iqdb] [saucenao] [google]
1792806

I'm making a temperature controller for my heating mantle (basically just a hot plate) and was wondering if it's possible to lower the PWM frequency, I would like 50% on the potentiometer to be 0.5 sec off 0.5 sec on, 25% to be 0.25 sec on 0.75sec off, 100% to be solid on.
The arduino is controlling a solid state relay on pin 9 and the potentiometer is hooked to pin 0.
AnalogInOutSerial example in the IDE seems to be exactly what I need other than the fact that it switches too quickly.

Is there a way to lower the frequency at which the PWM switches on and off, a much coarser duty cycle than the stock one, like 1hz, vs the 490hz of the stock PWM.

>> No.1792810

>>1792806
Did you google it? Why do you want it so low anyhow? I'd think 10Hz or so is as low as I'd want it.

>> No.1792811

>>1792806
you know you don't have to use the arduino's analogwrite in order to pwm, right? you can just use digitalwrite with a variable delay between high and low.

>> No.1792814

>>1792811
He's not using analogwrite, hes using analog read for the potentiometer

>> No.1792816
File: 2.41 MB, 478x524, video_2020-04-05_00-52-06.webm [View same] [iqdb] [saucenao] [google]
1792816

>>1792810
I'm mimicking the actual commercial unit which sells for like 500 dollars to control heating mantles, I have one on my hot plate but I wanted a similar thing for my heating mantle.
Here, I made a webm of my hot plate that I'm trying to replicate.

>> No.1792819

>>1792814
analogwrite is how you do pwm on an arduino

>>1792816
to be honest i'd just use a single dual-comparator IC instead of an arduino

>> No.1792838

>>1792819
but you're not thinking ahead to what's on that plate. could be something that must be brought up to temperature over a long period of time, or something that might go exothermic and needs to be stopped before it runs away. or imagine automating fractional distillation and the collection of contents in flasks on a lazy susan

>> No.1792844

>>1792838
>brought up to temperature over a long period of time
oh yeah for that i'd use an mcu, though potentially a second capacitor ramp that's robust enough over long times could work in a pinch

i'd think you'd want a pid controller in there for temp feedback as opposed to dumb duty-cycle modulation tho

>> No.1792851
File: 129 KB, 1280x960, photo_2020-04-05_02-51-48.jpg [View same] [iqdb] [saucenao] [google]
1792851

>>1792844
I actually already have a PID one, I wanted a dumb duty cycle based one because I don't wanna always have to or I can't always get a thermocouple into what I'm heating.
I figured out the coding to get the duty cycle based heater working btw.

>> No.1792857

>>1792851
Oh neat. Makes me wonder if there are PIDs that work off a PIR optical thermometer. Just point the thing at your workpiece and press go.

>> No.1792861

>>1792851
neat
now you can expand this duino-based unit and do both. add a little OLED display if you feel like it, maybe a rotary encoder for the knob. blue ground effects. pimp it

>> No.1792883

>>1787808
let's see your circuit

>> No.1792995

Hey what's up thread?

Does anyone have some awesome projects to post that have instructions and part lists??

Maybe like a infographic style ?

I have access to a ton of arduino supplies, raspberry pis and a beaglebone black!

>> No.1793013
File: 33 KB, 500x500, s-l500.jpg [View same] [iqdb] [saucenao] [google]
1793013

Ok I need some hand holding. I am trying to make a DIY drone with an HD camera to stream at at least 1080P60fps video all for under 40 bucks (the camera). Drone cameras with this type of resolution are prohibitively expensive starting at 300 bucks and the cheapest out of the box alternative is something like the YI 4k+ which is a chinese gopro clone starting at 100 bucks. The raspberry pi's supported camera is an 8 MP is nowhere near good to stream HD video at 60 fps

Anyways correct me if I am being naive but is it feasible to be able to homebrew your own go pro clone from spare go pro parts? such that you would only need to buy the CCD (20 bucks on ebay) and the image processor (dirt cheap) to cut out the bulk of the cost? Ive researched it a bit and while it is technically feasible, I could not for the life of me find any open documentation in the ccd (its a sony Exmor IMX sensor) or the image processing sensor (Ambarella). They arent available from digikey and the search engines arent returning anything. I know its possible but I just lack the know how of what image processor and CCD with proper documentation and tools I could use to build it. Can anyone shed some light please

>> No.1793022

>>1793013
other things you to account:
>codec to output the video
>the average size per second of video
>a wireless technology that supports this network throughput
>energy consumption at that throughput

not to sound pesimistic but 1080p60fps seems unfeasible with "cheap" technologies

>> No.1793025

>>1793022
will be wired real time streaming. 3/4 of those considerations go out the window

>> No.1793099

>>1792861
Yeah, I would probably buy another case and just make another one for that, I need this one I just make to use ASAP, the pimped one will have to be a slow side project.
It would probably work better than that shitty ebay PID in my box too kek, those things have terrible reviews, I don't even think it's a true PID just an on/off thing that has a thermocouple.

>> No.1793130

>>1792657
>you'd want hardware multiplication and division
AVR has hardware multiply and fractional multiply hardware though. Each multiply instruction only takes two cycles.
I don't know what you mean about timers either.
The AVR line is hardly a slouch when it comes to timers.

>> No.1793163

>>1793130
it's only 8x8=16 though
you will probably want a proper division instruction for smooth ac/deceleration, since period = 1/frequency and your timers usually want frequency. the needed pulse rate for the short axis of eg long paths just off one axis might be larger than the timer can handle. not insurmountable but needs to be handled
also there's lots of trig in the daily life of a multi-axis CNC controller whose commands consist of "move tool to x,y,z at the rate of r". where is the tool now, how far away is x,y,z, how often to send step pulses on each axis to get there at the given rate, all considering the acceleration limits of the machine
phase accumulators would make a fun excuse to slip a smol FPGA into the design as an SPI peripheral or external bus device. would not try to insert a G-code interpreter into the FPGA however, mostly just too lazy

>> No.1793274

I've got a Raspberry Pi / general filesystem system question.
>put raspbian on a 32GB SD card
>works fine
>make an image of it and burn to a 256GB SD card
>256GB SD card still only has ~32GB of storage partitioned with a ton of free space, but still works fine
>use fdisk to delete the storage partition, create a new primary partition with the same start sector and the end sector being the last one on the drive
>try to reboot
>seems like it doesn't boot; activity LED never lights up and the pi doesn't show up on the network

fdisk output at https://pastebin.com/jDX0D0GL

What do?

>> No.1793298

>>1793274
>>use fdisk to delete the storage partition, create a new primary partition with the same start sector and the end sector being the last one on the drive
Why don't you just use "Resize partition"?

>> No.1793334

>>1793163
>phase accumulators would make a fun excuse to slip a smol FPGA into the design as an SPI peripheral or external bus device. would not try to insert a G-code interpreter into the FPGA however, mostly just too lazy
so basically linuxcnc/machinekit with hostmot2

>> No.1793376
File: 3 KB, 125x124, 1554747038922.jpg [View same] [iqdb] [saucenao] [google]
1793376

>>1793334
yeah, something like that. you could fit quite a few stepper counters/controllers into this smol boi, if you use the block RAM creatively and use '595 shift regs as output expanders https://www.digikey.com/product-detail/en/lattice-semiconductor-corporation/ICE5LP1K-SG48ITR/220-2155-6-ND/
quadrature decoders, too, but STM32 chips tend to have a handful of those already

>>1793274
maybe it needs to be marked as bootable
Armbian comes with a first-run script to resize the linux partition to the full media size automatically, maybe look there for hints

>> No.1793465

>>1792325
Looks like a meme to me

>> No.1793659

>>1792325
You can buy a really good logic analyser for $7.

>> No.1793760

>>1793376
1100 logic units thats sweet fuck all, normal hostmot2 takes around 9000, and even modified machinekit hm2 still takes around 4000

>> No.1793785
File: 97 KB, 960x1280, wall.jpg [View same] [iqdb] [saucenao] [google]
1793785

> remember some threads ago somebody asked about putting an AVR inside his wall
> Well i tried kinda that but on an ESP12

Controlling the light of my room from my cellphone.

>> No.1793800

>>1793760
haven't looked into hostmot2 deeply, I presume they instantiate separate controlling modules for each motor and are also handling acceleration/deceleration in the hardware, and may be doing less common calculations in logic at blazing speeds. I also wonder if they aren't parsing G-code on the FPGA
but that's where the power of a nano-sized instruction processor comes in: you could instead use a single multiply-accumulator, a pseudo-dual-port RAM, and other processing logic. assuming 3 instructions per update pass (load rate, add to counter, copy bits to driver output), an unmultiplied 25MHz clock can provide a 333kHz output update rate, which is enough for 166k steps/second. a simple processor like this could easily be made to run at 66MHz on most FPGA archs
I don't know if this architecture can be made to process curves well without adding trig instructions and making the "program" that much longer. might be able to add rudimentary ac/deceleration with 1-2 instructions and some planning help from the host

>> No.1793821

>>1793800
as far as i can tell linuxcnc still handles the gcode and trajectory planning which would seem to include the accel/decel, as they seem tied together, with hm2 handling the step generating/pwn for servos, encoder feedback and i/o
http://linuxcnc.org/docs/devel/html/drivers/hostmot2.html
https://github.com/LinuxCNC/hostmot2-firmware
https://github.com/machinekit/mksocfpga
but ill be honest, i havent looked too deeply into nonlinuxcnc fpga cnc projects,
https://github.com/mhouse1/mechsoftronic

>> No.1793954

>>1793785
that seems like a lot of components for just a remote light control
would be probably cheaper to just buy a wifi outlet from chinks for $8 that is fully enclosed and very small and just just run two wires in and two out. you can even upload custom sketch on them.
Also i think it would look much better if you made a pcb instead of using doing that perfboard frankenstein, dupont connectors are for prototyping, you should not stick your breadboard stuff inside a wall to stay there forever

>> No.1793974

Does a 360 degree servo exist? I want to make a clock.

>> No.1793978

>>1793974

yeah, it's called a stepper motor

>> No.1793979

>>1793974
They should do, ones that use an optical or magnetic encoder instead of a potentiometer.

>>1793978
They're a pain to drive for what should otherwise be a simple project.

>> No.1793989

>>1793979
So would something like this do?
https://www.amazon.com/Feetech-Digital-Degree-Continuous-Rotation/dp/B07H971F6J/ref=sr_1_3?dchild=1&keywords=360+degree+servo&qid=1586255541&sr=8-3
or would i need a more lord one

>> No.1793990

>>1793989
They're probably fine, but I'd go for a more directly digital one, where you've got the encoder output directly feeding into your MCU and using the MCU in order to send the appropriate signals to the motor itself. I'm assuming what you posted is an analog servo where you just feed the input a PWM duty-cycle or a DC voltage, which is potentially inaccurate, especially for when you need to be significantly more precise than 6°.

>> No.1793991

>>1793989
>>1793990
Oh but read the specsheet over my speculations. Or ask /ohm/.

>> No.1794032

>>1793954
>would be probably cheaper to just buy a wifi outlet from chinks
>/diy/

>> No.1794033

>>1784995
I built a data packet handler with a bang bang phase detector and sync word detection for 9600 baud with pic12f1822.I use it with a cheap fsk transciever to control my house alarm.
I wanna add some FEC but idk much about it.Is there anyone working on something similar and who knows how to implement FEC?

>> No.1794184

>>1794032
/diy/scretion is the better part of valor

>> No.1794187

Trying to pull my solar grid offline.
Looking for a transformer that can take around 600V DC and drop it down to something useful, either 240V AC or 12-48V DC.
Anyone know something that won’t burn my fucking house down?

>> No.1794188

>>1794187
Ignore that, I’m a dumbfuck.
What I want is a 600v charge controller for some batteries, then just an inverter to bring those batteries up to whatever the fuck I want.

>> No.1794199

>>1794184
True

>> No.1794204
File: 40 KB, 960x1280, WhatsApp Image 2020-04-07 at 16.06.14.jpg [View same] [iqdb] [saucenao] [google]
1794204

>>1794184
Now is hidden behind the switch

>> No.1794206

>>1794188
This shit seems to be exactly what I want, but it only goes up to 3kW.
Need something to support a 6.6kW array. Alibaba charge controllers scare me

>> No.1794207
File: 281 KB, 828x953, D23B312A-56F1-436B-BEDD-89199A8A703E.jpg [View same] [iqdb] [saucenao] [google]
1794207

>>1794206
4got pic

>> No.1794210

>>1794206
as long as the array's open-circuit voltage is lower than what the inverter/charger is designed to withstand, you could limit yourself to drawing 3kW from it (and what are those 5kW options)

>> No.1794227

>>1794206
>6.6kW
For what?

>> No.1794250

>>1794227
(((middle-class))) consumption is hard work

>> No.1794471

>>1794032
>/diy/
a true diyer knows the value of his time and doesn't waste it on dying things that can be purchased for cheaper and fully functioning and instead uses his time to diy things that cannot be purchased or are too expesive so dying them cheaper is worth it
until you realize this you will be just another wannabee diy pleb

>> No.1794479

>>1794227
you kidding right? if you run only 3 electric water kettles at the same time that is already 6kW by itself

>> No.1794497

>>1794471
A wifi outlet is pretty easy to make though.

If you look at the image, it's just some generic 5v SMPS, a relay module, and an ESP (and I'm guessing a 3.3v regulator is hiding somewhere).

It's not a good idea to squish it all into the wall, though.

>> No.1794519

>>1794497
Yeah but the enclosure and everything will still be more expensive than a proper wifi outlet. Especially if you want to use a latching relay, which you should.

>> No.1795040

Anyone know if those car FM audio senders are stereo or mono? I want to make a small pen-size FM radio that uses the headphone cable as the antenna (hopefully using my RDA5807M module). Ideally, I'd connect an FM audio sender to my computer, and send signals back to it on some other RF band using OOK with my headphones' inline control button, or a button on the pen radio that does the same thing. It would probably be longer range than bluetooth, and have the advantage of being able to tune in to any FM frequency even when I'm not at home with my computer. Be latency-free too, assuming audio quality doesn't matter too much. The audio sender would probably plug into my computer's TRRS socket and maybe also USB for power, else an external barrel jack if I need more than 10W.

Recommendations on what RF link to use to get a signal back to the computer dongle would be nice. I want it to be as low power as reasonably possible, so maybe direct OOK modulation of the button presses isn't ideal. But still having it be a longer range as the radio sender itself is important too. No room for an external antenna unless it can share the headphone cable.

I also need to figure out the control scheme and display setup on the radio pen itself. I feel an OLED would use too much power and be kinda hard to incorporate into the housing, but 7-segment displays would be hard to fit too, at least without doing them on the internal PCB with lightpipes to the housing. For controls I'd want a rotary encoder or two that's just a ring around the pen itself, with detents and optical quadrature sensors on the internal PCB. But that complicates the construction greatly.

>> No.1795418
File: 740 KB, 2067x720, PIC.png [View same] [iqdb] [saucenao] [google]
1795418

Hi /mcg/
I want to stop using bang-bang controllers for SMPS. I want a custom controller with PIC micro. I have two types of chip PIC32MX250F128B (chipKIT DP32 dev board) and PIC16F1619 (Curiosity Dev board). I also have PICkit3. Now I know almost nothing about PIC programming. I took an MCU class where we used some old version of MPLAB and programmed a 40-pin PIC16 in assembly. Now I barely knew what I was doing in that class. The chipKIT DP32 board has mpide which allows you to program PIC like arduino but here I am trying to do commands like PORTB 0b00000001 where on chipKIT DP32 you have to do like PORTB.bits(A2) = HIGH to do the same thing. It's fucking weird and I hate it. Even with assembler though I don't really know difference between PORT, TRIS, and LAT and how to set regisiters and stuff. In general my programming knowledge of anything is REALLY bad and most help resources assume some level of programming knowledge which I don't have or it's so fragmented its useless or even counterproductive. MPLABX is too confusing. I learned in assembly and it tries to force you to use C++ and I don't know what options to pick to even set up the device nor do I know any syntax to put in to make code run. The datasheets for PICs assume you know about programming as well and I find them too hard to read. I need a lot of help. What are good COMPREHENSIVE PIC programming guides that will make you a skilled programmer from total retard.

Anyway I want to implment a quasi-resonant mode controller with current and voltage mode control using PID and feed forward control. Please don't recommend me use code libraries. a.) I don't know where to find these libraries and how to install them. I've tried many times to use libraries and I can just never get them to work. b.) Libraries are often poorly documented and always seem to assume you're a competent programmer that can figure them out. c.) you don't learn anything by constantly using pre-made libraries as a crutch

>> No.1795446

>>1795418
First of all, what are the input and output specs of your SMPS? Are you able to use the ADC for the feedback, with or without a voltage divider? Do you understand the operating mechanics of such a converter topology? I'd start out by drawing out a timing diagram of some sort in order to figure out what your MCU will be reacting to, what it will subsequently be doing, and in what order.

For the language, I'd say suck it up and learn C or C++ or whatever. It's ubiquitous enough for AVRs and other MCUs that I'd say it's worth doing. Though last I tried PICs I did so in BASIC, which is possibly something you'd enjoy more.

>> No.1795454

>>1795446
12V in 200V out 40W. Multistage design. Boost converter first stage and full bridge topology for the second. MCU doesn't need to be a gate driver and it can't source and sink enough current for that anyway. I have a IRS2104 for that.

>hough last I tried PICs I did so in BASIC, which is possibly something you'd enjoy more
You know what, when I took that class I think we were programming in BASIC, in fact I know we were because all the files were .bas as well as .cof and .hex files and stuff. BASIC would be greater but I'm not sure MPLABX supports it.

>> No.1795458

>>1795454
>MPLABX
Why bother with that? There are plenty of IDEs out there if you look hard enough. Or even just use a text editor with syntax highlighting (like notepad++) for your language of choice, and do all the uploading and technical stuff (fuses, programming method, etc.) in whatever a PIC's alternative for AVRdude is. Could even probably program it relatively easily with an arduino as a USB programmer, so long as you program the arduino itself to output the right format.

>> No.1795459

>>1795458
I didn't know there were alternative IDEs for PIC. I have notepad++ but I don't know how to use it to compile and upload to an MCU and it doesn't have any debugging features which makes it a bit too limited. The PIC BASIC Pro compiler is still around and being updated, it looks like what I used in school. I think it requires old MPLAB 8 but it might be worth getting if I can use it. It's what I'm most familiar with even if only barely.

>> No.1795556

>>1795459
PIC32 isn't even PIC, it's MIPS.

>> No.1795765

>>1795556
I don't know what the difference is.

>> No.1796075

Anyone have any experience with avrdude on linux? I have a ATtiny85 connected through an Arduino setup as an ISP programmer.

On Windows:
>avrdude -P COM3 -c arduino -b 19200 -p t85 -v -F
returns fine and everything is happy. I can read/write fuses and flash programs no problem.

On Linux:
>avrdude -P /dev/ttyACM0 -c arduino -b 19200 -p t85 -v -F
returns:
>avrdude: stk500_initialize(): (b) protocol error, expect=0x10, resp=0x01
>avrdude: initialization failed, rc=-1

If I change the baud rate to 115200 I get an m328p signature returned, which is the Arduino programmer itself. Anyone know what I have to do to get Linux to use the programmer as a programmer and actually see the target?

>> No.1796081

>>1795459
I'm not sure there is an open source alternative for PIC. As far as I know, part of the appeal of AVR, was the availability of open tools where there was none for PIC.
Things may have changed in the years since I dealt with PIC, or maybe it was always around just not popular.

>> No.1796090

>>1796081
PIC is more popular in professional settings and I'm looking to both gain skills for my professional development as well the ability to use the micro in my own hobbyist level projects. Pick fulfills both requirements. I don't really care if the software is open source or not. So long as I don't have to shell out hundreds of dollars yearly for a license it's no issue. My only issue is the beginner resources leave a lot to be desired.

>> No.1796111

>>1796075
>If I change the baud rate to 115200 I get an m328p signature returned, which is the Arduino programmer itself
Pretty sure that means your arduino is receiving data it shouldn't be. Do you have the capacitor on its reset pin?

>> No.1796131

>>1792681
Oh yes, that's why this whole "backyard medical devices" thing is such an interesting topic. Making an "automatic bag squeezer" might be relatively simple, but a ventilator is most definitely not an automatic bag squeezer.

Now, i'm just going to tell you what I know about the subject, which is not much, as I have only been reading about this for a couple days, but in short it kinda goes like this:
giving the lungs different pressures can really fuck them up if you exceed the limits, and barotrauma can easily kill a person. Because of that, in order to make any automatic ventilation, no matter how basic your system is, you NEED to monitor pressure. you can't just give it a "regular obligatory breathing" and call it a day. Now your system gets more complex, and that's just to add an upper limit to the pressure and say "stop before you burst everything".
Now you have the most barebones of the ""ventilators"", but here is the thing. Forced breathing is a horrifying experience and is most definitely not for the long term pacient, these "volume control" systems (pump at a regular rate and don't exceed the upper pressure limit) can only work on sedated patients, because it's horrible. but you only want to sedate the most critical of your patients, because that is a procedure that should only be done when absolutely needed. but those patients should be at the top of the list and given the real ventilators. so suddendly you find yourself with a device with a function all over the place.
And now is when you finally get to the assisted control systems, the place when you can really start talking about when a makeshift bag squeezer actually get cool enough so you can imagine them as being useful, one small step above "do or die" situation. but here is when you start to implement more complex math (and probably when the arduino cannot keep up anymore).

>> No.1796132

>>1796131
and all this is only the electronics, probably the easiest part of the challenge. I can't even imagine how mechanical engineers and designers are feeling when people theorize backyard ventilators.

Of course, people only want to help and they are giving their time (and money because of that) on trying to do good for humanity and that is awesome.

>> No.1796183

>>1796111
Negative on the capacitor. I will do that today.

Strange how Windows doesn't need the capacitor buy Linux does. Wouldn't have guessed the difference in drivers or whatever would have an effect like that.

>> No.1796185

>>1796090
If you're looking for professional marketable skills then, learn C and learn MPLABX. Better yet skip the PIC and get an STM32 discovery board and do that instead. The ARM stuff has better alternative IDE options and is likely the future anyways.
If you want to know how the guts work (text editor + terminal) then pick up some cheap AVRs, download WINAVR, and go to battle. AVRs are more popular in the maker space and have better tutorials and better non-IDE tools. Although you can also use MPLABX with most of them.

>> No.1796274

>>1796111
>>1796183
Capacitor appears to work.
Looks like Windows either can not or does not use the DTR signal which is somehow hoked up to Reset. The Cap solves the issue on Linux. Thanks.

>> No.1797227

konbanwa lads

ive been having klicking issues on my logitech mouse for a couple days now.
So ive read this happens due to the switch forming an oxide layer that the weak current of 10µA cant wear down. Mouse utilities an STM32F102 with an approx pullup of 40k
a nigger tier fix would be to hook up a 3.3k external pullup to up the switch current.
Can the stm32 handle ~1mA sink or will i fry it?
can i hook up even more than 1mA?

>> No.1798860
File: 3.60 MB, 2805x2173, 27205344.jpg [View same] [iqdb] [saucenao] [google]
1798860

>Wrote program to randomly move the mouse constantly on pro micro
>Can't upload anything else because I can't control the mouse while it's plugged in

>> No.1799095

>>1798860
windows lets you operate two mice at once. just randomly move it one pixel every 10 seconds or whatever.

>> No.1799595
File: 32 KB, 399x600, STLINK-V3MODS_t.jpg [View same] [iqdb] [saucenao] [google]
1799595

Ooh, shiny... eight dollars and twenty five cents.
https://www.st.com/en/development-tools/stlink-v3mods.html

>> No.1799660
File: 1.01 MB, 1000x597, file.png [View same] [iqdb] [saucenao] [google]
1799660

I want to make something with about 15m of leds, witch ones should I get?
WS2812B? WS2811? 5050?
What's the difference?

>> No.1799688

>>1799660
https://www.instyleled.co.uk/support/what-are-the-differences-between-types-of-led-chip/

>> No.1799690

>>1799688
thanks

>> No.1799768
File: 52 KB, 518x480, Espressif_ESP32_Function_Block_Diagram.png [View same] [iqdb] [saucenao] [google]
1799768

I'm currently working in a field that doesn't make me use microcontrollers directly, however when my contract will be over I would like to start going in that direction with my career. I don't have any official working experience with microcontrollers, but I have been working with them as a hobby for years, and recently I started really looking into being very proficient with STM32 micros and with the ESP32.
I know the STM is widely used in industry and control, whereas the esp32 is still kind of exotic and not vastly used even in the iot field, but I think the latter could be a better showcase of one capability with embedded software (rtos, dual core, more protocol/stacks to learn, etc..)

Considering however that I have a limited amount of time to dedicate to both, if I had to concentrate mainly on one type of micros, what do you guys think would be better in terms of employability?

>> No.1800019

>>1798860
holy kek

>> No.1800036

>>1786308
EEPROM will get cheaper soon, so buy the old retro stuff fast

>>1787196
write a VHDL in C that transpiles to Perl (add dependent types to bootstrap your own pattern-matching Ada) binds on the circuit pars and configurations you understand, like the terminals and so forth

>> No.1800037

>>1786308
>hard electrical environment
bro just cake everything in silicon oxide paste and potash

>> No.1801000

Any good resources to teach myself ESP32 w/ ESP-IDF ? Something with lots of practical examples.
Previously was mostly using it via AT commands with no issues, now trying esp-idf , get it running no problems with basic controls, some peripherals etc but espressif API is not very friendly to newcomers

>>1797227
What mouse do you have? Generally this is more of an issue with mechanical wear of mouse buttons than oxide layers forming.

Anyways - for STM32 you can hook up to 20mA or a bit more without any issues but you also have to consider total current consumption for chip from other peripherals and absolute max current for specific package.

>> No.1801036

>>1801000
esp32.net
look at the examples that ship with the IDF, they're admittedly not very user friendly but they can get you up to speed after a while. The documented API isn't that bad either, sometimes there are weird design choices that give a sense of inconcistency but all in all it ain't that bad. To be honest, while being a very powerful and interesting soc, most projects based on it are reddit-tier trackers and ifttt-controlled leds, so aside from the vary basics, online resources that cover it in its entirety are relatively scarce (which is not a bad thing - more focused resources, less background noise)

>> No.1801165

>>1801000
>What mouse do you have?
g501 but ive had lots of mice die on me like that
apparently the issue is called wetting current but Logitech decided to run these parts 100% outside of spec

>> No.1802150 [DELETED] 

>>1784995
Can a computer science major become an embedded systems engineer? Can a computer science B.Sc do an M.Sc or Ph.D in computer engineering?

>> No.1802984

I wanna make an stm32 based watch but i want it to have wifi and be a qfp.
How do? Is there a wifi module that's the size of my dick?
If I have to go with an esp12 I'll just ditch the stm.
stm32wb is only qfn/bga.

>> No.1802998

>>1802984
Have you considered an ESP-01?

>> No.1802999
File: 195 KB, 612x614, file.png [View same] [iqdb] [saucenao] [google]
1802999

>>1802998
still too big
I want the final board to be the size of one of these tiny oled display modules

>> No.1803029

>>1802984
>watch
>i want it to have wifi
Where will you put the battery?
On your belt?

>> No.1803030

>>1803029
next to the display or under the strap

>> No.1803060
File: 109 KB, 994x620, 717I5FkfE5L._AC_SL1000_.jpg [View same] [iqdb] [saucenao] [google]
1803060

ohayou /mcg/, I asked on /g/ and got some useful info, but I'm still not certain so I'll ask again here. I want to make a Linux e-reader similar to https://github.com/joeycastillo/The-Open-Book but more powerful. What I've learned from /g/ is that a good method for someone who's never done PCB design is to do prototyping for the software (e-ink screen driver, etc...) on a dev board then copying the design of the dev board as closely as possible for the PCB sketch.
So with that info and a little research I figured I'd buy the pocketbeagle, the e-ink display and start writing an i2c framebuffer driver for it. Does the pocketbeagle seem like a good choice for my application? Is this a good way to get started?

>> No.1803168

>>1803060
Something to keep in mind is that the project you linked to uses a microcontroller, while the beaglebone uses a full-on micro/processor/. The former are intended to be programmed bare-metal and will be easier to use on your own PCB, while the latter are intended to run an OS like Linux.
With that said, the line can get blurry- the pocketbeagle's SoC integrates RAM etc into one package just like MCUs traditionally do, and you can get very fast MCUs that get very close to microprocessor territory (e.g. look at the chip used by the Teensy 4).
When you say "more powerful", what does that mean exactly? Do you intend to run Linux on your device?

>> No.1803177

>>1803168
Yes, the intent is to run Linux on it to make it a real Kindle alternative for myself. Which is why I mentioned writing an i2c framebuffer driver for x11. The thing I'm still not sure about being a noob is if the pocketbeagle is enough for my needs. The screen will run over i2c, I have seen people add wifi using usb, and I might be making a custom keyboard PCB for it down the line, would it be enough ?

>> No.1803190

>>1803168
The Pocketbeagle's OMAP SoC has PRUs which are basically extra microcontrollers for bare-metal real-time stuff.

>> No.1803219

>>1803168
a microcontroller is a microprocessor with extra stuff.

>> No.1803324

>>1803219
Kinda sorta.
Microcontrollers typically have more peripherals like timers, GPIO, I2C, SPI, and UART, but the one thing they usually lack that a microprocessor has is a MMU.
Linux really needs a MMU to run properly.

Also, it's somewhat rare for microcontrollers to have an external memory interface, and even rarer for them to be able to execute from external memory.

>> No.1803326

>>1803190
>>1803219
>>1803324
it would be nice if you knowledgeable gentlemen would answer the original questions >>1803177 >>1803060

>> No.1803404

>>1803326
youre gonna have to better define "enough for my needs". some i2c periph + scanning kbd matrix, most probably.

from the docs:
https://github.com/beagleboard/pocketbeagle/blob/master/docs/PocketBeagle_Short_Spec.pdf
https://raw.githubusercontent.com/beagleboard/pocketbeagle/master/docs/PocketBeagle_pinout.png

Looking at it, there are two I2C peripherals available straight off the bat. Now I2C is not a difficult peripheral to bit-bang (emulate in software), especially with such a powerful cpu available. So even if there were no hard-set I2C periphs, you can always emulate them with GPIO.

Notice both I2C periphs can also be configured as CAN bus periphs, but not both at the same time. thats what it means when you ahve multiple protocols on the same row in the pinout diagram.

Now I2C is rather slow. typical speeds are 100kbaud = approx 12kbyte/sec. i guess if black/white single-bit-per-pixel packed data for 200x600 display (guessing) = 120000 bits = 15kbyte, so ~1.2 secs to fill screen. maybe can crank up i2c clock, depends on how good is i2c signal.

maybe look into SPI and its parallel variants, Q(uad)SPI, etc. that is better suited to bulk transfers. often bulk-data peripherals like flash chips can speak multiple protocols, some faster than others. maybe eink display has ability to do that.

or maybe youre happy with i2c transfer speed in your app, in which case the above is irrelevant.

also, alongside eink maybe buy a trivial temp sensor i2c gizmo, just to get feet wet and have something to sanity check your wiring. if eink isnt talking, maybe eink, maybe wiring, software, maybe pocketbeagle broken. if tempssensor isnt talking... most probably your wiring/software. if tempsensor works and eink doesnt, probably some config register in eink not set right, etc. just helps isolate problems.

>> No.1803411

>>1803404
thanks for the reply, I am indeed not familiar with i2c and that's exactly the kind of info I was looking for
>100kbaud = approx 12kbyte/sec
the page on i2c for the beagle says one pin can be programmed to 2.2MHz, isn't that much more than 100kbaud?
Sounds weird to be that every single e-ink display I've seen is i2c, would make no sense if the refresh is that slow, that's unusable. Say i2c is too slow, what kinds of other technologies can I use for displays?
>alongside eink maybe buy a trivial temp sensor
good advice! I'll do just that

>> No.1803423

>>1803411
if thats all thats available, then nothing to debate i suppose. i am not versed with the eink market so cannot provide alternatives.

if you have any links to einks, post em.

2.2mhz, speed-wise it may be fine. but i2c uses open-drain signals, which is to say it can drive it low but can't drive it high. what drives it high is a pullup resistor. at high freqs the signal will take noticeable time to return back to high voltage due to RC constant. there are lots of "i2c calculators" out there, but the higher freq you go the lower the pull up resistor value has to be. at 1kohm, with 3.3v, youre gonna be spending 3.3mA. at 2.2mhz maybe lower still. so 5mA just to maintain i2c connection will have battery impact, but then einks are persistent so maybe you can just switch it off without glitching the display.

scope will be handy here to look at what the signal looks like and pick a good value, or just keep increasing the frequency until things start glitching, then tone it back.

>> No.1803440

>>1803423
thanks again, I hadn't even thought of power consumption for the i2c, it's is true that with the low resistor values it will start to be significant. Here's the display I was thinking of buying : https://www.waveshare.com/7.5inch-e-paper-hat.htm
>scope will be handy here to look at what the signal
I have a dual trace 100MHz analog scope, should be enough for i2c but I won't be able to debug any high speed signals

Since you seem to know what you're talking about I wanna ask about the next steps. Say I write a functional driver for the display and the software functions as intended on the dev board, the next step would be reproducing whatever components I need in the closest possible configuration to the devboard on a PCB, correct?

>> No.1803456
File: 232 KB, 1222x955, pocketbeagle.png [View same] [iqdb] [saucenao] [google]
1803456

>>1803440
I suppose so. Looking at the layout, its 4 layer not too dense design. so you can just lift it from the original design onto your own pcb, keeping virtually all the trace routing identical except where your connections will be. chip is reasonably available at first glance: https://www.mouser.co.uk/ProductDetail/Octavo-Systems/OSD3358-512M-BAS?qs=l%2FgYmo23PNND%2FVQo4YI05A==

but you will have to think about how youre gonna add the battery, in terms of charging it over usb, etc. there are off the shelf lithium ion battery charge controllers that handle usb charging for you but will need to be evaluated (there are thousands) and integrated. ive never used them.

here i dont know what im talking about, so i would make it a separate project, a lithium battery that drives a fan and becomes a little discharged. then you plug it into usb and test out the monolithic battery charge circuit, ensuring that it does the sane constant current then constant voltage charging curve, and have a micro alongside, sampling the voltage over ADC. that will also be useful to get a practical discharge vs voltage curve for accurate batt status reporting.

that display you linked, unless i am misreading something, is SPI, not I2C.
https://www.waveshare.com/wiki/7.5inch_e-Paper_HAT

>> No.1803464

>>1803456
my fucking god your posts are so fucking helpful, all I have are vague ideas from shit read here and there and you're giving me assurance
I am leaving the battery aspect of it for later, I know I'll have to come up with charging circuitry but I'm hoping that it's generic enough that I won't have too much trouble.

Sorry about the display, I got confused, will SPI be more adequate? I've seen a few examples such as https://elinux.org/images/1/19/Passing_Time_With_SPI_Framebuffer_Driver.pdf that indicate that I should be able to do the same for my dispay.

I have a question regarding the expansion capabilities of the pocketbeagle, would the 5 pins assigned to usb be able to take multiple usb devices if I made a hub sort of circuit, so you have an idea of how that would work? Networking is already going to be over usb and I'm not sure if I'd need something else.

also why's the fucking SoC 4x as expensive as the entire beagle, that's annoying.

>> No.1803466

>>1803411
>pin can be programmed to 2.2MHz
That has to do with the signal quality of the pin itself, not the I2C unit. I2C is usually 100Kbps normal speed and 400Kbps high speed (not supported by everything)

>> No.1803472

>>1803464
its quite a special snowflake part, highly integrated. I suppose theyre saving you the trouble of dram+routing, various auxiliarly micros, and they know it. so the price goes up. plus one-off quantities (read: less than 10000) are always expensive, to cover logistical overhead.

the usb peripheral is backed by the linux usb stack. i can't imagine its any different to a bog-standard usb pin header on say a desktop motherboard. if you want usb hub functionality, you'll have to obtain a separate usb hub controller ic and wire it up. straightforward, but i want to make clear that one can't play clever tricks like bundling up all DP+ and DP- signals into one.

https://www.mouser.co.uk/Semiconductors/Interface-ICs/USB-Interface-IC/_/N-45lw3?P=1yx0p2iZ1yzudq8

>>1803464
spi tends to have higher datarates, up to 10s of mbit range. it also has benefit of being extremely braindead simple protocol (if you can call a shift register a "protocol"). either is fine if it meets your bandwidth (and eink device) requirements.

>> No.1803473

>>1803472
All right, I think I get enough to buy the beagle and display and start writing the driver. Thanks a ton for the help, if you could give me a way to contact you without doxxing yourself it would be really nice. I won't annoy you much, just to avoid running into walls since you seem seasoned. This is my first time on this board since I checked it out at its inception and I have to say, friendship ended with /g/, /diy/ is my new best friend.

>> No.1803480

>>1803473
you already have it, from the /g/ thread (milkman...). you can just post any problems here just as well though. i check mcg often.

>> No.1803704
File: 176 KB, 794x709, DEBO_RELAIS_2CH_02.png [View same] [iqdb] [saucenao] [google]
1803704

hey guys,
I need your help.
I have no clue about raspberrys or electronics pretty much.

I need to trigger two leds with a raspberry.
I thought I would use relais for this.

are these suitable ?
how would I hook them up to the gpio of the raspberry ?
female / male jumper cable into those black ports ?


https://www.reichelt.de/entwicklerboards-relais-modul-2-channel-5-v-srd-05vdc-sl-c-debo-relais-2ch-p242810.html?&trstct=pos_3&nbc=1

>> No.1803708

>>1803704

Trigger them in what situation?

What is the raspberry for in this context?

>> No.1803722

>>1803708

it's a really simple situation.
the raspberry is connected to a sensor and counts objects.

if the value for the counted objects is below a threshold a green led will shine, if the value crossed the threshold, the green led will stop shining and a red led will shine

>> No.1803723

>>1803722

the leds need a decent brightness so I would run something like gu10 led bulbs hooked up to a powersource instead of a small led connected to the raspberry.

the two led bulbs would run through one relais each so I could switch the externaly powered led on and off via the raspberry

>> No.1803724

>>1803704
rpi (and most digital shit) sends out a 5V "on" signal. Just put the led in series with a 1k resistor from pin to ground.
Worst case, you'd need a schmitt trigger current buffer, but I find that unlikely. Relays are mad overkill

>> No.1803891

>>1803724
did you miss this?
>>1803723

gu10s are 50W bulbs. you aren't running that from a GPIO.

>> No.1803968

>>1798860
Kek
Next time have a trigger to enable/disable it on a keypress

>> No.1804608

>>1803704
Because I'm not sure you were happy with the answers you got, they are perfectly suitable, just a bit of a weird choice. And yes they can be controlled with them easily. Regarding how to hook them up, you are ordering from Reichelt, so I assume you speak german, and under the datasheet section ("datenblätter") there's detailed instructions.

>> No.1804627

I don't know if this belongs here, but I have a question about computer processors:
Is there any point to having support for integers larger than 64 bits?
Other than encryption keys, I can think of anything which needs 128 or 256 bit numbers.

Also, I've noticed that most SIMD implementations are 4 lanes wide.
Is that because 3D transformation (4x4) matrices are the main application of SIMD instructions?

>> No.1804689

>>1804627
>Is there any point to having support for integers larger than 64 bits?
there's no point to having integers larger than 32 bits

>> No.1804692

there's no point to having integers larger than 8 bits

>> No.1804695

>>1804692
honestly most of my projects could get by with 4 bits

>> No.1804777

>>1804689
>>1804692
>>1804695
Ok smart asses.
"640k ought to be enough for anyone", I get it.

But 64 bit integers are really huge.
Unlike 16 bit or 32 bit integers, it's not likely for a overflow to occur unless you start counting really big numbers, like the number of stars in the universe.

>> No.1804802

>>1791470
my fucking sides

>> No.1804876

>>1804777
It still is, and will always be rather easy to overflow by accident through multiplication and exponentiation of already big numbers. It's not always about counting singular things.

>> No.1804900

>>1804802
don't knock it till you've tried it. All this extra PPE will have to get used somehow.

>> No.1804908
File: 336 KB, 1368x970, 1582917356686.jpg [View same] [iqdb] [saucenao] [google]
1804908

>> No.1804909

>>1804876
If you're doing exponentiation, you should already be using floating point. For most uses, 32-bit floats are just fine.

>> No.1805257

Would you help a retard out? I'm just starting with arduino and am trying to build a light meter (https://pominchuk.com/lightmeter/).). Got the display and buttons to work, but it just doesn't get the reading from the sensor, the values always remain the same regardless of the lighting condition.

Anything I can do to diagnose and resolve this? I'm honestly clueless.

>> No.1805260

>>1805257
if your display is configured for i2c then you know your bus is working, so it's most likely a software issue. you're either not configuring the sensor correctly or there's a logic error in your code. use serial.print to write variables to your PC for debugging. one thing i'd check is whether the sensor is ACKing your i2c packets. the arduino library may make that easy for you to check, or you may have to read the atmega328p datasheet to find the special hardware bit where ACK data is stored.

if your display is using some protocol other than i2c, you need to make sure your i2c bus is working at all.

>> No.1805481
File: 84 KB, 638x359, beating-floating-point-at-its-own-game-posit-arithmetic-21-638.jpg [View same] [iqdb] [saucenao] [google]
1805481

>>1804909
>you should already be using floating point. For most uses, 32-bit floats are just fine.
out of curiosity, has anyone gotten posits working on an MCU? they're touted to be way better than floats, so I figured you guys would know how to implement them
https://www.youtube.com/watch?v=N05yYbUZMSQ
30:33 compared the # of bits needed, and 33:00 forward compares their efficiency/completeness. Blows floating points out of the water

>> No.1805603

>>1805481
Can’t watch the video at the moment, but I was under the impression that they’re a real bitch to implement in hardware, since everything is variable length.
That basically negates any gains in speed due to requiring fewer bits, since it all has to be done in software.

>> No.1805674

>>1796090
>PIC is more popular in professional settings
professional here
legacy systems will use PIC for sure, but it seems like everyone is moving to ARMs like STM32

regardless, if you learn C or C++ you'll be really well off for it

PIC is useful to be familiar with, but if you get a job in embedded systems, you're probably going to be using an ARM Cortex in the future

>> No.1805956

Been doing some Arduino and esp8266 programing and I feel like my code is messy and awful. I'm completely self tough and I know I've got many bad practices, and its very obvious when I look at other people's code.

Was thinking of trying to relearn C from scratch in attempt to write nontrash code and better learn how to structure thing.
Was recommended the online book Modern C (https://modernc.gforge.inria.fr/ ), but does /amg/ know of any other good books or video series?

>> No.1806002

>>1805956
C Programming A modern approach

>> No.1806056

>>1806002
Reading up about the book it does look like its a really good starting place, lots of positive things said about it. Thanks anon.

>> No.1806080

Does anyone have experience with using SPI to read from an SD card? I've been trying to use a PIC24 to read a 32 GB SDHC card, and I've been having trouble getting a correct read. As far as I can tell, I've initialized the card right, sending cmd0, cmd8, and then cmd55 and acmd41 until it's no longer idle, and I am able to send a read single block command and get a response which looks almost right, except I'm getting all 0x00s where there should be data.

I've tried reading from address 0, which should be the MBR, which I can see in a hex editor, but no luck. I've also tried writing somewhere and reading the address I wrote to, but that returns 0x00s as well. I've made sure to check the status register after the write to see if anything went wrong, but it looks fine, and I get a write accepted response, even though the hex editor doesn't show anything got written.

I'm kind of thrown for a loop here, it doesn't seem like anyone has had a problem like this online. I'm only using code I've written, and I can provide it if it would help, but my code is a little messy and I'd probably have to touch it up a little.

>> No.1806252

>>1806080
perhaps read through existing SD card libraries?

>> No.1806301
File: 507 KB, 520x411, kscY0jU.png [View same] [iqdb] [saucenao] [google]
1806301

So I'm just dorking around with an arduino and a MAX7219. Messing with 8 segment displays. I'm real green with this stuff so I don't know all the functions.

These max ICs let you update just one digit and let the others persist. Say I was making this a counter. Is there an easy way to figure out which numbers in a string change? Say the number I have stored to display is 5000. Then A number changes to make 5010. Is there a way to say 'Hey, just the ten's place changed' or would I just have to do the N % 10, (N/10) % 10, (N/100) % 10, etc and test each number individually? I don't have a problem doing that if I need to, just wondering if there was something out there that would make checking numbers easier without having do deconstruct it each time.

>> No.1806318

>>1806301
build a karnaugh map of the signals you have and the outputs you want, and figure out which logical operations yield the results you want.

>> No.1806379

Is attiny88 same as attiny85 but with more legs?

>> No.1806458 [DELETED] 
File: 3.06 MB, 4000x3000, J0rIcOu.jpg [View same] [iqdb] [saucenao] [google]
1806458

Here's babby's first project and blog. Had to learn to solder and it was a fucking mess, but everything works as it should and the car avoids obstacles now. Had an interesting issue with the thing going berserk powering everything with the AA batteries or just the 9V. Powering the arduino and the motors separately seems to have fixed it.

Next step is trying to find the gyro in my large bag of chinashit sensors and see if I can get the thing to make consistent turns. I also need to figure out a more durable solution for the wires heading to the ultrasonic sensor at the front. The wires keep breaking as it swivels. It's been pretty fun to build, all in all.

>> No.1806459

is it possible to do networking by soldering utp cable wires to arduino digital pins and doing the rest with software?

>> No.1806460
File: 627 KB, 1999x1342, car1.jpg [View same] [iqdb] [saucenao] [google]
1806460

Here's babby's first project and blog. Had to learn to solder and it was a fucking mess, but everything works as it should and the car avoids obstacles now. Had an interesting issue with the thing going berserk powering everything with the AA batteries or just the 9V. Powering the arduino and the motors separately seems to have fixed it.

Next step is trying to find the gyro in my large bag of chinashit sensors and see if I can get the thing to make consistent turns. I also need to figure out a more durable solution for the wires heading to the ultrasonic sensor at the front. The wires keep breaking as it swivels. It's been pretty fun to build, all in all.

>> No.1806492

>>1806301
just convert to strings using sprintf with a fixed width (like %6d or %.6d) and then loop through the string

>> No.1806495

>>1806460
>male dupont style jumper wires
Those are never going to not break from fatigue, you can just look at them wrong and they'll break. Soldering a wire to them? Madness.
Get a strip of header pins, and break off one or two at a time or however much you need, then use F-to-F jumper wires. Depending on what you're doing you might even use the naked header pin without the little black plastic.
Bonus protip: you can use a straight pin to unlock the female pin from the plastic shell, then mix and match them into random header shells you can get from junk PCs.

>> No.1806499

>>1806459
I guess you could do I2C, but that is a single-master system.
Really you need some kind of line driver, depending on what you're doing (since you don't explain what you want from "networking"), you could maybe do RS-485. It only takes a pair of small chips, and it's an old reliable standard. I was working with it over 20 years ago on 8-bit stuff.
More than a few inches and a naked GPIO pin won't have any kind of signal quality for data.

>> No.1806521

>program smd attiny
>solder to board board
>turn on
>doesn't work, i forgot to add a line of code
>now have to desolder it with hot air
shieeeeeeeeeeeeeeeeeeeet there must be better fucking way to update code on soldered chips

>> No.1806526

>>1806521
>there must be better fucking way to update code on soldered chips

think anon. you are doing something very wrong in your development process.

>> No.1806527
File: 195 KB, 630x470, Untitled.jpg [View same] [iqdb] [saucenao] [google]
1806527

>>1806521
i use pic rather than avr, but i always add an ICSP header to any boards with a uC on them. i've never written code that didn't have at least one bug. even when it's just 50 lines of assembly i'll have messed up the polarity on a bit test or something. if you don't have room for a physical connector then at least add a few pads that you can solder bodge wires to.

>> No.1806559

>>1806527
>ICSP header
is that some special part or literally just 6 pins? i guess i could do that
for dips it's easy, i always use sockets but for smds the sockets are expensive and huge or don't exist and it kind of beats the point of smds anyway

>> No.1806567

>>1806559
that ICSP pinout is specific to pic. i think atmels are programmed over UART, could be wrong, but the same principle applies where you'd have a few pads or pin headers on your board and program your uc in circuit as many (dozens) of times as you need.

>> No.1806571

>>1806567
I supposed that is a good idea, i will include the pads from now on so i can just stab ftdi into those pads and upload a new sketch and don't have to use sockets and shit

>> No.1806597
File: 153 KB, 489x442, Capture.png [View same] [iqdb] [saucenao] [google]
1806597

>>1806521
Never tried but kinda think is a good option for small boards

>> No.1806602

>>1806567
>i think atmels are programmed over UART,

atmel avrs are programmed over SPI. Arduinos have another avr that handles USB to the PC and SPI to the actual avr that does the arduino stuff. You can program in circuit directly through the SPI using avrdude if you know the correct command line and have the hex file. Typically this would be done using a USBASP or USBtiny which connects to your PC via USB, but you can do it with any device that can control GPIO pins. Years ago I had to program avrs via the parallel port on my PC because Arduino, USBtiny, and USBASP were in the distant future.

>> No.1806612

>>1806597
i have that
that fucker will not slip like motherfucker, you haev to hold it by hand and pray you won't move, while uploading, it's like bomb defusing

>> No.1806619

>>1806612
If you're soldering the chip down anyhow, you might as well solder some header pins to the chip, sort of like an upside-down socket.
Also find some 4x1 shells to transplant the female pins into, or at least wrap some tape around them so you don't have to get the order right every time.

>> No.1806623

>>1806619
you don't put the dupont cables on the chip, you put the clip thing on it

>> No.1806736

>>1806623
I mean solder the header pins directly to the chip and plug the wires into the header pins instead of the bulky snappy clip.

>> No.1806906

Can arduinos not handle calculating powers? Do I have to use that pow command?

Like will "int mut = 10^i" not work? I tried using the pow command but it would give me weird numbers.

>> No.1806915 [DELETED] 
File: 2.59 MB, 3120x4160, 1574352955711.jpg [View same] [iqdb] [saucenao] [google]
1806915

>>1806906
>he doesn't understand the difference between integer and floating point math
and anyhow it's ** in C/C++, not ^

>> No.1806916

>>1806915
I don't. I've been dicking around with an arduino for like half a week. I'm not quite there yet.

Thanks!

>> No.1806917

>>1806915
Fibber

>> No.1806919

Dammit, it's been so long since I've used floating point for anything that I forgot C uses ** for pointer shit. It was Fortran that did that.
Still, read through K&R at least once to get a basic idea of what C can do, C++ is based on it.

>> No.1806927

>>1806906
lel. ^ is XOR, not exponentiation. pow() should work unless you're doing something dumb. post code.

>> No.1806935

>>1806927
I was breaking a number apart into digits and putting it in an array to display on a 7 segment LED display. So I did this

for (int i = 0; i < 8; i++){
newArray[i] = number/pow(10, i);
}
number++;

Then shoot the array off to the display. Just when I ran the loop and just incremented the number it started getting fucky. It works for a bit but really fucks up the number displayed when it gets ready to tick over to the next place. Like the display would show

>0095
>0096
>0097
>0198
>0199
>0100

And any places above the 100's place would get even fucky-er. I solved it by just making a multiplier array that I multiply by. I just though I was being clever with the pow(10, i) thing and I'm trying to understand why it was screwing up my numbers.

>> No.1806940

>>1806935
Shit. Leme fix that code.

for (int i = 0; i < 8; i++){
newArray[i] = (number/pow(10, i)) % 10 ;
}
number++;

Sorry.

>> No.1806943

>>1806940
>newArray
what types in newArray? are you overlfowing an int8_t?

>> No.1806946

>>1806940
Shit I fucked up that code again. Sorry. Doing a lot of backtracking.

for (int i = 0; i < 8; i++){
Long multi = pow(10, i)
newArray[i] = (number/multi) % 10 ;
}
number++;

>>1806943
The array is made out of byte since it will only ever be 0-9, which I tried integer but did the same thing. And I guess I'm not overflowing anything. Again, just super fresh to this stuff and I guess these floating point numbers are beyond me.

>> No.1806980

>>1806946
how about:

uint16_t number;
uint16_t[8] array = {0, 0, 0, 0, 0, 0, 0, 0, 0};


for (int i =0;i<8;i++)
{
array[i] = number % 10;
number = number / 10;
}

when you mix types without casting, you'll have to look up what the arduino libs do do know how it's handled. does pow (int, int) return a long? what type is 'number'?

>> No.1806987

#include <stdio.h>
char newArray[9]; // don't forget the null you idiots
sprintf(newArray, "%.8d", number);

or use "%8d" if you want leading blanks

>> No.1806991

>>1806980
Looks like pow only likes playing with float so that's probably my problem. Just mixing number types. And the 'number' variable was a long. Had to store something between 0 - 999999999. I'll mess with it a little more. I've solved the problem I was having by just kinda circumventing generating a number to divide by with pow so it's not a big deal. I was just wondering what was going on that was giving me a problem. And that just be it. pow doesn't like playing with numbers that aren't float.

>>1806987
I'm pretty sure there's a library for this MAX7219 that I could use but I'm just kind of dicking around. Kinda wanted to do everything from scratch just so I know exactly what is going on. I've been having a lot of fun and learning a bunch just poking around with this max IC. If I wanted to actually make something proper I'd just use a library that is way better then my work but I'm just working on the basics and trying to understand how these things work.

Someone mentioned sprintf a while ago and I sat there reading about for a while and just kind of struggled to figure out how it would help me. It looks interesting and versatile but I couldn't really figure out how to implement it. It's on my 'to figure out' list.

>> No.1807005

>>1806991
>Someone mentioned sprintf a while ago and I sat there reading about for a while and just kind of struggled
That was probably me. Converting numbers to text is one of the oldest wheels in C that people are constantly trying to re-invent. It's basic fucking C programming. It's like using an axe to make a knife out of wood instead of using the Swiss army knife on the table. Just pick up the real knife and say "done!" (and don't use it to carve the stupid wood knife)
If I was hiring a programmer, and in the interview I asked them to write a program to convert an integer to a string and said nothing else, I would be a lot more likely to hire someone who used printf or some other standard library function than someone who tried to write one from scratch.

>> No.1807014

>>1807005
Yeah, and I get that. I'm just barely dipping my toe in the water with microcontrollers and prototyping and coding. Outside a couple of Zachtronics games, all knowledge I've got about this stuff came out of an arduino starter kit and clicking around the internet. I know a lot of my stuff is reinventing the wheel and unnecessarily brute forcing stuff but I'm mostly doing it just to understand how these things work.

I think of it kind of like legos. Hey, anyone can go to the store and get a kit and follow the instructions and make a bad ass space ship. It's like following an arduino project book to the letter and plugging in other people's code to make it work. What I'm trying to do is build something from a box of legos without looking at step-by-step instructions. I picked up a data sheet, read it, hooked it up, an started controlling it with a microcontroller with code I got from only looking at the arduino reference page. So far I'm having a blast and it's been a success for the most part. Just a couple minor hiccups. If I wanted to turn this project into something other then a learning play thing then yeah. I'd use better written libraries and stop trying to reinvent the wheel since it would save me heaps of time.

>> No.1807169

>>1806495
Thanks for the tips. I guess I'll have to get my hands on stronger wires + connectors. Right now I'm doing everything with parts from an Arduino starter kit and some crap I had lying around.

>> No.1807387
File: 84 KB, 760x614, 2020-04-27 18-39-28.png [View same] [iqdb] [saucenao] [google]
1807387

Why aren't there any bipolar transistors rated for more than 50 Amps of collector current?

>> No.1807427

>>1807387
because 0.7V * 50A = a lot of power
also look into IGBTs

>> No.1807630
File: 80 KB, 1356x728, MS5611.jpg [View same] [iqdb] [saucenao] [google]
1807630

>>1784995
How can I stop small eddy currents in a wire?

I built a localisation system which uses the interrupt pins on a Teensy to generate very precise timestamps using the PPS (pulse per second) pin on a GPS.

Recently, I added more sensors to my system, they are connected to another Teensy. Rather than add another GPS I simply soldered a wire to the PPS pin of the first GPS and ran it to an interrupt pin on the other Teensy.

When stationary, it works fine. Unfortunately, when I walk around with it, the interrupt pin gets triggered many times, ruining the timestamps (it counts the pulses to keep track of time and uses micros() since the pulse for the remainder).

I suspect that if I connect this wire to ground, it could sort the problem out. The mystery would remain though: I never had such an issue when only using one Teensy.

>> No.1807631

>>1806495
>you can just look at them wrong and they'll break
can confirm

>> No.1807692

>>1807630
the most likely explanation that comes to mind is that walking is vibrating a loose connector and causing intermittent contact. otherwise if your PPS wire is long enough that it's picking up noise, add a termination resistor at the teensy input. 1k should be safe. lower is better if your gps module can drive it.

>> No.1808041

Anyone have experience adapting bare-metal drivers that come with a microcontroller for use within an operating system?

I have an ARM device that comes with a lot of drivers to support its functionality but they don't seem to want to work with Linux. In particular the drivers are written for arm-none-eabi-gcc while the kernel modules I want to include the drivers in use arm-linux-gnueabi-gcc.

Seems like I have no recourse but to read the drivers and rewrite them from scratch?

>> No.1808460

>>1808041
What do you need drivers for? Direct USB shit?

>> No.1808612

>>1808460
Cryptography services, in-system programming, access to certain custom hardware peripherals, etc. The ARM processor that Linux is running on is a hard IP block within a much larger FPGA so the designers were able to pack a lot of non-standard stuff in there but sadly only provided bare-metal drivers for all of it.

>> No.1808682
File: 201 KB, 1144x379, attiny--244484-pinout[1].png [View same] [iqdb] [saucenao] [google]
1808682

Can arduinos like uno, or chips like attiny handle several PWMs outputs at the same time?

Like for example i have attiny84 and i want to output different voltage on 4 pins like this:
analogWrite(A0, 100);
analogWrite(A1, 50);
analogWrite(A2, 600);
analogWrite(A3, 0);
The picture says attiny84 has 4 PWM pins, but two pins are on "PWM1 timer" and two pins are on "PWM2 timer" does that mean that i cannot have 4 different pwm outputs running at the same time, but instead only two?

>> No.1808796

>>1808682
Read microchip datasheet for Attiny84. It has 4 independent PWM outputs, two on 8bit counter and two on 16bit counter (OC0A/B and OC1A/B respectively)

Can't say if our code will work since not into arduino code

>> No.1808802

>>1808796
but if two pins are on same counter, can they really both have separate pwm duty cycle?

>> No.1808807

>>1808802
Duty cycles? Yes, I'm assuming they'd just change the comparison threshold. Switching frequencies and phase might be locked though.

>> No.1808809
File: 44 KB, 874x792, attiny_8bit_block_diagram.png [View same] [iqdb] [saucenao] [google]
1808809

>>1808802
each output has it's own output compare register (rtfm) but two channels share one timer

What this means is that two channels will have same period (let's say 20ms) but OCR0A can be set to 2ms and OCR0B can be set to 18ms
So end result is you get same period on two channels but two separate PWMs. Same applies to 16bit counter as well

>> No.1808810

>>1808807
I don't really care about the frequency, i just need to specific on/off ratio (duty cycle)

>>1808809
nice thanks, that is exactly what i needed to know

>> No.1808818
File: 998 KB, 1000x1328, image.jpg [View same] [iqdb] [saucenao] [google]
1808818

i made an esp8266 rgb led panel controller board. it's perfect for my application, but it's abusing two shift registers as level shifting and i/o expansion, which means the SPI is chugging away at 80MHz and just barely managing a 30Hz refresh rate with 9 equiv. bits of color depth. kind of funny but in (sober) hindsight should have wired the outputs differently to allow faster refreshing in case i ever wanted to show a proper image with more depth.

>> No.1808899

>>1808818
Cool project anon.

>> No.1809274

If i disable the reset pin on attiny85 by setting the fuses (i need to use it as digital pin)
will i still be able to upload sketches with ISP programmer?

>> No.1809275

>>1809274
nevermind i found it, it's not possible, you have to use high voltage programmer, or waste space and boot time by using bootloader

so guess i will have to debug my sketch first, upload it, and then disable the pin

>> No.1809303

>>1809275
When using low-pin-count devices, it is not uncommon to use prototypes with higher pin count devices. If you have to use the final board, you can make a pod board that plugs into the main board with minimal signal distance.

>> No.1809326

How do I start learning actual low level electronics?
I got into arduino a few months before quarantine started, now I'm super into electronics and wanna learn more. Where do I go from here? What books/courses/videos should I check out?

>> No.1809346
File: 113 KB, 903x1465, The TTL Cookbook.jpg [View same] [iqdb] [saucenao] [google]
1809346

>>1809326
For digital electronics, I recommend this one. It was my favorite library book (with a different cover) when I was a kid back in the mid-70s. I was making blinky lights with TTL and CMOS chips before home microcomputers, much less freaking Arduinos.

>> No.1809423

>>1809346
I heard "The art of electronics" is a good one, what do you think?

>> No.1809437

Anyone ever work on Bluetooth stuff, specifically BLE? Currently using an RN4870 from Microchip but I'm wondering if there are better options, e.g. the M0 SoCs from Nordic.

>> No.1809652

it's trivial to write an ASM subroutine that divides an integer by 10 and calculates the remainder as a free byproduct, for digit calculation in 7 segment displays. the equivalent way to do that in C is to write separate division and modulo operations. i can imagine a compiler being dumb enough to perform division twice as a result. does anyone know if I can trust shitty uC compilers in general to understand what i'm doing and optimize the code correctly? i'm using the free XC8 compiler specifically but in general i'm fuzzy on how smart compilers really are. people say compilers generate better ASM than you can hand-write in 99% of cases, but people are idiots and i imagine that's more true for x86 etc than it is for some obscure microcontroller.

>> No.1809663

>>1809652

It might be interesting to write the ASM algorithm in your C and take a look at the compiled ASM. Like you said, integer division in ASM automatically delivers the remainder, so what happens if you force C to do the same laborious repeated subtractions.

>> No.1809664

>>1809663
>write the ASM algorithm in your C

and I don't mean embedded ASM. do a loop just like the ASM would do, with the same rotates and shifts or whatever.

>> No.1809807
File: 1008 KB, 1000x798, 1588313047740.png [View same] [iqdb] [saucenao] [google]
1809807

How can i learn 2hack
i can program already with slightly high level languages

>> No.1809907

>>1809807
this thread is for stuffy autistic engineers, not skiddies or russians. if i was going to try to "hack" something though i'd want to collect as much documentation as exists on it, use that to map physical io and the logical or physical subsystems they interface with, determine which io (if any) i'm able to interface with, and then look through each of their subsystems for vulnerabilities. if you don't have full documentation of a system or access to the system for reverse engineering or you're not a domain expert then i imagine you're fucked.

>> No.1809917

>>1809807
What do you mean by hack?
Hardware hacking or traditional hacking? If you mean the latter, >>>/g/ . If not, programming languages come later, you should first understand basic electronics, ways signals are transmitted, protocols and how to use an oscilloscope. Look at Robin Reiters youtube channel to get an idea about how to reverse engineer / hack easy circuits.

Also stay realistic. Intercepting buttons and triggering functions on a chip is easy, getting the firmware off of a chip is much harder. Start small and keep at it.

>> No.1810213 [DELETED] 

>>1809907
i just wanna try this contest. why am i skiddie?
>>1809917
so you're saying i need to read >>1809346

>> No.1810521

>>1785000
>except for the half dozen anons seeing a (You) rushing to the thread

I don't think you get a (you) on a new thread

>> No.1810639

>>1810521
You do, at least I do with 4chan X.

>> No.1810740

>>1793974
Actually what you need is an encoded motor

>> No.1810745

>>1798860
Know your hotkeys

>> No.1810878
File: 35 KB, 493x436, 3v3.png [View same] [iqdb] [saucenao] [google]
1810878

Hey lads, i have a Teensy board with an Atmega32u4 microcontroller that needs to run on 3.3v instead of 5v for the project i'm using it in. The board has an option for this shown in grey on the schematic - you install a regulator, cut the trace between the middle pad and the "5V" one, then solderblob it with the "3V" pad.

My question is this - the board works fine even if i don't bridge the "3V" pad in the end, so what is it for? It always connects the mcu's internal 3.3v UCAP pin to its 1uF capacitor, so what's the point in tying it to the new regulator?

>> No.1810888 [DELETED] 

>>1810878
Look at the fucking schematic, it's for the filter cap after the regulator.

>> No.1810892

It's for the filter cap after the regulator.

>> No.1810976

>>1810892

Oh i see, so the greyed out capacitor and the UCAP one are the same thing, it just becomes a filter capacitor for the new regulator's output as well. Thanks

>> No.1812682

New thread if this one kicks the bucket:

>>1812677
>>1812677
>>1812677