[ 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: 99 KB, 620x465, IAHUK[1].jpg [View same] [iqdb] [saucenao] [google]
1908711 No.1908711 [Reply] [Original]

Arduino, Teensy, Atmel, ESP32, bluepill, Raspberry... All microcontrollers welcome!

>> No.1908717

How shit are counterfeit/that party Arduinos and raspis?

>> No.1908720

>>1908717
chinese knockoff arduinos are great
chinese knockoff raspis are worse supported than the official shit while being not that much cheaper

>> No.1908786
File: 2.94 MB, 562x1000, BuiltBoard2.webm [View same] [iqdb] [saucenao] [google]
1908786

Behold, I am now able to post about 80% faster than normal. It's a digispark using v-usb to act as an HID keyboard, which works okay. Does anyone know how well the STM-32 HID stuff works? The digispark has to connect twice and is less than perfect.

>> No.1908788

>>1908786
>tfw ywn give abigail shapiro your big goy cock
feels very bad man

>> No.1908858

>>1908786
>Does anyone know how well the STM-32 HID stuff works
pretty good. I made a 60% keyboard using the HID example from stm32cube

>> No.1908924

>>1908717
considering that an arduino is an off the shelf ATMEL AVR soldered to a PCB with its pins routed to a header with an off the shelf voltage regulator, the chink versions are literally identical because they buy the same parts from the same vendors

>> No.1908926

>>1908924
No, they usually use cheaper Chinese versions for the USB-serial chip instead of an FTDI.
And sometimes they use ATMega clones instead of the originals.

>> No.1908947

>>1908926
so ? ...the usb chip requires drivers that you download from the first google result ...the rest works identical because its a carbon copy of a digital IC ....again its literally an identical copy of an already very basic design so yes its the same thing

>> No.1908950

>>1908947
Do you even know what "literally identical" means?

>> No.1908972

>>1908926
>cheaper Chinese versions for the USB-serial chip instead of an FTDI.
Arduino doesn't even use the FTDI anymore. They use an atmega 16U2 programmed to act as a bridge.
The chinese clones actually use proper usb-serial converters, which are better, and typically (lots of aliexpress sellers) you can choose 16U2 too should you prefer that for whatever reason.
Buying an "authentic" arduino will cost you between 5 to 20 times as much money, in respect to the identical sort of clone. Eww.
I'd say don't even bother with clones, and get a better design instead. The seeeduino line is consistently cheaper and better than the originals.

>> No.1908984

>>1908786
Arduino Pro Nano is another good choice for keyboards

>> No.1908986

>>1908984
stm32, any day.

>> No.1908987

I've been working on a button box for the Leonardo that reads as a gamepad, what would I begin looking in to if I wanted to transition away from the leonardo as a prototype and start working with my own components? To the point where I'd be able to create the name and type of gamepad it shows up as

>> No.1909062

>>1908972
Another anon here. Thanks, more reasons not to buy the original. I'm following them on YouTube, and they are also very woke. Maybe should be more focused on the products...

>> No.1909086

>>1908987
You can edit the HID device descriptor in the arduino USB libraries if you were so inclined. Arduino is easy but the STM32/ESP32 stuff is getting cheaper and is a lot more powerful. The obstacle IME is getting custom PCBs made and working with SMD soldering. None of that is particularly difficult though.

>> No.1909150

>>1909062
I currently have a seeeduino attached to an FPGA (a parallel bus made with duponts). The seeeduino conveniently has a physical switch for 3v3 or 5v i/o.

>> No.1909205

heys guys need help, i have a heap of pcbs that are faulty. Is there a good guide on how to repair/ replace components

>> No.1909213

>>1909205
Be more precise.

>> No.1909232

Anyone know where I can get some cheap submersible pressure sensors?

All the ones I can find are for high pressure systems and cost 100s of dollarydoos

I only need to measure up to like 150kPa (incl atmospheric pressure), range of pressure is just 100-150kPa

>> No.1909242

>>1909232
put it in a deformable membrane. air compression pressure equal to the water pressure at that depth.

>> No.1909253

>>1909242
Balloon and some elastic bands?

>> No.1909383

Redpill me on external interrupts.

I'm reading a rotary encoder and it seems to me using external interrupts will give measurements at random time and not with a fixed sampling rate yet most of the info online says you should use external interrupts.

I'm using a timer interrupt to keep a steady sampling rate and I read my encoder at Timer overflow. At full motor speed I'm not getting any aliasing, I assume I'm not skipping any encoder readings, though I'm not entirely sure.

Anyone care to share experiences with motor encoders?

>> No.1909401

>>1908711
I like this pic, reminds me of past builds.

>> No.1909407

>>1909383
>it seems to me using external interrupts will give measurements at random time and not with a fixed sampling rate yet most of the info online says you should use external interrupts.

Think anon: the rotary encoder changes state at unpredictable times, so why wouldn't you want to be alerted at the precise time that the encoder changes state? If you are interested in rotational speed that is the best approach, and even if you are not, sampling at a timed interval is going to waste cycles which is generally not a good thing.

If your approach works fine in your application and you find it more appealing, there's nothing wrong with it.

>> No.1909939
File: 107 KB, 2216x1424, o_1djvv02dd1opk7cph973ndo2da.png [View same] [iqdb] [saucenao] [google]
1909939

>>1908711
I have a CCTV camera that uses the EN781F MCU:
http://www.eyenix.com/en/product/product_list.php?part1_idx=7&idx=17
Like most proprietary chips, that's all that is available.

I have also located the JTAG pins and want to extract the firmware using this tutorial where they try to snarf a totally unknown board:
https://wrongbaud.github.io/jtag-hdd/

Most tutorials on snarfing list finding the device's ID and using it in later configuration files, and that tutorial lists "0x4ba00477 - this ID is for an ARM Cortex core...". Is there a place where all these ID's are listed?

>> No.1909949

>>1909213
how do i repair pcb's? mircochips for welders and inverters? is there any guides to learn this stuff

>> No.1909997

>>1909949
Guides? Not really, just find a bunch of junk boards and start practicing taking parts off 'em. You have to get a feel for how the solder flows and doesn't flow, and that can take years. It definitely ain't Lego. Also there are different techniques if you want to save the part vs if you want to save the board. For instance, snip all the pins of an IC that you want to replace, individual pins are much easier to desolder.
A lot of it is about having the right tools. A desoldering iron with a hollow tip, and hot-air gun (can bring a board up to solder melt temperature if you are patient enough, those worked for me for years, though not great, very much making furniture with an axe. Solder wick never worked for me, and I have an SMT air station now but haven't used it much yet, still learning.

Hmm, I have parts saved up that will last a while, but it looks like someone on Amazon sells the old Radio Shack desoldering iron and tips:
https://www.amazon.com/ECG-J-045-DS-Electric-Soldering-Temperature/dp/B00068IJSG
https://www.amazon.com/ECG-JT-103-Replacement-J-045-DS-Soldering/dp/B0195UZP1Y
(protip: be sure to tin that tip well, that can be the difference between it lasting hours and lasting months, also extend its life a bit with a big metal file to flatten the tip when it starts to erode)

>> No.1910011

>>1908950
yes ...the MCU is literally identical

>> No.1910049

>>1909939
well the G in JTAG stands for Group so presumably they will hold a registry of and distribute IDs to users, however whether or not they make that information public or even available to fee paying members is another question. USB and PCI do the same thing except because of e.g. linux etc projects we have thousands of people over the world who simply share the IDs of devices they buy and collaborate to build open lists of devices and IDs so its certainly possible that someone might have done something like this its unlikely because of the diverse applications of JTAG enabled devices.

>> No.1910159

God I wish my company had gone with Xilinx over Microsemi for their FPGA stuff.

>> No.1910188

Anyone got any experience with accelerometer/gyroscope sensor fusion?

I keep finding that my pitch, roll and yaw either decay to the initial value or explode (keep going up) depending on how I do things.

>Decays: https://pastebin.com/jdhTnA9f
This is how it's done in the articles I've seen although it seems obvious it would decay since alpha is applied to the original value, and the gyro readings go to zero when it stops rotating.

>Explodes: https://pastebin.com/KibDBWFu
This seems more logical since the only thing that should make the angle smaller is a counter-rotation but it causes the explosion and nobody else seems to do it this way.

I calculate alpha based on dt and a time constant which I've tried varying from 0.1 to 5. The response time changes but it still either decays or explodes.

What am I doing wrong? Feels like I've read every article about this on the internet.

>> No.1910201

what the fuck is JTAG and where do I find the specs?
Is it board specific? Are there actual bit-by-bit protocols out there, or is it just "lol add access points to your chips :^)"

>> No.1910243

>>1910201
It's a real protocol and you can buy usb jtag programmers.

>> No.1910305

>>1910188
Kalman filter is what commercial applications use.
checkout invensense eMD code for their imu's. you need an account to download but it's free. just take the example code from the algorithm example and insert your own sensor data.

>> No.1910310

>>1910188
>>1910305
also it only works for arm cortex m4 processors. DK-42605 SmartMotion eMD 2.0.5 is what you want.
I've used the ICM-42605 with their driver and it works really well
https://invensense.tdk.com/developers/software-downloads/

>> No.1910328

>>1910305
>>1910310
I'm using a pair of Arduinos (Uno and Mega) which both need to measure orientation. The Uno won't have space for Kalman on it and anyway Kalman is hard. Even SpaceX don't use it much according to their leddit AMA.

>> No.1910329

>>1910310
I'll try the link anyway and see if it helps. Thanks.

>> No.1910507

>>1910188
I'm in the same boat, trying to get an AHRS working using accel/magne/gyro fusion.

I'm pulling out my hair trying to get it to work, I've tried multiple algorithms (mahony, FCF, other libraries) and literally none of them have been able to show it pointing north, and frequently it dips out and decides to start increasing or decreasing for no reason.

I've read the raw sensor data, and it SHOULD NOT be doing this, all the raw values are good, and after calibration + filtering (a simple complementary filter), the input sensor data is very smooth.

There is almost 0 gyro bias, I'm using the nxp high precision chip, and the magnetometer calibrated properly.

Any ideas?

>> No.1910510

>>1910507
ALSO I forgot to mention, occasionally the update speed slows to a crawl or halts entirely, I've got pullup resistors on SDA and SCL lines (4.7k) and am using a Teensy 4.1. I think I need to put timestamp checking inbetween every section to find out why it slows down so much, because it makes it unusable at that point

>> No.1910630

>>1909997
i know how to solder and will buy the gear, but how do i know if a component is faulty, a resistor i can check with an ohm meter, and diodes i can check. but other parts like a mosfet.
Do i need an oscilloscope?

>> No.1910688
File: 9 KB, 750x430, avr_prog_sch04.png [View same] [iqdb] [saucenao] [google]
1910688

>>1908926
>>1908947
>>1908972
What's your reason for not programming using parallel port(pic related) or diy adapter like using cheaper arduino as avr programmer?

>>1908972
Why spend 15-20$ on 2 microcontroller board whena single 5$ digistamp (with atmega32u4) can do much more including making clones of itself?

>> No.1910691

whose dick i gotta suck to find the cheapest linux sbc/module that has an FPU (so no lichee pi)

>> No.1910693

>>1910688
>What's your reason for not programming using parallel port(pic related)

I would prefer that, but it's hard to find 20 year old PCs these days.

>> No.1910697
File: 1.79 MB, 1920x1080, 1574409917984.png [View same] [iqdb] [saucenao] [google]
1910697

>>1910688
Arduino and clones are, above everything, devboards and tools on your workbench, and thus have convenience features, such as builtin serial to usb interface chips.
They can be used for prototyping and interfacing, but when doing a project for real, you'd move to a real board, be it just a FR4 prototype board or a real PCB.
There, I would use an arduino-as-isp to program bare chips. I could also use dedicated avrisp (tiny board with the ISP header). Or a pickit4. I even have a TL866, which can do high voltage parallel programming. I've never had to use it for that purpose though. But I have burned a great deal of 27C roms with it, such as my Amiga's kickstart roms.

>> No.1910730

>>1910693
No need to use a whole PC just for the port, they have usb to parallel adapters.

>> No.1910734

>>1910730
Why would you buy those things which pointlessly step up the voltage to 15V instead of just buying an USB TTL adapter which already gives you the right voltages?

>> No.1910737

>>1910734
Oh wait, I was thinking serial port. Parallel actually gives 5V.

You're still better off with an USB TTL adapter though since it gives you 3.3V too (e.g. for programming ESPs) and is supported by more programmer software.

>> No.1910741

>>1910730
Most of the time that won't even work with a PCI card parallel port, an ISA parallel port is the only way. And since when is there a USB parallel port that lets you use it for bit-banging?

>> No.1910745

>>1910688
>>1910741
You would have to program an interrupt routine, can you even program an interrupt routine, little faggot?

>> No.1910793

Suggestions for compressing 12-bit ADC values? Preferably something off the shelf that can run on embedded Linux.

>> No.1910796

I know FPGAs and DSP go together like bread and butter, but what do DSP engineers actually implement on FPGAs for DSP

>> No.1910799

>>1910243
Do they work on all boards/chips, or are they device specific?

>> No.1910943

Does anyone have any good walk trhoughbguide links for setting up esp8266? I am running it on Rpi3 right now.

>> No.1911049

>>1910691
bunp

>> No.1911074

What's a good site to get pheripherals for FPGAs/microcontrollers? I'm talking like LEDs, sensors, ect.

>> No.1911076

>>1911074
Aliexpress, LCSC, and ebay

>> No.1911077

What is a work around with Arduino programs with the delay function?

I ask because delay causes the program to "chug".
My only solution that has worked was using some code from an led chase effect tutorial I saw in a book.

>> No.1911080

>>1911077
I'm not quite sure what you mean but the answer is probably to use timer interrupts instead of delay.

>> No.1911082

Watching Tutorials for the ESP 32 to get a feel for it and the playlist I have found the guy uses this website.

http://www.easycoding.tn/esp32/demos/code/

Is this any good?

>> No.1911089

>>1911076
>LCSC
Didn't know about this one, thanks.

>> No.1911108 [DELETED] 

holy shit i dont know any of this
(yet)

>> No.1911113

>>1911077
honestly easiest way without rewriting all the logic of to use an RTOS like freeRTOS then replace all delays with vTaskDelay()

>> No.1911132

>>1910693
blob:https://www.kickstarter.com/f4ac6af7-4a27-4fbb-8a14-e8f95d05f1d9

>> No.1911183

>>1911132
?
404.

>> No.1911186
File: 90 KB, 240x240, 1595663651215.png [View same] [iqdb] [saucenao] [google]
1911186

>>1911082
If you can't into programming, and you've given up, maybe you can play with that?
Else, look into esp-idf, the official SDK.

>> No.1911187

>>1911113
>an RTOS like freeRTOS
https://www.osrtos.com/
Most are better than freertos.
I used to favor nuttx, but I haven't looked in years and wtf, it got apache'd and the website got murdered (used to be so so well organized).

>> No.1911189

>>1911187
Retracted about documentation.
It's formatted well again. They got rid of the clusterfuck the confluence was (I suspect it had to do with apache incubator).

>> No.1911239

>>1910745
Ha ha, Mr Terry Davis,
Most of the stuff we micro-controller guys do, is program interrupt routines

>> No.1911297

>>1911239
I still miss him...

>> No.1911399

>>1911187
>Most are better than freertos.
in what contexts?
the reason I suggest freeRTOS is because every MCU plstform that I've needed an RTOS on, a freeRTOS port was provided by the MCU vendor.
rather than me having to port myself or use some random github

>> No.1911403

>>1911399
>using vendor code

>> No.1911406

>>1911403
>not using vendor code
Dumbass, every MCU runs off vendor code as a base. Its called an SDK.
what's it like not working in the EE industry.

>> No.1911407

>>1911406
>using vendor code
>unironically

>> No.1911411

>>1911407
>repeating the same argument twice
what's your alternative then

>> No.1911416
File: 1.36 MB, 1920x1080, 1589185132323.png [View same] [iqdb] [saucenao] [google]
1911416

>what's your alternative then
For the arduino guy >>1911077, reading the datasheet and moving into avr-libc rather than shitty arduino sdk and ide. You can use timer interrupts, or implement your own, smarter delay function.
Do Note some atmega chips are supported in nuttx, if they want to play with it.
>>1911411
For you, evaluating other RTOSs (including the nuttx I suggested), and not being such a bore to settle with what the vendor gave you, which is typically a poorly put together freertos port only good enough to get you started. This might involve writing some platform code yourself, to support your hardware. You should not be scared of this.
Freertos is the most pain in the ass among those I tried, so I believe your effort would be rewarded.

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

How do you make cases for your projects? Any easy alternatives to 3d printing?

>> No.1911478

>>1911406
>every MCU runs off vendor code as a base
Aside from the mass majority of uCs that are programmed in assembly from scratch?
A disgusting amount of vendor code is for the hobbyist or small run production to attract customers and spread their name. It's a way to show off their hardware.
I'm an embedded system engineer and at least 90% of my designs that are mass produced are coded from scratch, aside from various libraries that I also wrote.

>> No.1911482

>>1911419
>easy
That depends on your skill set and what you consider easy.
You can always buy a sheet of polycarbonate (plexiglass) and cut it into smaller pieces, then glue/bolt them together. I use Lexan brand due to its very high durability. Just like most custom cases, it takes time.
Alternatively, you can buy a small plastic box from walmart or something and use a dremel to cut out openings. Not as nice looking, but its much faster.

>> No.1911521

>>1908711
How do I install arduino libraries on linux?
I'm trying to install IRremote library and I keep getting error:
IRtest.ino:12:22: fatal error: IRremote.h: No such file or directory
compilation terminated.
I just unzipped folder into arduino/libraries. But I cannot include IRremote.h
What is correct procedure to install arduino library on linux?

>> No.1911553
File: 22 KB, 350x263, project.jpg [View same] [iqdb] [saucenao] [google]
1911553

>>1911419
Do it the old fashioned way; buy a project box and cut the appropriate holes & ports into it.

>> No.1911595

on an atmega I have a PWM signal whose duty cycle depends on an 8-bit ADC

If the ADC outputs a value below a certain threshold I want that PWM pin to output 0V

I'm using the 8-bit timer and for my desired frequency I have the OCR2A (upper overflow compare register) value set around 100
Therefore I need to scale my ADC value accordingly so that the OCR2B register is around 100 when the ADC outputs 255

Sadly the overflow compare register interrupt will only react to the unscaled value

I would have to use a function to toggle the LED and decide if the ADC value is above said threshold

How could you solve that with interrupts? The PWM might not work without the interrupts if the cpu is busy with something else.

>> No.1911611

>>1911595
>Sadly the overflow compare register interrupt will only react to the unscaled value
Wait what do you mean by this? I'm doing something vaguely similar but I've just been putting the scaled ADC value into OCRxA and it seems to work fine.

>> No.1911618

>>1911611
So let's say my OCRxA overflows at 100 for a frequency I have selected
OCRxB is being fed by an 8-bit ADC value
OCRxB must not exceed 100 because OCRxA already overflows at 100 therefore it needs to be scaled so that an ADC value of 255 represents an OCRxB value of 100.
An ADC value of say 150 would be: 255x100/150 = 61.
61 would then be given to OCRxB

>> No.1911683

>>1911618
not sure how I got that wrong
An ADC value of 150 would be: 150x100/255 = 58

>> No.1911710

>>1911553
where the FUCK do I get cheap project boxes in bulk? ebay wants $8-12 apiece for these shits

>> No.1911745

>>1909383
>>1909407
I'm going to answer my own question, just if it's useful for anyone. Talking about MOTOR encoder.

It is perfectly possible to poll encoder position (with a Timer interrupt). If you sample at say 8+ times the max possible frequency of the encoder, in line with the Shannon-Nyquist theorem that states that should be at least double but in practice it is recommended to be more.

BUT, estimating velocity with the polling method is pretty much impossible, you end up needing at least 4 samples to create a decent estimate.

So, that is why you go with the external interrupt method, mainly because the velocity estimation with the External Interrupts method is far easier and much more reliable.

>> No.1911781

>>1911710
aliexpress if you don't mind long shipping times

>> No.1911782

>>1911521
you installed to a directory not in the compiler include path. either add the path to the compiler or move the lib to another folder

>> No.1911788

>>1911419
Protocase

>> No.1911793

>>1911419
LEGO

>> No.1911971

>>1911419
plexiglass

>> No.1911973

>>1908786
>>1908786
Good job, looks pretty good.

>> No.1912003
File: 615 KB, 1280x720, 1600429395297.jpg [View same] [iqdb] [saucenao] [google]
1912003

Assembled zx spectum clone. Going to connect it to the internet and write 4chins browser for it.

>> No.1912017
File: 1.21 MB, 1965x2360, IMG_20200918_142019__01.jpg [View same] [iqdb] [saucenao] [google]
1912017

How can I have an Arduino get position/rpm information from this?

>> No.1912056

>>1911297
Do you know, that if you were to meet him in person, he would have kicked you in the face on suspicion of being a glow nigger.

>> No.1912057

>>1911553
>>1911710
If you need them brand new, I know that some factory still makes them but only in black

>> No.1912073

>>1912017
Just count the time between pulses from that connector. I revolution is 12 pulses. 60 rpm is 720 pulses.
1 rpm is 12 pulses per minute
5 seconds between pulses is 1rpm
Rpm = 5 / time in seconds between pulses

>> No.1912089

>>1912056
Not at all, when anons met him he was pretty chill, only once he spazzed out, and it was because he thought it was some nigger asking for tobacco.
https://www.youtube.com/watch?v=Z4ZdHj6NYD8

>> No.1912206

>>1911595
>>1911618

Pls help there must be an easier way right? Alternative I could only have an isr trigger when OCRxA overflows but I can't change the duty cycle because I can't pass variables into OCRxB's ISR

>> No.1912257

>>1909949
your anwser is still extremely vague but i think its because you dont really understand what you are talking about
when you say PCB that means the laminated plastic board that has holes and copper traces on it...fixing PCB means that you want to repair a broken copper trace or broken soldering pad, that can be done by finding a healthy copper trace and gently scratching off the mask untill you get to the bare copper and soldering a piece of wire to it (thickness will depend on the use), fixing pads is done by the same way , and all you will really need is a steady hand and a bit of practice
there is a lot of fixing tutorials on youtube
>>1910630
>how do i know if a component is faulty
by knowing how the device works...when fixing things unless there is something obviously broken (which is not always the case especially if working on low power devices)you need to know how a device works so you can troubleshoot why it doesnt
>and diodes i can check. but other parts like a mosfet.
considering this sentence i would really recommend you first learn about electronics before spending any real money on tools

transistors are basically diodes , if you know how to test a diode you know how to test a transistor , also 80% of all things can and is teste with a multimeter that has voltage and continuity (resistance) test, capacitors are tested for continuity when they are blown , resistors , fuses and transistors are tested with continuity when they are blown , voltage sources and regulators and outputs and inputs are tested for voltage levels
most repairs are done in those few steps usually
>Do i need an oscilloscope?
if the above steps dont work then you usually need an oscilloscope to find ot more, and yes an oscilloscope is almost a must have if you want to start fixing or building stuff regularly but as i said already if you dont know how all the things work really well , or dont know how to use an oscilloscope then it wont help you at all

>> No.1912259

>>1910688
because i started doing this before all that was available and already have a programmer and why would i switch ...also not even 15 years ago people didnt use paralel ports for programming , they used rs232

>> No.1912271

>>1912206
okay perhaps I could do something like this in my main funciton

if (ADC > 30) {

OCR2A = 100
ADC = 150; // is provided by ADCH register
scale= ADC*100/255
OC2RB = scale;

} else {
PORTD |= ( 0 << PD7 ); // if certain ADC threshold (30) is not met Pin 7 is to remain low
}

if (TCNT2 = OCR2B) {

PORTD |= ( 1 << PD7 );

then for the ISR for Timer/Counter2 compare match A:
PORTD |= ( 0 << PD7 );


I think the scaling might be too time consuming and it might skip toggling the PWM pin but then again my frequency is just 200 Hz.
What does /mcg/ think?

>> No.1912443

>>1912073
Well, duh
I get that
Do I just count and use the blip as an external interrupt?

>> No.1912507

How would I combine multiple on/off switches to a single pin? The problem I'm too new to get around is that my normal solution of analog pins with multiple resistors, but that works with buttons not switches that stay open

Suggestions where to look?

>> No.1912516

>>1912259
There's only one programmer I know of that seriously used RS-232 and that was the EP-1. It just takes too long to transmit more than 64K or so of data to the programmer. 20 years ago all decent EPROM programmers used parallel ports, but you were lucky if it worked with a PCI card parallel port.

>> No.1912525

>>1912507
hook them up in parallel with pull-up resistors

>> No.1912612

>>1912271
I don't think this is going to work.
The likelihood of TCNT2 being OC2RB at the exact moment the cpu checks that line of code is going to be slim
That's why interrupts are used but maybe someone who's good at programing can come up with a solution

>> No.1912637

>>1912507
>that works with buttons not switches that stay open
what on earth are you babbling about?

>> No.1912643

>>1912443
You can. But any MCU is WAY faster than any wheel can spin, you can literally check for state change in a loop.

>> No.1912647

>>1912643
Unless you want to do something else, then an interrupt on any edge is fine. Just make sure the ISR only calculates speed to some global variable

>> No.1912655

>>1908786
What's going on with your recaptcha?

>> No.1912667

>>1908711
I just found my old Raspberry Pi 1 B+ in my garderob. What can i even do with it? The initial idea was to run a web server on my home network and maybe connect the GPIO pins to some lamps

>> No.1912671 [DELETED] 

Why do Indians love this piece of shit software so much? Seen a lot of tutorials where they use this.

When I was getting started some 5 years ago, I wasted so much time on this thinking it wasn't riddled with bugs. It even made me quit for a couple of years.

>> No.1912674
File: 256 KB, 500x281, file.png [View same] [iqdb] [saucenao] [google]
1912674

Why do Indians love this piece of shit software so much? Seen a lot of tutorials where they use this.

When I was getting started some 5 years ago, I wasted so much time on this thinking it wasn't riddled with bugs. It even made me quit for a couple of years.

>> No.1912834
File: 26 KB, 466x344, 61etqmJmOqL._AC_SX466_.jpg [View same] [iqdb] [saucenao] [google]
1912834

Can you use pic related (attiny85) as a normal usb device? Not just for uploading but for data communication. There's an arduino sketch to communicate some pc-software with an arduino through usb, but Attiny85 doesn't use standard USB but VUSB, so I'm not sure.

>> No.1912886

when do you use interrupts for ADC conversion stuff?
I dont really see a point in it

>> No.1912887

>>1912834
>VUSB
Is a fucking library implementing USB, which you should figure out how to use.
My advice would be to ditch the arduino shitsdk, and move on to avr-libc.

>> No.1912895

>>1911406
You either don't work as an embedded developer, or you are too inexperienced to realize how much of a moron you sound like. Not every company is in some top-down pricing niche where they can just hack together firmware and drive up BOM costs because it pales in comparison to their profit margin. Much of this world is busy trying to scrape 2 cents off a BOM with all sorts of dirty optimizations.

The firmware at my current employer has not used vendor libraries for the last 20 years. Within the last two we began using some vendor libraries and code generation, large portions of which we end up having to re-implement because of issues in the vendor's implementation.

>>1912886
ADCs take a non-zero amount of time to actually get a reading. If you're doing anything timing critical you can't just sit there polling for the ADC peripheral to finish.

>> No.1912943

>>1912887
An attiny is fine for a tiny (get it?) widget that doesn't need much computing power. Trying to use it for anything needing communications speed is not worth your time. And don't just ditch the arduino crap, ditch AVR as well. Unless you're making 10000+ units, you're not saving enough money per unit to make up for trying to wedge stunt crap like VUSB into too small of a CPU.
>>1912895
10 years ago I was trying to get I2C to work on an STM32, and their craptastic library code kept locking up because some morons thought it was a good idea to compare an entire 32-bit status register with constant longint values. At least I figured out quickly that it was trash and didn't waste my time trying to hammer it into something that half worked.

>> No.1912960

>>1912943
>And don't just ditch the arduino crap, ditch AVR as well.
I'd suggest msp430 for low power, stm32 if you need something more powerful.
But attiny with vusb should be totally fine for anything low speed.
>>1912943
10 years ago was 10 years ago, now is now. I'd struggle to find a microcontroller with cortex-M series with a better sdk and ecosystem.

>> No.1912964

>>1912960
STM32 can into low power, with L series

>> No.1912966

>>1912964
There's low power and there's Low Power.
msp430 hold the crown, as far as I am aware.

>> No.1912977

PB7 and PC6 on the atmega8u2 can be used as pwm outputs, right?

>> No.1912986

>>1911419
Do it out of PCBs

https://hackaday.com/2015/06/03/how-to-build-beautiful-enclosures-from-fr4-aka-pcbs/

>> No.1913351

>>1912966
>msp430 hold the crown, as far as I am aware.
Microchip PICs with nanoWatt XLP designs are much more low power than TIs offerings.
Even their 18F series can pull much lower current at various running modes.

>> No.1913355

>>1912966
>>1913351
Every MCU manufacturer claims they make the most low power ones.

Clever use of sleep features is much more important than whatever specs the manufacturer give you.

>> No.1913408

>>1912674
cause that's what schools taught them and they are too lazy to switch and learn any other software. Plus their co-workers use it too, so to have it intercompatible, they can't switch.

>> No.1913419
File: 2 KB, 125x79, 1528867997847s.jpg [View same] [iqdb] [saucenao] [google]
1913419

>>1912674
What even is this anyhow? I went straight to Eagle then KiCad, so I wouldn't recognize it, and it's a screenshot for ants, so I can't read any clues.

>> No.1913449

>>1913419
It is proteus, once you know ow to make new components it is a nice software for simulations.

>> No.1913461

>>1912674
Hello sir you are a pieace of shit you stupid ok. Learn electronics and simulation is based on Physical princpiles. Try again.

Rahul

>> No.1913484

>>1913351
>running modes
Because a running pic is shit. PICs are outright bad. It would be far more accurate to measure how much µWh both controllers need to consume for the same computation task.
>>1913355
>sleep modes
These are the ones that matter the most, and msp430 wins this. It's not even a contest.

>> No.1913485

>>1913484
My bet is on the pic taking several times as long, and using up at least three times the power.

>> No.1913527

I'm working on a custom DJ controler with a teensy. I got two questions:
Will I run into power issues ? I got 23 potentiometers + 16 buttons + 2 3 digits display and 30 leds. The teensy got two 3.3v outputs, but I think I might need an external power sources.
Also, any good ideas on how to wire all this mess together ? I was thinking about designing some PCBs but I never did that before and I'd prefer to make a working prototype first.

>> No.1913543

>>1913527
Should be fine, makes sure you use large-ish pots (over 10k).
Look at the regulator on the teensy to see what it is spec'd for, compare that to adding up all your power usage multiplied by 2.

>> No.1913703

>>1913484
>Because a running pic is shit.
This. Trying to program any pre-MIPS PIC is like trying to bang rocks together, and with C it's like banging rocks together with your head in between. At least MSP430 has a decent architecture for C.
>>1913527
LEDs are likely to be your main power problem. If they're single LEDs, put the outputs through a ~1K resistor to a 2N2222 transistor, emitter grounded, and collector to the LED via a ~150 ohm resistor to the same 5V power supply that the 3.3v regulator gets its power from. Don't just drive the LEDs from GPIO pins, this both takes the load off of the pin, and lets you use a different supply voltage for the LEDs.
With addressable LEDs, it should work fine with a 3.3V output pin and a higher supply voltage.
For reference, a monster DJ controller with a bunch of LEDs can easily take 2 amps when all lit up. I know this because I wanted to use a USB to barrel plug wire with one, and wall warts that could provide enough power were quite uncommon in my big box of random USB chargers. A few would light it up, but then it wouldn't get enough power and constantly rebooted.

>> No.1914017

>>1913355
>Every MCU manufacturer claims they make the most low power ones.
Yes, they do, but datasheets give detailed information. I was also being specific about the low power of the msp430 not being the lowest.

>>1913484
>PICs are outright bad
Your opinion, but I don't agree.
msp430 datasheets show a higher current draw in all modes, even while in sleep.

>> No.1914019

>>1914017
https://www.ti.com/lit/pdf/slay015

>> No.1914023

Is 1st gen RPI B 512mb worth 10$? i can get one in good shape but im not sure

>> No.1914037

>>1914023
Hell no, for that you can get a Pi Zero W.

>> No.1914055

>>1910793
Use a-law or u-law.
It's an old audio codec, but you should be able to compress 12bits to 8bits with a respectable loss.
For the linux side, Sox can help you decompress it I guess.

Else, maybe RLE, but it won't compress random waveforms very well.

Lastly (bit I don't know if linux will support it off the shelve), you can store one value and then the difference. You can use like 16bits to store the first sample (with 4bits for the configuration) and signed 8bits for the difference (from -128 to 127).
But again, that's dependent of what you try to compress and if you are willing to lose some data or not.

>> No.1914059

>>1914037
is it any better from 1 B 512mb? they go around the same price where i live i and i could use the ethernet port in some of the projects i want to do with rpi

>> No.1914063

>>1914059
AFAIK they have the same CPU, GPU and RAM with a smaller form factor and on-board wifi, so the Zero W tends to be more versatile for the same specs. You could get an adapter for ethernet to micro-USB if you need to use ethernet cables.

>> No.1914077

>>1914063
>You could get an adapter for ethernet to micro-US
To be fair, isn't the on-board Ethernet (at least in the older Pis) running off of a USB port anyhow?

>> No.1914081

>>1914017
>PICs are outright bad
The ISA is brain dead.
>msp430 datasheets show a higher current draw in all modes, even while in sleep.
You're probably confusing µA with nA and/or ignoring voltage..

>> No.1914084

>>1914017
>>1914019
lmao @ microchip marketing a basically useless sleep mode.

>> No.1914087

>>1914084
What can it do apart from reading an interrupt, anyway?

>> No.1914201

ok retarded question but what do you guys actually do with microcontrollers

>> No.1914206

>>1914201
See how many AVR CPUs I can fit in my anus. Currently got two 328ps and a Mega 2560.

I'm making a quadcopter with a Pi Zero & Arduino Mega.

>> No.1914246

>>1914201
GPS / Satellite modem / LoRa tracking decive, some IOT shit, blink the LEDs, bluetooth shit. hack the planet

>> No.1914255

Is there anything wrong with using the output of an edge detector as a clock signal in an FPGA? I have a data source that I'm toggling a bit for everytime a new sample is received, but I'd like to have a clock source that toggles at that same rate without using any of the PLL/CCC resources.

>> No.1914266
File: 2 KB, 256x64, formula.png [View same] [iqdb] [saucenao] [google]
1914266

using an atmega to generate 200Hz on CTC PWM mode
I used pic related as a formula and solved for OCRnx.
Prescaler N is 1024 and the CPU is 16MHz.
It's 38 in my case meaning that OCR2A tops out at 38.
According to my shitty chinese handheld oscilloscope the frequency is 60Hz though.
Playing around with the OCR2A value doesn't change the frequency but the duty cycle for some odd reason.
How can this be?

>> No.1914291

>>1914266
Are you sure you're in the correct mode? Post your timer initialization code.

>> No.1914295
File: 56 KB, 995x478, ctc.png [View same] [iqdb] [saucenao] [google]
1914295

>>1914291
TIMSK2 |= (1<<OCIE2B)|(1<<OCIE2A)|(1<<TOIE2);
TCCR2A |= (1<<WGM01); //CTC Mode enabled
TCCR2B |= (1 << CS22)|(1<<CS21)|(1<<CS20); //prescale 1024
OCR2A = 38; // 200Hz PWM

perhaps you are right. looking at the register description of TCCR2A there is only WGM21 and WGM20 in the first 2 bits

>> No.1914308

>>1914295
It looks fine. What are you doing in your interrupts? There are also 2 registers OCR2A and OCR2B, each responsible for generating interrupt on compare match.

>> No.1914318

>>1914308
ISR(TIMER2_COMPA_vect) {
PORTD &= ~(1<<PD7);
}

ISR(TIMER2_COMPB_vect) {
if (OCR2B < 5){
PORTD &= ~(1<<PD7);

} else {

PORTD |= (1<<PD7);
}
}

the interrupts just make the Pin go high or low
OCR2A is my calculated value and OCR2B is being controlled by an 8bit ADC

OCR2B is scaled in a way so that if the ADC outputs 255 OCR2B equals 38 so it is a 100% duty cycle

>> No.1914345

>>1914318
This looks like a job for PWM mode, why are you using CTC when you have fixed frequency? There could be a problem with updating OCR2B since if it's lower than counter value it will have to wait for it to reset and you'll miss your compare. Does it also fail when you just toggle the pin in COMPA_vect?

>> No.1914356

>>1914345
I used CTC so I can have the exact desired frequency.
On Fast PWM mode the closest frequency would be 244Hz.
Atleast now it works.

>> No.1914367

>>1914356
I think that's just my oscilloscope being weird or something is wrong with the code. It displays 237Hz and a fwe seconds later 200Hz

>> No.1914393

Let's say I have an 8-bit MCU without an FPU and I need some decimal math. I can do fixed-point, but the resolution I need would require 32 bits. The compiler has implementations for software floating points and extend ints. I know it'll depend on the implementation, but in general, which would be more efficient in terms of compiled size and execution time? Which would be preferred?

>> No.1914409

>>1914019
Very interesting read, but both the TI and Microchip whitepapers are both seriously flawed. Not only do either one pit comparable uC's against each other, but they both twist numbers to look better for their own chip.

>>1914081
>You're probably confusing µA with nA and/or ignoring voltage.
I made it a point to pay attention to prefixes and voltages. TI even tried calling out MC on claiming low voltages, but the data simply wasn't published for multiple aspects, so its a moot point.

>>1914084
>microchip marketing a basically useless sleep mode
How is sleep mode useless? Not to mention a lot of companies market their sleep modes too.

>> No.1914424

>>1914393
You need to do benchmarks, if perf even matters. Does code size matter? Software fpu is going to generate constant size chunk of crt0 routines, just use one float and see how does it grow, won't get worse than this. This also depends on what library have you chosen.

I'd say this. State you limits and how are you hitting them, lets work from there. Do you even hit them? If no why do you care?

Why do you even stick to 8bit? Is that some retro shit or you've already make the pcbs? If no on both then ditch that shit and pickup stm32 the learning curve aint that steep.

>> No.1914431

>>1914393
>>1914424
I missed the actual question.

A quote from stack owerflow
> However, based on my understanding, in processors that do not implement floating point (FP) operations in hardware, a software implementation will typically be10 to 100 times slower(or even worse, if the implementation is bad) than integer operations, which are always implemented in hardware on CPUs.

The answer on integer math depends on your cpu. On z80 i jerk off with it takes 8 instructions to add two 32 bit integers. I can assume yeah, fixed point is faster.

>> No.1914443

>>1914424
>>1914431
Thank you. This was more of a curiosity than anything. I worked with 8-bit in university, and it came up in conversation. I know that integer math is faster than floating in software, but didn't know if the overhead from handling larger than word sized ints would be comparable.

>> No.1914468

>>1914443
Extended integer precision isn't too bad on 8-bits, it's just tedious, and that's the reason for ADC/SBC instructions. Also not all 8-bit CPUs are equal, for instance, the 6502 doesn't have a 16-bit add. And most of the later 8-bits (mostly after Z80 and 8085) have an 8x8 MUL instruction because it's not too complicated, it just takes a lot of transistors.

>> No.1914471
File: 246 KB, 750x832, sad cat pringles.jpg [View same] [iqdb] [saucenao] [google]
1914471

First time on this board, please help a newfag out.
I'm developing a "programmable relay" based on the ESP32 for a college project, which should be controlled through MQTT messages from a web application with a few built in functions (analog read, counters, etc).
The problem is that we decided to change from the Arduino IDE to the ESP-IDF while none of us has a real microcontroller programming background, so we're spending most of our time learning how to use it instead of actually programming stuff, and probably committing a lot of basic mistakes, which is delaying the project a lot.
The firmware isn't really too complex (basically just programming the functions, MQTT connections to send and receive messages through the appropriate topics and interfaces with a few peripherals on the board), but it's supposed to go in a commercial product.
Do you guys think we should just go back to Arduino code and work with it (which could lead into sloppier code, but will probably be doable on time) or soldier on with the IDF (and potentially miss deadlines due to what I mentioned)? I like the IDF, but it doesn't seem like it was wise to use it for this project.
We need to do a small showcase with it by the end of the month.

>> No.1914508

>>1914431
>that do not implement floating point (FP) operations in hardware, a software implementation will typically be10 to 100 times slower
what if you just treat the mantissa like one 8/16-bit integer and the exp/sign bits like another?

>> No.1914509
File: 412 KB, 2000x2000, 8709d530b43aa9a3.jpg [View same] [iqdb] [saucenao] [google]
1914509

For low-latency audio effects (think guitar pedals), is the ARM Cortex M7 as good as it gets? Or would I have more freedom in writing my effects with something more powerful? Brand new to all of this so just trying to get my bearings

>> No.1914510

>>1914201
CV out and button array for a synth
pulse generator for an RF project

>> No.1914533

>>1914509
go hang out with some synth people. You want analog.

>> No.1914550

>>1914471
no one will know it's arduino when compiled. if that's what you need to use to meet your deadlines than use it.
Also there's no reason you can't write "neat" arduino code, its just C/C++ libraries. Write compartmentalized logic in C files and call them from the main INO with imported headers. To keep it clean, dont use loads of globals with extern declarations high interdependence

>> No.1914572

>>1914533
Analog is fine for some things but for the really fancy weird effects (harmonizing pitch shifters, freeze, synth patches), MCUs are the standard now in the industry

>> No.1914728

>>1914508
You will be just writing fp logic in C instead of asm as crt0 does.

>> No.1914729

>>1914572
I'd use this as an opportunity to finally figure out what FPGAs are about

>> No.1914751

>>1914508
>what if you just treat the mantissa like one 8/16-bit integer and the exp/sign bits like another?
look into fixed point arithmetic

>> No.1914797

I thought this was going to be straight forward thing, basically trying to take the color data from the GCP dot and control a RBG LED with it.

I am using a ESP 32.

The data I am looking for appears to be inside a .js file. I have no idea how to get it.

http://global-mind.org/gcpdot/

>> No.1914951

>>1914509
An ARM M7 won't do a lot of good for you if you don't have a proper ADC and DAC.
Look into micro controllers with DCI interfaces and get some high speed audio grade ADC and DAC chips, either 16 or 24 bits.
Audio is a deep rabbit hole to jump down, so good luck. You may even consider looking into a DSP instead of a normal microcontroller.

>> No.1914963

>>1914797
You basically have to issue a GET request in same format as
>xhr.open("GET", this.dataSource + (this.retrieveCurrentMinute?'?current=1&':'?') + nonce='+Math.round(Math.random()*10000000), true);
or
>http://global-mind.org/gcpdot/gcpindex.php?nonce=7588566
Server will respond with

<gcpstats>
<serverTime>1600802472</serverTime>
<ss><s t='1600802460'>0.9633955</s><s t='1600802461'...

You then color your dot based on values in
var colors = [
{ tail : 0.00, mc : this.dotImages[1] },
{ tail : 0.01, mc : this.dotImages[2] },
{ tail : 0.05, mc : this.dotImages[3] },
{ tail : 0.08, mc : this.dotImages[4] },
{ tail : 0.15, mc : this.dotImages[5] },
{ tail : 0.23, mc : this.dotImages[6] },
{ tail : 0.30, mc : this.dotImages[7] },

which correspond to colors
dotElements : [
{id: 'gcpdot0', color1: '#CDCDCD', color2: '#505050'},
{id: 'gcpdot1', color1: '#FFA8C0', color2: '#FF0064'},
{id: 'gcpdot2', color1: '#FF1E1E', color2: '#840607'},
{id: 'gcpdot3', color1: '#FFB82E', color2: '#C95E00'},
{id: 'gcpdot4', color1: '#FFD517', color2: '#C69000'},
{id: 'gcpdot5', color1: '#FFFA40', color2: '#C6C300'},
{id: 'gcpdot6', color1: '#F9FA00', color2: '#B0CC00'},

The reason why this is a bit complicated because dot is being animated for changes, as server sends you back stream of value changes, browser is then rendering it back. This is done to prevent making too much requests. If you don't care about animations just get latest value and color your LED using color1 according to colors table. But don't overload the server with many requests to avoid parsing the whole packet, make requests once per minute or less often.

>> No.1914983

>>1914963
Do you have further reading on this?

See I am getting lost on just the Wifi steps.

Like to create an ESP that I could first connect to and enter in the wifi info, and I also want to add in an internet clock.

This is all from arduino IDE, I have started thinking about using micropy instead.

>> No.1915001

>>1914983
>Do you have further reading on this?
This is a complex task if you don't know the basics of networking and how your computer communicates with servers. You'll have to learn about protocols, packets, request types, security, different data formats such as XML, how to parse them... It's knowledge gained with time, there is no way to learn all of this in a day.

>See I am getting lost on just the Wifi steps.
>Like to create an ESP that I could first connect to and enter in the wifi info, and I also want to add in an internet clock.
You'll need to run your ESP in access point mode and go from there. Then you'll need to run a HTTP server on your esp and write a simple web interface to enter wifi info. This is where you'll need to learn how requests work and how to build web pages with forms that are processed on your ESP server. It's a lot of work for seemingly simple task, so don't get discouraged if you feel like a retard and have no idea what you're doing. This seems to be a good introduction on how to do all of that:
>https://lastminuteengineers.com/creating-esp8266-web-server-arduino-ide/

>I have started thinking about using micropy instead.
Python should be a bit easier to deal with than C++/Arduino based environment. NodeMcu is also beginner friendly, but it's lua instead of python.

>> No.1915025

>>1914963
Why couldn't I say check the color in a 20 by 20 px space in the circle and then set a variable to that? Is it possible to do a headless browser? I have been seeing articles and selenium.

>> No.1915304

>>1914409
>TI even tried calling out MC on claiming low voltages, but the data simply wasn't published for multiple aspects, so its a moot point.
TI tested them on the bench...
>How is sleep mode useless?
They managed to make a literally useless sleep mode, just to be able to claim "look at how little power this sleep mode uses". But it's useless. Like, what a fucking joke. It's so useless you'd rather just cut power to the pic and then it uses 0nA. Not even the BOR is left functional. It will take 1ms to wake up because it needs to get its state from elsewhere. It's ridiculous.

>> No.1915315

>>1915025
It would be possible, but not on ESP, you'll need to run your own server to do that.

>> No.1915447

>>1914509
You definitely want an FPGA. Lattice has some with open source toolchains.

>> No.1915778

>>1914509
>think guitar pedals
How about figure out what you're trying to do first. There is a lot of variation in computational complexity between different effects. For most that will be way overkill unless your implementation is absolutely terrible.
>>1915447
I dunno, I think a half decent microcontroller will outperform any of those smaller FPGAs in terms of signal processing. The FPGAs will be better for simple tasks at low latency, but audio is really not that intensive. It's only a few khz, not hard to process with a CPU running at 10s or 100s of mhz despite the audiophile fantasies.

>> No.1917149
File: 2.84 MB, 3264x2448, 20200916_121657.jpg [View same] [iqdb] [saucenao] [google]
1917149

just made a synth from scratch.
With a simple attack decay vca, two xr-2206 osc, hardsync ad 333 + schmitt inverter 40106 and a osc mixer.
the arduino controls digital pots for all notes changes and all other functions using a mcp23017 expander.
midi compatible on a mega board with, on the computer : midi hairless bridge (serial to midi router) and loopmidi as the internal midi router.
Worked well for 2 weeks until I implemented in a hurry a jfet for pitch mod.
I placed it in // with the timing resistors r1 / r2 and shunt the xr-2206 pins to ground... damned. the original plan was to put it in series with the timing digital pots...
That is the result when you hurry with electronics.
Made a thread on electro-music.com developpers corner for anyone interested with the blueprints.

>> No.1917330

>>1917149
Man that's awesome. I've been puttering along at a much more amateur level, but that type of stuff is what I aim to reasonably build in the near future.
I also didn't know about that site, I'll have to check it out.

>> No.1917575

>>1911553
or use an ATX case.. plenty of space and cheaper and a PSU with all needed rails !

>> No.1917577

>>1917330
The project is here with schematics ( work in progress)
and PCB (work in progress, early stage)
https://easyeda.com/rodv92/projects

I am thinking of use an ATX computer case to house it...

>> No.1917704
File: 1.59 MB, 3264x2448, IMG_6759.jpg [View same] [iqdb] [saucenao] [google]
1917704

>>1914201
Controller for step motors drive my telescope

>> No.1917706
File: 1.71 MB, 2448x3264, IMG_6757.jpg [View same] [iqdb] [saucenao] [google]
1917706

>>1917704
here's the remote, printed in phosphorescent PLA on creality E3P

>> No.1917745

>>1917149
amazing. gonna check out right now. thx.

>> No.1917765
File: 39 KB, 1024x1279, formfactors.png [View same] [iqdb] [saucenao] [google]
1917765

>>1917577
>I am thinking of use an ATX computer case to house it...
That seems a bit like overkill. I haven't built a computer in ages, but have you looked at those micro-atx, mini-itx, etc... smaller case enclosures?

>> No.1917881
File: 163 KB, 919x482, Screenshot 2020-09-26 230450.jpg [View same] [iqdb] [saucenao] [google]
1917881

From 328p datasheet
>Actual values are TBD
To be disclosed? What the fug, how can this be in a datasheet?

>> No.1917901

>>1917881
look up revisions and errata. Do you have the latest datasheet?
It's a document made by a human, it can contain mistakes.

>> No.1917985

>>1917901
You're right, the datasheet specific to the 328p is from 2015.
The datasheet for the whole family has had regular revisions since then, and the TBD footnote is absent. The 328p datasheet has some other errors that makes it seem like it was created by deleting the parts related to other uC's, but sloppily, so there's the occasional table that doesn't actually apply to 328p. Pretty scary to a newb like me.

I just had an expectation that a very systematic effort went into verifying the correctness of the documentation. And even if that wasn't the case, any errors would come to the manufacturers attention quickly, what with these devices shipping tens of millions of units and being used in so many places.

What's almost as bad is when a datasheet or application note is obviously written by an ESL. Can these huge corporations really not afford to have a native english speaking engineer

>> No.1917986

>>1917985
*really not afford to have a native english speaking engineer proof read documents that thousands of other engineers are going to base their designs on?

>> No.1918002

>>1917985
> Can these huge corporations really not afford to have a native english speaking engineer proof read documents that thousands of other engineers are going to base their designs on?

This is basically just whining. If Intel fucks up their shit on the regular, there should be zero expectation that anything is 100% correct 100% of the time, let alone some podunk 8 bit MCU.

it's hard, mistakes happen. Be glad the silicon is correct.

>> No.1918017

>>1918002
it's not much to ask for lucid descriptions of how stuff is at least SUPPOSED to work, providing that has to be the easiest part of it all

>> No.1918019

>>1918017
How much did you pay for the chip?

>> No.1918032

>>1918019
Irrelevant, and shitty english wasn't the issue in this case. I did waste an hour trying to figure out what was the matter with the errors in the datasheet related to the 328p's fuse bytes. That amount of time has value equal to a few hundreds of podunk 8 bit MCUs, I suppose.

>> No.1918033

>>1918032
Actually it's quite relevant. You're whining about a 1.50 part.

>> No.1918034

>>1918033
no, read more than one word

>> No.1918036

>>1917881
TBD = to be determined, aka "we don't know for sure yet", so that may have been a preliminary data sheet.
>>1918002
>Be glad the silicon is correct.
Because sometimes it isn't. (And sometimes it's the vendor libraries that are incorrect.)

>> No.1918114

>>1912056
he literally had a meetup with few anons from /g/ and didn't kick anyone in the face even though one of them looked like an absolute faggot
he did have his fist clinched in the photo they took together so idk

>> No.1918117

anyone have any idea why would replacing motors would cause an arduino to reset even though the motors have almost the same spec and i'm providing adequate voltage

>> No.1918226

>>1918117
Sounds like a current issue, check for shorts or for the motors pulling too much juice.

>> No.1918249

>>1917765
i may need to expand. a full analog synthesizer may be big. imagine several +10 eurorack spec. modular synth modules.
but eurracks are more expensive.
but maybe for starters a mini atx would be better to learn how to use space efficiently while laying out the pcb, on the other hand, crammed adjacent traces would increase noise a little bit.

>> No.1918295

>>1918117
>>1918226
Motor windings are coils, could be extra startup current, or even kickback when they turn off. Try a reversed diode across the motor terminals.

>> No.1918391

>code works on arduino
>want to flash it on attiny13 with atmel studio
>simple blink sketch on Pin 6 works
>alter original code a bit to make it work on the attiny13a
>Pin 6 flashes shortly 2 times and then goes low upon pressing the compile button (it's supposed to be a PWM output)
why is this shit so unreliable
i am thinking to just buy a an atmel ice adapter

>> No.1918398

Is there a better way to get into this than the Arduino published Starter Kits? I can feel how overpriced these things are, but I can't find a better alternative.

>> No.1918406

>>1918398
Starter kits are useless, 90% will not end up being used. Come up with a project first, and then shop accordingly. For my experience, best projects are the ones that solve a problem.

>> No.1918438

>>1918391
"this shit" is not unreliable. there is a problem with your setup, whether it be code or the hardware. your job, as someone who wants to do a thing, is to figure out what you did wrong. blaming other people / things is unproductive. Protip: this is also good general life advice.

>> No.1918461

>>1918438
i am just frustrated and out of ideas

>> No.1918522

>>1918406
I disagree they are useless. Having parts is incredibly useful. If they literally have NOTHING, a starter kit at least gives them some shit to have so when they have a project, they might actually have a resistor or capacitor or switch.

>> No.1918527

>>1918034
Oh i did, and I also knew exactly what the issue was when you first posted. That's experience. Now you have that too. You should consider that when I'm telling you to stop whining like a bitch. Get used to it, this is how things are. People make mistakes, your job is to work around them.

>> No.1918538

>>1918406
I concur with >>1918522, but with the caveat that some of the kits are massive rip offs and should be avoided.

>> No.1918551

>>1918391
>atmel studio
There's your problem.
avr-libc good
arduino ok
atmel studio shit
>pin6 flashes shortly then goes low
Use avrdude, FFS.

>> No.1918618

>>1918551
I'm a retard so I use the simpler alternative

>> No.1918652

>>1918618
also I need a compiler

>> No.1918656
File: 38 KB, 825x696, Untitled-1.png [View same] [iqdb] [saucenao] [google]
1918656

I need help troubleshooting this. It's for a very simple 2 channel lamp dimmer with an encoder. It outputs 2 PWM signals and has 3 inputs for an encoder, which for now do nothing.

The problems come with the interrupts, for some reason, when any interrupt is triggered by the encoder the chip seems to reset itself, the variable b for brightness seems to go back to 0, as if the circuit lost power. This only happens when interrupts are enabled, so I'm 100% sure it's not a hardware issue.

Any ideas why are the interrupts messing up everything?

>> No.1918754
File: 8 KB, 687x256, da-fug.png [View same] [iqdb] [saucenao] [google]
1918754

Uh, i'm not familar with the syntax using square brackets here:
> [IDX_SVC] = {<whatever>}

IDC_SVC is from an enum.

I can kinda figure out what it's doing, but I'd like to know what this syntax is actually called, soi can google it. I tried looking through C/C++ syntax for square brackets but couldn't find anything so far.

It's from the esp-idf examples:
https://github.com/espressif/esp-idf/tree/release/v3.3/examples/bluetooth/gatt_server_service_table/main

>> No.1918785

>>1918117
ground bounce from the noisy motor. Put a 0.1uF capacitor across the terminals right at the motor.
Also make sure you have a flywheel diode in place.

>> No.1918793

>>1918656
if you're using arduino use the arduino methods for setting up interrupts.
using raw registers bypasses the SDK and any state it might by have. if the vector table is superseded by the SDK declaration over the isr you are trying to declare it will fail since when the isr is called it wasn't enabled properly.

>> No.1918796

>>1918656
>>1918793
forgot to mention, its common for SDK's to declare all interrupts internally and call a user handler. if the handler isn't set up yet it constitutes an invalid state and calls the reset handler. which looks like is happening in your case.

>> No.1918872

>>1918785
>cap and diode across motor terminals
how would that work for bidirectional motor

>> No.1918876
File: 6 KB, 396x360, 1580290971117.png [View same] [iqdb] [saucenao] [google]
1918876

>>1918872
diodes are for the driver side, capacitor is for the terminals of the motor.

>> No.1918880

>>1918656
Use avr-libc if you want to touch the hardware directly.
Interrupts and shitduino SDK do not fit together.

>> No.1918967
File: 1.08 MB, 4000x3000, IMG_20200925_212935.jpg [View same] [iqdb] [saucenao] [google]
1918967

>>1918793
>>1918796
>>1918880
Solved the problem, I thought the attiny85 had an ISR for every pin, turns out it only has INT0 and PCINT0_vect, the latter being an interrupt shared by all pins, so as you said, it was resetting as the proper ISR had not been declared yet (see code, I'm using PCINT2, PCINT3... which do not exist)

Idk about using low level code on the arduino compiler before, it's worked fine for me in the past as long as I make stupid mistakes.

Now I just need an elegant way to figure out which way the encoder is rotating after the interrupt is triggered.

>> No.1918972

>>1910159
Why?

>> No.1918984

Do barometric pressure sensors work underwater? If I put one in a submersible robot, could it be used to measure depth?

>> No.1918998

>>1918972
It's safer dealing with commodities.

>> No.1919017
File: 30 KB, 354x230, 1578541429574.jpg [View same] [iqdb] [saucenao] [google]
1919017

>>1918967
interrupt on both encoder pins and look at the levels when the interrupt is fired.
A == HIGH and B == LOW means one direction.
B == HIGH and A == LOW means the other direction

>> No.1919019

>>1918984
the enclosure you put the sensor in has to be compressible to allow the water to compress the air.
do it wrong and the readings will be off.

>> No.1919021

>>1910159
If you use anything other than symbiflow stack, you're hopelessly tied to your vendor's FPGAs and tools.

>> No.1919025

KimChi-x is gonna steamroll these little mscs

>> No.1919388

how do I remove the factory prescaler in an avr?
the CLKPR register doesnt really do anything

>> No.1919519

>>1919388
Are you using avr-libc?

>> No.1919635

I'm trying to get an rpm measure from a PAS sensor, it gives off pulses of different length depending on direction of rotation
I've managed to make an interrupt based tach that simply adds to a counter every pulse, but it's not enough
How can I make it work with direction also?

>> No.1919642
File: 31 KB, 1024x768, 5807458526_dc54025065_b.jpg [View same] [iqdb] [saucenao] [google]
1919642

>>1919017
I just used one interrupt on one pin for the rising edge. When triggered just read the other pin, LOW is CW and HIGH is CCW.

>> No.1919645

>>1919635
You shouldn't judge on the pulse length, but rather on time between rising/falling edge cycles

>> No.1919647

>>1919388
You mean the "divide by 8"? You can disable it through the fuses, you'll need a serial programmer like USBasp and avrdude.
Steps:
>Search "how to download and install avrdude", do it
>Google "AVR fuse calculator" (engbedded)
>Select your uC
>Deselect the "divide clock by 8" box
>Copy the arguments
>Open cmd window and type this:
avrdude.exe -p (your uC name e.g: attiny85) -c (your programmer name e.g: usbasp) (paste arguments here)
>connect your ISP to the computer and to your uC
>press enter, avrdude will burn the fuses to your uC
Easy and simple :^). If you mess up the chip can brick and you'll need a high voltage programmer to unfuck it.

>> No.1919650

>>1919647
Beware you can brick your shit if done wrong

>> No.1919655
File: 918 KB, 4000x3000, IMG_20200929_121646.jpg [View same] [iqdb] [saucenao] [google]
1919655

>>1919650
Nah, I've never bricked one even with my shitty pogo-pin alternative.

>> No.1919751 [DELETED] 

thanks but I'm getting an error message: programmer type must be written as "id_type"
whatever that means

>> No.1919753

>>1919647
thanks but I'm getting an error message: programmer type must be written as "id_type"
whatever that means. i am using the usbasp btw

>> No.1919917
File: 118 KB, 1050x848, 2020-09-29-155254_1050x848_scrot.png [View same] [iqdb] [saucenao] [google]
1919917

I'm trying to learn more about embedded programming by reading the source code to various embedded circuit projects.
I'm trying to understand this code from an open source digital oscilloscope
https://github.com/ardyesp/DLO-138/blob/master/capture.ino

the microcontroller it runs on is an STM32, which I thought was Arm-based. However, the assembly language it's using appears to be an Intel assembly. What's going on there?

>> No.1919960

>>1919917
the op codes would be different, not necessarily the ASM. I'm too lay to look it up to prove / disprove it.

>> No.1919985

>>1908717
What the other guy said. "Arduino" is just a glorified breakout board.

And I didn't even know there were knockoff raspis but I'd imagine ARM processors are the expensive part so that may be the reason price is not that different.

>> No.1920007
File: 27 KB, 200x200, 1516052058406.gif [View same] [iqdb] [saucenao] [google]
1920007

>>1919917
>It seems you are trying to use a gcc project!
That's GNU assembler. The 'gas' assembler and gcc prefer to use its own snowflake mnemonics for EVERY chip out there. If you're lucky (like on m68k) something resembling the original manufacturer mnemonics are also available.

>> No.1920018
File: 9 KB, 375x210, _93872527_xx65--269.jpg [View same] [iqdb] [saucenao] [google]
1920018

>>1919753
I just did this like 2 days ago from a new computer and worked fine, I'm using avrdude version 6.3, check that you have the correct drivers installed for your usbasp and it's working properly (libusb 3.0.7 with zadig), also check the jumpers. There's a jumper you have to short out when working with slow clocks or something, can't remember, I've been keeping it shorted as far as I can remember.

Idk, google around if nothing works, I remember getting it to work was a very big pain in the butt for me when I first had to figure it out, that's why I helped you, so you don't suffer like I did. But you should be almost there.

>> No.1920028

>>1920007
ah christ so if I want to program my stm32 in assembly for performance reasons, I need to learn some weird ghetto GCC assembly instead of ARM assembly?

>> No.1920031

>>1920028
You could check to see if it has ARM-ish mnemonics. In that case, whoever wrote what you found was a total faggot for unironically using GNU mnemonics.
If so, there would be minor differences like registers being %R5 instead of R5.

>> No.1920034

>>1920007
based clippy

>> No.1920039

>>1920007
>>1920028
>>1920031
>The 'gas' assembler and gcc prefer to use its own snowflake mnemonics for EVERY chip out there.
nah, that asm volatile block is straight arm ISA. the %[] stuff is for interaction with C code variables.
see https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html
you don't need it if your C function only uses assembly and returns void, only if you want to mix C and assembly and get data in/out of the asm block.
The reason for this is to avoid "clobbering" registers in volatile asm blocks since the compiler doesn't verify it's legitimacy. you could manually push/ pop registers to the stack and manually make sure the stack size is correct but adding it to the clobber list is easier and less prone to bugs.

>> No.1920107

>>1920039
>is straight arm ISA
Damn was I on drugs or what, I saw the cbz and my brain broke. Must have been chewing on too many cocks.
HOWEVER, that's not going to be ARM code, it's going to be Thumb, since Cortex M1 is thumb-only.

>> No.1920131

>>1911710
I use the clear segmented flat Walmart tackle boxes for simple components.

>> No.1920138
File: 343 KB, 455x455, 6e7.png [View same] [iqdb] [saucenao] [google]
1920138

>>1911710
I once just got a company that made generic enclosures to send me a sample pack, had maybe 6 different sizes and shapes and other accessories.

>> No.1920372

what would be a good, inexpensive FPGA for a beginner?
My digital circuits lab (if it were in person, it's all online and we're using simulators) uses the
Basys 3 Artix-7. It's about the only FPGA I know about. It runs about $150 but I think I can technically write it off on my taxes.

Is that a good board? Any others any of you would recommend?

>> No.1920409

>>1914201
i get paid to make stuff

>> No.1920412

>>1914509
which effects a lot are analog and some cant be done without DSP...a lot of stuff was done on 8 bit mcus and can still be done , poeple ar gullible and dont know what good sound is since its all subjective

today they use fpga-s most of the time as dedicated DSP processors

>> No.1920544
File: 25 KB, 500x500, XC95144.jpg [View same] [iqdb] [saucenao] [google]
1920544

I'm trying to figure out a board that uses a 100 pin Xilinx CPLD and I've managed to basically find what each pin on all the connectors on the board do, where they go ,etc.
Now, one of the connectors had 2 pairs of pins coming from the CPLD through an RS422 driver and 5 pairs going to the CPLD through an RS422 decoder.
After much messing around and rewiring shit, I've figured out which pairs are RXD, TXD, CTS and RTS and have wired the board up to an RS422 to USB converter.
I know it's correct now cause when I type stuff into the serial terminal it feeds me back what I'm typing, every other combination of pairs didn't do that.

Anyway, I've no fucking idea what kind of commands to give this board, it doesn't print anything to serial on boot up and everything I've tried entering so far doesn't give me any response.

Is there anything like a dictionary attack of something that could keep feeding in random commands until it gets a response?

In case you're wondering, the board is not from a mass produced commercial product and the company that made the board has been bought by a company that is a direct competitor to the company that manufactured the unit so nobody wants to help anybody out with it.

>> No.1920641
File: 172 KB, 1113x648, 1583845553364.png [View same] [iqdb] [saucenao] [google]
1920641

>>1920372
https://www.digikey.com/products/en/development-boards-kits-programmers/evaluation-boards-embedded-complex-logic-fpga-cpld/796?FV=-8%7C796%2C183%7C34909
Parametric searches are your friend

>> No.1920647

>>1920544
datasheet will have that information.

Make sure you are sending the expected terminator ('\r', '\n', or '\r\n') or whatever it expects.

basically the datasheet should show the format of the command and what commands to send (e.g. like AT commands)

>> No.1920817

>>1920647
datasheet for what?
The actual CPLD?
I would have assumed that with a CPLD, they would have to create their own serial commands

>> No.1920864

>>1920372
DE0-Nano - Altera Cyclone IV FPGA starter board
I used this one when I got into FPGAs. Its small but has a ton of pins broken out at 0.1" headers.

>> No.1920866

>>1918117
connecting/disconnecting either inductors or capacitors to live wires will alawys cause current/voltage spikes which can destroy/reset microcontrollers ...add protection diodes or do it while powered down always

>> No.1920878

>>1920817
you would. FPGA's and CPLD's are just a bunch of configurable macrocells. Generally if you don't want to code it yourself you buy/download an IP block for that interface.
in >>1920544 case there's probably a standard usb block and a standard rs232 block and the dev just pipes data from one to the other all in VHDL.

>> No.1920952
File: 225 KB, 1440x1466, Screenshot_20201001-092934.jpg [View same] [iqdb] [saucenao] [google]
1920952

Will this work with a 5v usb connection.

>For light strips that run on 12V to 24V

Obviously not getting a 12v strip for a usb connection but I don't see why it wouldn't work with a 5v strip with a 5v power supply.

>Why not get a 5v

This is the only one I can find that ships free and it's 1.13/each for six. I could buy 5v from shenzhen but I'm not in the business of waiting until November.

>> No.1920969

>>1920952
The little fucker inside has a switching voltage regulator/booster that expects certain voltage range. They're like small cpus. 5v simply won't turn them on.

>> No.1921004
File: 61 KB, 539x541, cover10__01.jpg [View same] [iqdb] [saucenao] [google]
1921004

>>1920969

So it's not even worth trying. Fuck.

>> No.1921016

>>1921004
>>1920952
it literally says on the thing its made for 12-24 volts i dont understand your logic behind thinking it would work on 5V....you can add a step up boost converter that boosts 5V to 12V but that depends on how much current your USB can source or rather how much power your led strip will need

>> No.1921056
File: 236 KB, 1440x1513, Screenshot_20201001-134309.jpg [View same] [iqdb] [saucenao] [google]
1921056

>>1921016
Sorry, I'm not very into the technical side of electronics. I just figured that if it can handle 12v it can handle 5v. I didn't know 5v would literally make it not work.

The seller share has picture related which tripped me up thinking it could work.

>> No.1921125

I have an I^2C SSD1306 OLED display. I haven't played with it too much, but it's very, very slow. I want as near-real-time as possible out of the display.
There are SPI equivalents of the same display, and I've been told SPI is significantly faster than the I^2C version. But there's a lot more pin.

Is it much more difficult to program with SPI? I'm very new to embedded stuff so I'm afraid of the jump.

>> No.1921129

When you #include a library, does the preprocessor include the entire library? Or does it just copy in the functions I call and their requisite dependencies?

>> No.1921139

>>1921125
SPI is much simpler than I2C. It's even simpler than serial. It's just transferring bits from one register to the other.

>>1921129
It depends on your compiler and linker configuration. Compiler has to compile everything if it's dealing with separate compile units as it has no idea what is used where, linker then decides what goes in the final executable. But again this depends on your compiler and is probably written somewhere in the manual. For GCC you have to use -ffunction-sections flag to enable compiling functions in to separate sections, so linker can remove them with –gc-sections flag.

>> No.1921144

>>1920878
>rs232 block
RS232 is a physical standard for communicating with +/- differential voltages.
I believe you are thinking about a UART interface block with AT style commands.

>> No.1921147

>>1921139
>SPI
>It's even simpler than serial
Serial Peripheral Interface
what.

>>1921125
>But there's a lot more pin
I2C needs 2 pins, one for the data and one for the clock. SPI is 3. One for data, one for clock, and one for Chip Select (or Enable as some call it). SPI only needs one extra pin and always transfers more data than I2C at the same clock speed.
Parallel is incredibly faster, but that requires a lot more hardware connections to work.

>> No.1921351

>>1921125
The big problem with I2C for displays even that small is that it's a slow protocol. Usually it's only 100Kbps. Sometimes you can kick it up to 400kbps, but that's about it.
The main thing about SPI is that it's more trouble to hook up a lot of different stuff to the *same* pins. At the very least you need a separate chip select for each device. And your MCU probably only has one or two SPI units max, so you can't just throw more GPIOs at it.
Talking to it is really easy if your MCU has a SPI unit, it's shifting bits, kind of like those shift registers that get used all the time with Arduino stuff. It's also not too hard to bit bang it.

>>1921129
>When you #include a library
It reads through the .h file and processes whatever is in that particular file, which is going to be mostly declarations of external stuff. The code is in a separate file (.c, .o, .lib, whatever) and that isn't used until it's time to link the compiled code together.

>> No.1921362
File: 996 KB, 1920x1080, 1570417159315.png [View same] [iqdb] [saucenao] [google]
1921362

>>1920372
Anything iCE40 based, as that has the best and most mature support with the open stack; it all started with project icestorm.
Good cheap as fuck boards for this include the tinyfpga bx and the blackice mx.
>My digital circuits lab (if it were in person, it's all online and we're using simulators) uses the Basys 3 Artix-7. It's about the only FPGA I know about. It runs about $150 but I think I can technically write it off on my taxes.
If you think you need it to follow the classes, get it. The open stack has some (incomplete) support for artix7 thanks to project xray, so the fpga chip is not a terrible choice.
If it's for messing with verilog on your own, ice advice above all the way.
And, if you want something more high end while still on $150 budget, see ULX3S, based on ECP5, supported by (and board is made for) project trellis. The second best fpga family in support on open stack.

>> No.1921363

>>1921147
>what.
Yes it is. Clock is on a dedicated wire. Much easier than an UART.

>> No.1921479

>>1921125
You can pull off 60fps on those

>> No.1921526

>>1921479
how so

>> No.1921531

>>1921526
You need to switch to SPI i presume, and those support quite fast frequencies

>> No.1921532

>>1921363
You said that serial was easier than SPI.
Serial is easier than Serial Peripheral Interface?
Did you mean its easier than UART?

>> No.1921533

>>1921531
Oh shit lol I thought you meant on IIC. Got it, I'll buy an SPI screen to play with

>> No.1921535

>>1921532
not him but people usually mean UART when they say serial ....spi and i2c and one wire are all serial but they are usually called by their name

>> No.1921575

If this is the wrong thread, I apologize, but it seems like a question someone here might know the answer to.

I want a way to convert between 72VDC inputs to a computer, and vice versa. The actual computer doesn't matter so much specifically, it can be a raspberry pi, a laptop, whatever, as long as I can shove some C++ in there. From what research I have done, it seems like the vast majority of I/O boards are made for either extremely low voltages (3.3VDC), or higher but still pretty low voltages (24VDC). Is there such a thing as a 72VDC I/O board?

>> No.1921590

>>1921575
DC-DC converters that deliver a lower voltage are called step-down converters, or buck converters. Although 72V to 5V sounds bad, it may not be efficient and you will have to find a converter that accepts at least 72VDC

>> No.1921595

>>1921575
72 seens dangerous, where its from?
If its DC you cannot use transformer, but you can also try 50k/3k voltage divider, followed by an opto-isolator.

Dont kys

>> No.1921597

>>1921575
Are you talking about powering the computer with 72Vdc, or using a 72Vdc logic signal for communication?
To power it, it would me a matter of finding a DC/DC buck converter to drop the voltage to the safe power voltage.
Communication is a bit more difficult, but manageable. For inputs to the computer, you can utilize zener diodes and the appropriate resistors to get the voltage down to manageable levels, and run the signal through an optoisolator so the 72Vdc doesn't accidentally jump to the computer. Outputs would simply be a matter of using an open-collector type setup so the computer can use its normal logic levels to drive some transistor that can deal with the higher voltage.

>> No.1921602

>>1921595
>72 seens dangerous, where its from?
Agreed. DC over 50V is a danger of arcs and shit because no zero-crossings like AC. I remember that 110VDC knife switch video I saw on YouTube. That's why telco battery power is 48V.

>> No.1921627

>>1921590
I was considering using relays to step up / down, but if there's a less bulky/expensive solution (I'm not 100% sure off the top of my head but I believe I'm looking at around 48 wires, which is an awful lot of relays), I'd prefer to go with that.

>>1921595
>72 seens dangerous, where its from?
Trainline bundle. I can't pick the voltage it uses.

>>1921597
>Are you talking about powering the computer with 72Vdc, or using a 72Vdc logic signal for communication?
Communication.
> For inputs to the computer, you can utilize zener diodes and the appropriate resistors to get the voltage down to manageable levels, and run the signal through an optoisolator so the 72Vdc doesn't accidentally jump to the computer. Outputs would simply be a matter of using an open-collector type setup so the computer can use its normal logic levels to drive some transistor that can deal with the higher voltage.
This seems like a decent proposal, still a lot more work than using a premade board but potentially more convenient than relays. Not sure how it'll compare price-wise but I'll poke around and see what I can find. Thanks, anon.

>> No.1921632

Does anyone know of a 3.3 V to 5 V level shifter with a lot of outputs? I want to interface a Z80 with an FPGA, but I can't find a module with more than like 4 outputs.

>> No.1921729
File: 21 KB, 369x185, mosfet_level_converter.jpg [View same] [iqdb] [saucenao] [google]
1921729

>>1921632
you want something done right, do it yourself
the one with the most outputs is the one you can build yourself out of 2n7000 mosfets, works beautifully and is infinitely scalable, 2n7000s are stupid cheap, get them from aliexpress or ebay or whatever

you just need an ams1117 3.3v regulator for the 3.3v source

>> No.1921769

>>1921632
TXS0108E? It got 8 outputs.

>> No.1921839

>>1921769
Nice find, thanks.

>>1921729
That could work. The main problem is I'd need to put together at least 24 of that circuit, so I'd need to get a PCB for it.

>> No.1921860

>>1921729
74LVC245

>> No.1922052

>>1921729
Not him, but hmmm... I recall having a problem talking to a HUB75 LED panel from an STM32. Those fuckers run on 5V and its CMOS chips want Vih to be at least 70% or so, which is just a little above 3.3v. So some of the pixels would be a bit jumpy, like every now and then a shift got missed or something. I tried slapping an HCT buffer in the middle, but it didn't help. I probably just got it wrong, but I ran out of time and stopped messing with it.
I have a bunch of SOT-23 2N7002 transistors (they say 702 or 1702) that came from pick-and-place rejects (dropped parts that got vacuumed up every month or two, and the guy was cool and gave me the bag), so I'm going to try this when I get back to that project.

>> No.1922697

Can anybody tell me what I need to do to make my oled screen interface with my avr328p using i2c?
I have used some arduino libraries but I want to try it from scratch with atmel studio.. I'm not really sure how to start.

>> No.1922702

>>1922697
First, off I'd use the baby arduino way just to check if everything on the hardware side is correct. It's extremely helpful for troubleshooting later that you don't have a bad connection or anything.

For the software start by finding out the controller name and look up its data sheet.

>> No.1922705
File: 1.69 MB, 4000x1824, IMG_20201003_163230.jpg [View same] [iqdb] [saucenao] [google]
1922705

>>1922702
Oh yeah, I finished the project but I did it all in arduino and it works. I'm just trying to do it from scratch for learning purposes

>> No.1922712
File: 101 KB, 600x535, 1257658564777.jpg [View same] [iqdb] [saucenao] [google]
1922712

>>1922705
If you want to do it from scratch, first you have to invent the universe.

>> No.1922714

>>1922712
ok brb

>> No.1922741

>>1922705
Well you'd have to ditch arduino and open up datasheets for both display and the MCU

>> No.1922763

>>1922741
Well I can't ditch the arduino, but I'm currently programming with avr GCC and the datasheets

>> No.1922774

>>1922763
> libraries, not the literal hardware

>> No.1922787

>>1922774
Oops

>> No.1922835

>>1921575
What exactly is it you are interfacing with ? 72V DC is a very weird standard to be using for communication but i never looked at train standards anyways....is it digital or analog signals from sensors ?


Anyways using relays for step down conversion is neither practical nor smart....basically interfacing two different level voltages like that is done with opto/galvanic isolation between the circuits ...idk if there is a 72V to 5V opto isolator boars but i never searched for it so try find some....thats in case your communication is digital...also you will need some controller board that will translate the comms and turn it into a PC or whatever friendly protocol to be read like RS 232 or something..for that you need an MCU and a rs232 controller IC

If your signal is analog like from a sensor then you need an aqusition board that has an adc , MCU and again com protocol ic of choice...all of those will require a software to interface with the boards

Basically not trivial stuff and you have given extremely sparse information to be able to help more

>> No.1922948

>>1908720
This is correct. knockoff raspis are almost all android pieces of shit that have no driver documentation and mean you can run android apps, but that's about it.
Chink arduinos are basically the same thing, but be a little careful when you buy. I bought some NodeMCU boards with an ESP8266 on it for wifi, but the pinouts are all fucked.
Can confirm that the chink arduino nano boards are awesome.

>> No.1923300

call me retarded, but I can't figure it out. I got one of those 7-pin SPI OLED displays, and can't for the life of me figure out how to wire it up to an STM32. This is my first time trying to use SPI.
The display pins are GND, VCC (I know what those do, obviously), then D0, D1, RES, DC, and CS.
The pins labeled "SPI" on the STM32 pinout are SS, SCK, MISO, and MOSI. What goes to what?

>> No.1923302

>>1923300
>D0, D1
Are you sure those aren't DO and DI?
You don't understand RES or CS?
The only remaining one is DC which is probably "data clock".
>M
>S
pay reparations shitlord

>> No.1923304

>>1923300
Google what SPI pin names mean. Make SOME effort.

>> No.1923313

>>1923304
>>1923302
it's not like I'm sitting around with my thumb up my ass, I'm trying
Yes it's D0 and D1. I've set D0 to MISO and D1 to MOSI for shits and giggles because that's about the best I can figure out. SS is hooked up to CS, and now I'm trying to figure out what to connect the display reset pin to on the stm32

>> No.1923323

>>1923313
Most of the time you have to read the datasheet for the item you're intending to work with.
Stuff lick which pin is what on the SPI protocol is specified there. It is made like so, becuase your display supports several protocols.

Assuming you have SSD1306 driver, you'll need to google datasheet for it. Beware that you might be chinked and the driver could be SH1106 (i have drivers for both handy https://github.com/desertkun/SH1106 and https://github.com/desertkun/ssd1306_no_1k))

>> No.1923326

>>1923313
shorted reset to ground let's see what happens

>> No.1923333

>>1923323
I feel like an asshat asking in here because usually I *would* just read the display's datasheet, but since it's just a generic chink (alleged) SSD1306 display, it didn't come with one and now I have to figure it out myself, on top of never having used SPI before.

I'll check and see if it's actually an SSD1306 display

>> No.1923334

>>1923313
post the display model number ideally picture of display. as >>1923323 said the answer will be on the datasheet of the driver.

>> No.1923454

Anons, have you tried one of these ?

https://hackaday.com/2020/08/07/odyssey-is-a-x86-computer-packing-an-arduino-along-for-the-trip/

>> No.1923462

>>1920372
https://www.aliexpress.com/wholesale?SearchText=icesugar

>> No.1923628
File: 1.65 MB, 3279x2459, screen.jpg [View same] [iqdb] [saucenao] [google]
1923628

Anyone recognize what the fuck is happening here? I can't tell if it's the cable, the port, or something with the screen itself. Only happens after the pi boots.

>> No.1923629
File: 992 KB, 1920x1080, screen the webm 2.webm [View same] [iqdb] [saucenao] [google]
1923629

>>1923628
here it is in webm form

>> No.1923633

>>1923628
>>1923629
looks like a /g/ questio

>> No.1923639

>>1923628
>>1923629
nvm fixed it by switching from 75hz to 60hz

>> No.1923640

>>1923628
jesus, what am i even looking at?
Are you trying to run gmod on an RPI? is it native or through wine?
looks like a driver absolutely shitting itself.

>> No.1923692

I only have 1 UART module but I need to tx bytes to 4 different MCUs at different times (no tx collisions will occur). Can I use a shift register to route my tx pin to a given MCU or will that fuck with timing?

>> No.1923717

>>1923692
why not create a "wrapper" protocol where you send (address, data) packets, and each MCU knows its own address? i.e. a software-only solution.

>> No.1923728

>>1923717
The master controller MCU would, I assume, need to have its tx pin connected to every slave MCU's rx pin for this to work. In this case would only a given addressed slave MCU be responding to the master MCU?

>> No.1923730

>>1923728
I.e. would the master MCU be tx-ing bytes to every slave (and all but one slave would ignore a give transmission?)

>> No.1923732

>>1923728
well hold on there, you never said anything about the slaves responding back to the master MCU...

>>1923730
yes, that's the idea.

>> No.1923737

>>1923728
Now that I think, why not use I2C to facilitate communication between one master and many slaves?

The I2C protocol was specifically designed for this use case. Most MCUs these days come with an I2C peripheral that can be configured in either Master or Slave mode - You could configure the Master MCU to be a Master I2C agent, and the others as slaves.

Typically you can configure the Slave I2C address from the software, to make sure there are no address collisions.

>> No.1923747

>>1923692
Sounds like a job for RS-485, with an address byte at the start of each data message of course. Bonus: electrically it's very robust, for instance gas stations use it to communicate to the pumps.
>>1923737
I2C is fine if it's all in one pile. If you get more than a foot or two apart, forget it.

>> No.1923753

>>1923737
I've honestly only ever used UART. I'd be interested in trying it out but based on what >>1923747 is saying, it might not work, given that slave MCUs might be dozens of feet from one another.

>>1923747
I'd be very interested in trying RS-485 (with address byte). Again, something I've never really attempted. I need to read up on the standard more.


One more caveat is that I need to send 12V along with data. I was honestly thinking of either using CAT5 or a DB9->adapter. I.e. just using the form factor for power + communications.

Thoughts?

>> No.1923755

>>1923753
I meant to say DB9 -> serial adapter

>> No.1923801

Hey dudes. Can I have some recommendations for courses or books? I have experience with C and arduino, I'm trying to get off the arduino tools atm and I'm so damn lost.

>> No.1923849

>>1923753
>One more caveat is that I need to send 12V along with data. I was honestly thinking of either using CAT5 or a DB9->adapter. I.e. just using the form factor for power + communications.
Are you the one who made the other topic about operating a 12v solenoid with PoE?
Sending data over wires that over more than about 3 meters should use RS-485. It uses a differential signal to help with noise over long distances. I've used RS-485 to transmit data from a controller device to 12 different slave boxes hooked up at various points over a common 100m ethernet cable run. Its quite robust.
As far as power, you can send a decent bit of power, but you will need to use DC/DC converters.
Like PoE, you can boost the 12v to 48v and run the 48v across ethernet cables, then buck it back down to 12v at the end. Transmitting high voltage/low current is better than low voltage/high current. This way if you supply 48v at 500ma, you can buck it down to 12v at 2A (realisticly less because of buck/boost efficiency) at the end point.

>> No.1923931

I'm writing a path generation algorithm for a glider. I want it to plan a path down to a final designated position when I flip a switch, but I'm having issues. This problem is easy in 2D because there's no height 'budget'.

In 3D, I have to consider how much space (altitude) it has to perform manoeuvres, which drastically changes path generation and even the way it will follow this path.

I was thinking to work out the descent/ascent rates for different manoeuvres, but this changes depending on wind.
It seem like the path it generates cant be completed once, that it must be continuously changed, but I feel like I should be able to generate some basic path and just modify some aspect of it.

Some paper I read uses the second last manoeuvre as an 'energy management' one, where it spirals down before a final approach turn. I think maybe this would be good enough, but I want it to land really accurately.
If I use the energy management one, I have 3 motions I guess.
1. Initial turn towards EM manoeuvre (uses initial heading to EM circle tangent)
2. EM manoeuvre
3. Final approach
Does anyone have any ideas? I want to assume that I'm not modifying the pitch significantly, I want it to be relatively level.

>> No.1923999

>>1923849
Yeah I'm the anon. Thanks for this info, much appreciated. I'm going to give RS-485 a shot. I'm obviously pretty new, but looking to improve. Especially in larger systems involving multiple MCUs. Power systems book just arrived so im going to gice that a read today.

>> No.1924006

>>1923931
This shit is too broad. We can help you with setting a register and that's about it

>> No.1924282

>>1923753
https://hackaday.com/2017/02/08/taking-the-leap-off-board-an-introduction-to-i2c-over-long-wires/
http://www.nxp.com/docs/en/application-note/AN11075.pdf

>> No.1924323

>>1908786
Holy based

>> No.1924468

>>1923753
>>1923728
>>1923692
>>1923999
if you're doing master<-->slave comms over long distances you could try this.
https://www.analog.com/media/en/technical-documentation/data-sheets/LTC6820.pdf
or of you prefer i2c try
https://www.nxp.com/docs/en/data-sheet/PCA9615.pdf

is there any reason you need to send power to the device over the comms and can't derive power at the device location. I hope you're not trying to run a solenoid off just that raw 12V without some serious bulk otherwise current sourcing from the inductance will be a problem

>> No.1924586

>>1924468
RS-485 is best for this situation because it was designed for what the anon is doing. Using specialty chips to use SPI or I2C over a long distance twisted pair is just adding an extra level of complexity.
Power can be sent just fine, as well as proper protection and regulation for the inductive load from the solenoid. Especially if the solenoid is only about 18 watts. The most limiting thing would be how often the solenoid could be activated over time.

>> No.1924610

new when

>> No.1924638

>>1924586
Been there, did I2C with up to ~60 devices and a translator to bring it to a second box (60 devices takes a lot of space). I think we used the PCA9615. It's not for the faint of heart, and the worst problem we had was if devices got hot-plugged, somehow a glitch from the 24VDC power bus hit would hit a random I2C input pin and BTFO it. They don't work so good after that, it's no fun to have to re-solder a QFP100 if the main CPU gets hit.
The PCA9615 worked by somehow splitting the I2C comms into seprate directions and running them over balanced pairs (sort of like two RS-485 pairs, only talking I2C). It was a hell of a rube goldberg setup and I was coding poll loops for it as through it was all RS-485 anyhow. Would not recommend doing that stunt crap with I2C.
Unfortunately the decision to go with I2C was made before I got hired, but even then I wouldn't have expected the hot plug problem.

>> No.1924653

>>1924652
>>1924652
>>1924652
>>1924652
>>1924652

>> No.1924663

>>1924653
>page 8
this isn't /v/, faggot
on slow boards you wait until page 10

>> No.1924666

>>1924663
suck my fat nuts

>> No.1925168

Hey guys, I need help looking for a datasheets for the stm32f446re.. I think I found one but it seems more like an overview than a datasheet.

>> No.1925179

>>1925168
I found them... To other newbies st calls the datasheets reference manuals.

>> No.1925259

>>1924663
Faggot