[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/diy/ - Do It Yourself

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • There are 81 posters in this thread.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]




File: 2481ee09f4a88641.jpg (53 KB, 640x480)
53 KB
53 KB JPG
Previous thread:>>2367609
Here we discuss microcontrollers, SBCs and microcontroller accessories, such as Atmel AVR and attinys (Arduinos), ARM boards such as blue/black pill STM32, ESP32, RPI, and others.

For general electronics questions (power supplies, level shifting, motor control, etc.) please ask /ohm/.

>where can I find verified quality microcontrollers and other electronic sensors or parts
digikey.com
mouser.com
arrow.com
newark.com

>but that's too expensive
aliexpress.com
lcsc.com

>I need a part that does X and Y, with Z specifications. How can I find it?
use digikey or mouser's parametric part search. Then purchase from one of the sellers listed above.

>how do I get started with microcontrollers, where should I start?
There is no defined starting point, grab a book and start reading or buy an arduino off ebay/amazon and start messing around. There are a plethora of examples online to get started.

>resources:
https://github.com/kitspace/awesome-electronics
>>
Inb4 avrlibc is better than Arduino's stuff.
>>
>>2386802
arduino core uses arvlibc
>>
does anybody know if it's safe to buy a blue or black pill? how likely are they to be counterfeit?
>>
>>2386943
STM32F103C8T6s have been mostly fake for a while now, and it's even worse with the IC shortage now. The ICs themselves are really going up in price so if the dev-board costs less than the IC on LCSC or digi-key it's likely fake. That said, the clone ICs like GD32s and such are actually probably fine, if you buy from a listing that has plenty of purchases you'll likely get something more or less usable. Pull the part ID off it once you get it, if it reads as an inferior part you may be able to get money back from a dispute.

See also:
https://github.com/keirf/Greaseweazle/wiki/STM32-Fakes
>>
>>2386973
damn, honestly sounds like I'm better off buying a nucleo on digikey or mouser. I've seen some trust worthy eBay listings, but it costs the same as a nucleo so what's the point.
>>
>>2386535
Have you thought about using an RTOS that manages USB automatically.
Zephyr iirc works fine with sam, assuming your processor is on the list.
>>
>want to program for attiny1614
>follow https://github.com/vladbelous/tinyAVR_gcc_setup
>try writing simple code
>compiler doesn't recognise PORTB
what the fuck do i need to import and how would i know to do so
>>
>>2387050
#include <avr/portpins.h>

download atmel studio
>>
>>2387152
>atmel studio
is that any better than mplab?
>>
>>2387152
>>2387177
Turns out I needed to call #include <avr/iotn1614.h>, because the io.h didn't call it like it automatically does for MCUs it knows about. Just edited my copy of io.h to include them, hope it doesn't reset itself on any updates.
>>
>>2387194
>clock rate is 7 times lower than expected
uhh
>try to program fuses the same as the arduino ide does
>now 12 times lower
uuuhhhhh
>>
File: HP85B.jpg (197 KB, 1540x850)
197 KB
197 KB JPG
Ok, Ive returned from last thread, this time I brought pictures.
I thought about using a Raspberry PI Pico to "emulate" a HP85/HP86 Basic computer, mainly as a boot to basic HPIB controller (because original machines are super expensive).
There is already a running Basic on Pico called MMBasic, but its a Microsoft Basic Port and doesnt have all the functions that HP Basic has, mainly graphing stuff.
Does anybody here have any experience with either those HP machines or other parts of this project? Any links or books I can read to help me?
>>
>>2387259
Id argue the hardest part, a working boot-to-basic computer on the Pico, is already done, now I have to do:
1.Implementing missing HP Basic prompts in MMBasic
2.Add a GPIB port to the Pico and implement sending/receiving data from it
3.Build a case and putting it all together

Would it be easier to use the GPIO on the Pico to "simulate" a GPIB port, or to use a real controller chip and implement TTL communication?
>>
Dumb question, hope someone can help:
I have an ESP32-cam (needed a MCU with an SD reader and this is what I have on hand), and I would like it to either zero or format any SD card connected to it.
I've tried googling for lots of terms, "esp/arduino format SD card" but all I can find is guides that happen to mention formatting SD cards on a computer so you can use them on your micro, not how to format them on the micro itself.
Most of the libraries also seemingly only allow for file modification, not writing to the raw block device to erase everything.
I don't care if there's no filesystem left on the card, just zeroing it is enough, but zeroing or formatting are both acceptable.
Hoping someone can point me in the right direction or give me he right terms to google.
Anyway, thanks anons!
>>
>>2387384
>Arduino sd card block device raw write
should get you what you want, I'm sure you know how to count to 10,000 in a for loop, yeah?
>>
>>2387194
attiny1614 is the newer attiny's?
I think I had problem with those because older avr-gcc and avr-libc didn't have support for the new attiny devices.
>>
>>2386990
Using the asf3 usb stack.
I think it's problem with the usb enumeration.
>>
>>2386764
So I bought a tackle box full of vintage electronic components, and this was inside. Any anon have an idea what the guy was making?
>>
>>2387486
Closeup
>>
>>2387486
That's what you do when you have to find somewhere to put all your resistors, and you're too much of a kid to know how to find good storage containers.
At least he was using proper oldskool 22ga wire, and not those gay jumper connectors with the stamped pins.
>>
>>2387430
>attiny1614 is the newer attiny's?
Yeah, it doesn't support them. I followed that github link >>2387050 which got me able to set it up by taking files from MPLABX (and an Atmel download) and putting them in the right folders. Also altering io.h, which works fine now. Except the whole clock thing.

Definitely worth going for the newer AVRs from a price and capability perspective, but they're a right pain to get programmed, especially if you're not using Atmel Studio or MPLAB along with a PicKit 4 or Atmel ICE. Those things are expensive. I just use a diy CH340G-based programmer. MPLAB would be more appealing if it actually had MCU-specific suggestions and stuff, but as is it doesn't even recognise PORTB so it's literally less intuitive than notepad and AVRdude and hand-written makefiles.

I think there may be ways to hijack the Arduino environment's compiler and the requisite "core" (MegaTinyCore in this case), but I've almost got this working and convenient. Again, except for the clock not being correct. That or it's taking like 10 cycles to write a const to PORTB.
>>
>write blink code on arduino ide
>write blink code in a text editor
>basically the same code
>runs 7 times slower when not going through arduino ide (clock rate? idk)
>use avrdude to dump the memory of my avr for each
>jumble of utf-8 nonreadable characters
>both very different
Uuh, is there any way i could reformat this into machine code, whatever format it is? And then convert it into ASM that I can cross-reference with the AVR assembly guide? If nobody has any bright ideas I'll just try to parse it in python.
>>
>>2388061
The word you are looking for is "disassembler". And it's not trivial to make a good one that can identify code vs data tables in a .bin, but it's not so bad if you have a .o file or a .elf with debug symbols, there are tools in gnu for that.
>>
>>2388061
use `objdump -d` on the .elf file. but i suspect that won't help you. post source code this instant or be forever cursed with slow led blinking.
>>
>>2388061
this problem can be easily solved by checking the "use external editor" option in the tarduino ide. it locks their editor so you can edit the same file with something else. then you just use it to upload the code
>>
>>2386764
thats what their called? i have some microcontrollers in my house i try to kill but theyre so fast (many legs)
how do you outrun a mixrocontroller??
>>
File: sauce.png (154 KB, 862x914)
154 KB
154 KB PNG
>>2388066
I'll look into that, but it does sound like a pain. Note also that they look very different to the original .hex file generated by the compiler, though maybe the formats are completely different. I'll maybe see about changing the makefile to generate a binary or whatever instead.

>>2388161
Pic related. The doubled instances of PORTB.OUT are to try and measure the number of cycles without having to worry about the while loop. 99% sure that writing 0x00 to those two clock registers does nothing. Also I'm writing the fuses:
>-U osccfg:w:0x02:m -U syscfg1:w:0x04:m -U bootend:w:0x00:m
With AVRdude since that's what the Arduino IDE says it does when I turned it to verbose mode.

>>2388256
>use external editor
Ah that's how that works. I'll definitely try that, thanks!

>>2388262
FPGSpray
>>
>>2388406
i don't know how it is in arduino-land and i can't be fucked to do my homework to look up those register definitions.

but i know this 100% in stm32-land: if you configure to use an external clock say, and there is no external clock attached on the output, the MCU will fall back to using the internal oscillator.

What this means is, the code will be compiled assuming you're running the core at, say 100 mhz, but in practice you are running at 20mhz. consequently things like delay_ms() are out of whack.

regarding your image: is that the slow version, or the fast version? is that using "arduino ide", or the "text editor"? and what is the difference between these, in the context of your particular setup? and could you post the other version, which is slower/faster than that which you posted there?

some more thoughts (you may know more about this than me): I'm pretty sure F_CPU is only informational in arduino-land. what I mean is, by setting F_CPU, you are telling the runtime to assume that the core is running at F_CPU, and it won't actually _set_ the core to run at F_CPU. but don't quote me on that.
>>
>>2388406
more ideas: are you building with -O0 optimisations vs -O2 in the alternative? I recall that the avr-gcc compiler is not guaranteed to compile correct code under -O0, which is the defeault optimisation level if you don't provide -O2 explicitly.
>>
File: makefile.png (169 KB, 1660x796)
169 KB
169 KB PNG
>>2388418
I'm using -Os, which is for minimum size IIRC. I copied the makefile from an ATmega32U4 tutorial and tweaked it to fit. 90% of the shit in the makefile goes over my head so I've been trying to keep it as-is, though it may well be my issue.
>>
>>2388443
that MCU - is that your actual MCU? for some reason I was thinking you were using a standard atmega328p.
this is hard to debug without a clear side-by-side comparison of the two project files.
>>
>>2388443
>>2388453
as in, my understanding of your issue is that you have two project files: one you cooked up yourself, and one that is using existing infrastructure - and they don't both behave identically, right?
>>
File: Ardycode.png (64 KB, 742x532)
64 KB
64 KB PNG
>>2388414
I'm setting it to use the 20MHz internal oscillator anyhow. I don't think I'm set to a different clock, because the time ratios are somewhat far from being powers of 2. And I'm not using delay functions at all to get rid of that variable, just looking at the time between transitions.
May swap to using VPORTB.IN instead of PORTB.OUT, because that's just a simple toggle and so may require even less cycles.

The previous image is the slow one, the one in my text editor.
Pic related is from the Arduino IDE, the fast one. While I know there are some small differences in how the actual C code looks once you get to main(), they're just things like checking for a serial connection and such, which should if anything make it a few cycles slower. Not an order of magnitude faster.

>F_CPU is only informational in arduino-land
It was included in the mega32U4 example and I don't think it did anything there either. Maybe it does, but I'm writing the clock control registers and clock setting fuses at startup anyhow, so I don't think it's an issue either way. I just set it to 20M instead of 16M. Well I say that but I can't figure out how to read back the fuses (-U syscfg1:r:filename.txt gives me a 1 byte text file I can't read).

>>2388453
>>2388454
Yeah they both look very similar but behave differently. Both for the same micro, both program onto it through the same programming system in AVRdude, but I think the compiler and actual compat files are probably somewhat different. I copied the iotn1614.h and other files from microchip/atmel files, while the arduino core may not be using the same ones. And who knows about how it generates a makefile. Might have a dig about through the Arduino IDE's program files later.

I guess I can try using a 328p to see if that's any different between its Arduino code and direct text edit compiler code.
>>
>>2388463
well my immediate impulse is that youre doing lots of "clever stuff", with the clkcntrl registers and the fuse bits. what's the reasoning for it? was it just copied or do you have a particular clock configuration?
if you just want your version to run as fast as the arduino IDE version, I'd try programming it once with the Arduino IDE (which presumably also sets the fuses to some sane defaults), and then drop the fuse options (and the clkcntrl register modifications) from your project. and see if that brings it back up to par.
>>
>>2388406
ok dude i just did some readin, and i think ive found the issue.

i see what youre doing now. this gadget has a 20MHz internal clock and you have to select the MUX to use it. but you have to bust the fuse to get it, ok i see youre doing that too.

BUT

These weirdos are saying you HAVE to call the following:
[code]
_PROTECTED_WRITE(CLKCTRL.MCLKCTRLB, 0);
[/code]

heckin sourcerino: https://www.avrfreaks.net/comment/3282006#comment-3282006
>>
File: default-prescaler.png (19 KB, 697x390)
19 KB
19 KB PNG
>>2388476
your comment of "7 times slower" corresponds very much to the default prescaler values:

http://atmel-studio-doc.s3-website-us-east-1.amazonaws.com/webhelp/GUID-C541EA24-5EC3-41E5-9648-79068F9853C0-en-US-3/index.html?GUID-0BE52C09-9CE9-49AC-B6EC-251CC050CBE6
>>
File: clk-output-pin.png (67 KB, 904x1296)
67 KB
67 KB PNG
>>2388477
Another thing to veriffy: if you have a scope, stick probe on "clkout" pin, and enable it by setting MCLKCTRLA highest bit to 1:

http://atmel-studio-doc.s3-website-us-east-1.amazonaws.com/webhelp/GUID-C541EA24-5EC3-41E5-9648-79068F9853C0-en-US-3/index.html?GUID-0BE52C09-9CE9-49AC-B6EC-251CC050CBE6
>>
>>2388477
>>2388478
just realised those links are identical, im sure you can find it in the sidebar, its all under
"CLKCNTRL - Clock Controller"
on the sidebar on the left.
>>
>>2388471
>was it just copied or do you have a particular clock configuration?
Fuse bits are copied verbatim from what the Arduino IDE does. The 0x00 writes were just me reading through the registers and thinking that it wouldn't hurt.
>drop the fuse options
I tried it before setting the fuses. the clock might have been different (can't quite remember) to what it is with the fuse bits set, but it definitely wasn't correct either.

>>2388476
>you HAVE to call the following
That's kinda strange, considering I have to write it to 0x00. But looking at it closer I see there are default is set to 0x11, which explains it. If I'd looked closer and saw that 6x was a possible divider I'd have given it more thought.

Anyhow, it's 100ns between transitions with that change (two clock cycles at 20MHz), which is identical to how it acts with the Arduino IDE. Thanks a whole bunch.

>The clock prescaler is always enabled after a reset
>set to 6 times slower
WHO THOUGHT THIS WAS A GOOD IDEA

>>2388477
Yeah that 3.3MHz looks real familiar. So does the 2.7, maybe, it may have been what I was seeing before trying to set the fuse bits.

>>2388478
Not on the SOIC-14 you can't.
>>
hi! I'm not sure what I'm doing, it's mostly just an experiment/excercize but how can i make my dehumidifier smarter? Currently it just runs at full blast, I'd like to set it at some percent of humidity and have it maintain it. atleast as a lower bound.

Their is a peltier device and a fan, and I'm going to do some pwm on the fan. I know nothing about pid, but I guess with some sensors I could pid controll the fan? how do I even correlate the pwm to the humidity ?
>>
>>2388573
>peltier device
Is it a small model? The compressor ones, while noisier and bulkier, are significantly more efficient. That means less heat put into the room, which may not be a significant issue.

>how do I even correlate the pwm to the humidity
Two options. One is open-loop, just have a dial from 0 to 10, and adjust it manually when it gets too high or low for your liking. The other is to use an actual humidity sensor like a DHT11. I'd recommend the latter. PID algorithms are fairly straightforward, and there should be some good youtube results for how each of the three elements works. Implementing them on a microcontroller isn't trivial, but it shouldn't be too difficult if you understand programming, calculus, and how to get code onto a microcontroller. Considering the integral part you may want to figure out how to do a ring buffer, which probably means pointers.

Personally I'd want to have a display (7-segment or LCD/OLED matrix) for the current and set humidities, and also have a maximum fan loudness potentiometer or encoder. If you could get analog humidity sensors (maybe you can, idk, think they need temperature compensation) you'd be able to do the whole thing with a few op-amps, displays notwithstanding.
>>
File: en.BD_STM32G081.jpg (500 KB, 700x786)
500 KB
500 KB JPG
Last year i got an STM32G081RBT6 as a present. I thought to finally make use of it and order a corresponding nucleo board to get myself started.
However seeing pic related connectivity diagram, it can only use usb as power source and not as a regular usb to pc connection? If yes, can i still fiddle my way around it, or am i better suited to get something like an STM32F303xx, if i likely wanna start with something that eventually will send keystrokes or sensor results to a pc via usb?
>>
>>2388813
>inc. BMC + PHY
translation: battery managment controller and physical layer

so your device will work over USB. it also supports power delivery which is a special usb c protocol for delivering like 50W of power over usb to charge batteries or high power systems
>>
>>2388813
>Last year i got an STM32G081RBT6 as a present
And it was a raw MCU, not on a board? What kind of autistic christmas does your family have?
>>
>>2389147
>What kind of autistic christmas does your family have?
Not him, but maybe one of those family or friends who actually have conversations, and say things like, "so, anon, what would you like for christmas?"
>>
>>2388831
Thanks! I was getting a bit confused by some post on the stm forum talking about a missing usb stack, but i probably have to do some more reading before i can run anything at all.

>>2389147
Touch grass. It was a tongue in cheek present from a senior and yes it's untouched in a small oem enclosure.
>>
>>2389156
Yeah but nobody I know would A: be confidant enough that what they're buying is the correct one in such an unknown landscape, B: consider a $5-10 microcontroller a good gift.

>>2389157
>It was a tongue in cheek present from a senior
Ah, that's kinda what I was thinking. As people in the hobby then I could understand giving away surplus parts, especially if you're both the sort of people for whom having an assortment of parts is reason to use those parts. I am one such person, though I can't say I have friends who aren't above my level or below it. Or friends at all, for that matter. Does it show?

Me calling it an autistic christmas and implying it was from a family member was just me making a haha funny 4chan moment.
>>
>compiler tries to put my lookup tables in forbidden memory
ok what the shit (attiny1614 retard here again)
i thought i had this damn thing sorted
yes i'm using const, and adding PROGMEM doesn't help because the tiny-1 series has progmem as a part of its normal memory addresses

picrel, also:
>SRAM goes from 0x3800 to 0x3FFF
>progmem goes from 0x8000 to 0xBFFF
no clue where the compiler gets its addresses from, maybe it's the wrong place or the file is broken.
>>
>>2389369
Ok... so to start with, here's what you can do.

For illustration, I've got the following very simple file, called `1.c`:
[code]
#include <stdlib.h>
#include <stdio.h>

const char __attribute__((section(".mysection"))) mytable[] = {'a', 'b', 'c', 'd'};

int main() {
printf("Hello World\n");
return 0;
}
[/code]

Now I build it:
$ cc -o 1.o 1.c

Now I link it:
$ cc -o 1.elf 1.o

Now, the object file doesn't have any addresses associated with the symbols in the file (since it isn't linked). We can verify this by running `nm` on the file, as follows:

$ nm 1.o
U _GLOBAL_OFFSET_TABLE_
0000000000000000 T main
0000000000000000 R mytable
U puts

To see what addresses the linker gave each symbol, one can run `nm` on the linked .elf file as follows:

$ nm 1.elf | egrep 'main|mytable'
U __libc_start_main@@GLIBC_2.2.5
000000000000063a T main
00000000000006f0 R mytable

Notice the `egrep`, otherwise the output is very noisy.

Can you run `avr-nm` on your linked file (the ".obj")? Try to find any addresses that look weird.

Also, you generally don't want to call your final linked file ".obj" - ".obj" usually implies its an object file, not a linked binary. The file type on linux by default is an ELF file, even for embedded MCUs - ELF files are really just industry-standard containers for linked objects (i.e. "binaries".) Turning it into a hex file that is consumable by an MCU is typically referred to as turning the ELF file into a "flat binary".
>>
Bro i've been trying to make a lightmeter using a TEMT6000 sensor. It's basically a PNP transistor with a 10k resistor on it. It measures the current coming out as the "light value".
Would changing the resistor to another value make it more/less sensitive to light?
>>
>>2389697

Looking at this data sheet from Sparkfun, they show it going up to what looks like 0.5 milliamp, which would be 5 volts across 10k, which looks pretty optimized. If you are measuring extremely (whatever that means) bright light you might need a smaller resistor since the maximum Vcc is 6 volts. I'd try it with the 10k and my light conditions and see if it's acceptable. If you are measuring low light conditions a larger resistor would give you more sensitivity but would saturate at a lower light level. As is, it goes up to 1000 lx which wikipedia says is like an overcast day, or typical TV studio lighting.

On the other extreme, if you are measuring direct sunlight (32 to 100 thousand lx) you could try a lower resistor and find out what level of light maxes out the sensor, which might be in that pdf but I don't see it.

https://www.sparkfun.com/datasheets/Sensors/Imaging/TEMT6000.pdf
>>
>>2389726
wrong image...
>>
>>2389369
i don't know much, but mayby theirs some compiler optimization fuckery?
>>
File: Actual memory addresses.png (119 KB, 726x1308)
119 KB
119 KB PNG
>>2389640
I'm a bit too much of a brainlet for that anon, not to mention a brainlet with a 2015 crapple stevetop. The first command "cc -o 1.o 1.c" isn't working unless I change it from "cc" to "avr-gcc", saying that:
>argument to 'section' attribute is not valid for this target: mach-o section specifier requires a segment and section separated by a comma
Not sure what to make of that. Running nm on it before trying to link gives me no "U " anything, "puts" is after a "T".
With the avr-gcc it builds, but I can't link it into a .elf file with avr-gcc, saying:
>cannot use executable file '1.o' as input to a link
When I try to just use gcc or cc I get:
>attempting to link with file built for unknown-unsupported file format
>Undefined symbols for architecture x86_64
>ld: symbol(s) not found for architecture x86_64

Absolutely flying blind here. I'm guessing you're trying to get me to figure out whether it's a problem in the building or the linking processes? I don't even know what a linker is, man.

>>2389726
I think for bright lights a photodiode may be better. As in, just use any old LED lying about. Have like 3 of them with different resistors for autoranging.

>>2389771
I've tried all the optimisation methods, pretty sure it's deeper than anything in my makefile. One step in the making process (linker I guess) should be referencing the memory address offsets inside the ATtiny1614's part files, but evidently it's not doing so correctly. Pretty sure it's getting those from iotn1614.h, but now that I look at it all I see is:
># define PROGMEM_START (0x0000)
Which seems distinctly unusual. Compared to:
># define EEPROM_START (0x1400)
># define INTERNAL_SRAM_START (0x3800)
Both of which are correct, pic related.
I think I'll try editing the iotn1614.h to set the value to 0x8000 (or maybe BOOTEND? append?) to see if my file builds.
>>
>>2389914
forget about the 1.c shit, i was being overly autistic. literlaly just run

avr-nm <name-of-your-obj-file>

it will show you the address associated with each symbol. or should, anyway.
>>
>>2389914
Wait nevermind, it says:
>#if (defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
># define PROGMEM_START (0x0000)
># define PROGMEM_SIZE (16384)
But it also says:
#if (defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
# define MAPPED_PROGMEM_START (0x8000)
# define MAPPED_PROGMEM_SIZE (16384)
# define MAPPED_PROGMEM_PAGE_SIZE (64)
And:
>#if (defined(__ASSEMBLER__) || defined(__IAR_SYSTEMS_ASM__))
># define PROGMEM_START (0x0000)
># define PROGMEM_SIZE (16384)
># define PROGMEM_PAGE_SIZE (64)
I don't really get this file, looks like a lot of things being defined more than once. I guess I could modify the 0x0000 anyhow. Maybe avr-gcc is too retarded to know that the newer AVRs have progmem inside the normal address space?

>>2389916
>literlaly just run
>avr-nm <name-of-your-obj-file>
The main.o? Did that, got picrelated at the bottom. Think it's the same as just running nm without the -avr. Nothing much interesting above pic.
I see a lot more 00000000s than I'd expect. Is it retarded? Because that sounds bad.
>>
>>2389921
>I see a lot more 00000000s than I'd expect. Is it retarded? Because that sounds bad.
ok, so that means that was probably the object file.

There is a file, which is the "final binary". it is the culmination of all the object files - I don't know what its called on your filesystem. it is the file that you feed directly (or indirectly) to the programmer.

could you try running avr-nm on that?
>>
>>2389921
Those #defines are only for the C code. The linker uses its own config files to generate the code. If you're lucky, some guy named them something obvious like projectname.lnk but it might be somewhere in the forest of files used by the IDE. If you can get the actual command line for the linker you might be able to figure it out.
>>
>>2389926
My makefile does that part for me using "make program", so I'm not really sure what file it is. Had to faff about in order to even get main.o. The file itself is here: >>2388443. Looks like main.c goes to main.obj, which then goes to main.hex. Running nm on the hex file gives nothing.

>>2389969
>Those #defines are only for the C code
Oh, so even trying to define what memory locations I'm using in the C code won't work?
There are only three files that I had to add to the system for it to work with the tiny1614. Plus an auto-generated one, where the only potentialy relevant line is:
>*cc1_n_flash:
> %{!mn-flash=*:-mn-flash=1}"
The other files are the iotn1614.h and a couple of non-human-readable files:
>libattiny1614.a
>crtattiny1614.o
Chances are that .o is relevant here, but I can't make heads or tails of it. There's nothing with a .lnk extension.

I also added the files libc.a and libm.a.

This is arguably a similar problem: https://www.avrfreaks.net/forum/attiny-1-series-flash-mapped-ram-and-problem-calculating-program-space
And Johan's post here looks handy too:
https://www.avrfreaks.net/forum/lss-files-0
>>
>>2389986
>Oh, so even trying to define what memory locations I'm using in the C code won't work?
What I mean is that the linker doesn't know shit about those, so changing them will absolutely not change the layout of your code. It only tells the C code what it should think the world looks like.
>>
>>2389986
>>2389996
The linker is what assembles your final program (usually an ELF [Executable and Linkable Format]), which is where the different sections are "placed" in the correct spot. For example, for some target with executable flash @ address 0x1000, you'd place `.text` there, then `.data` in SRAM (some other address) etcetera. It seems that your program is having sections placed in arbitrary locations or incorrect spots. I'd try and find your linker script, then post it here for us to inspect.
>>
ok tomorrow i'm biting the bullet, deleting mplabx and installing microchip avr studio 7 for avr and microchip sam avr devices avr
never using avr-gcc again
gnu made me do this

maybe there'll be support for the tiny1614 and other new avrxmega3 devices in 5 years or so
>>
>>2390120
>avr studio 7
it uses avr-gcc though.
>>
>>2390120
>windows only
JUST
>>
>>2390120
i had to do the same with new SAM chips as they were the only ones available at the time. convinced my company to a 1000 of them so we never run out. the devices we make arent for mass production so that number lasts like 5+ years
>>
how do i actually get into embedded? the most i ever did was write a crappy SPI message passing program for an msp430 but i had no idea what i was doing, it was only for some moon rover thing
i'd like to actually get into embedded and start doing some cool shit with it
>>
>>2390717
>insufficient disc space to reinstall mplabx
this ssd is on its last legs i swear
>>
>>2390120
>>2391377
i am really confused why you are writing your own makefiles etc. when you're using mplabx, which is an integrated development environment? this just seems strange. or are you a different anon to the one who just recently had the clock division issue?

normally you let the IDE manage your project files. You would start a new project, tell it your chip, and you're off to the races. I believe mplabx may also offer automatic peripheral initialisation akin to stm32cubemx.

i have to say the more you post about your project the more i become confused. I was under the impression you weren't using any IDE and doing everything old-school, which is fair enough. but infact you were using mplabx? and directly modifying the makefiles it generated?
>>
>>2391381
I wasn't using mplabx, I just had it installed incidentally and occasionally flicked to it for reference. It's also where I got the MCU-specific library files for following that github guide on how to get avr-gcc to compile the newer series of MCUs, which is why I mentioned it.
Only now am I going to attempt to use mplabx to compile programs. The software itself is a fucking mess though, none of the kind of syntax highlighting of correct registers and functions that I'd expect. Maybe I'm using it wrong, I don't know. Couldn't find an internal register list or pinout or other kind of interactive datasheet for a given MCU either. In addition, I'll have to use avrdude to program the MCU anyhow, since I don't have an Atmel ICE or PicKit 4 to program using any ide aside from tarduino.
Now I'll program in mplabx or a text editor, use mplabx to compile it, and then use avrdude to flash the .hex. Might be able to automate that uploading step if mplabx offers support for 3rd party scripts.

Also Ben Heck's "getting started with the tiny-1 series" video shows him having the exact same clock issue, the one with the prescaler set to 6, shoulda watched that first I guess.
>>
>>2391388
I see... why not use Atmel studio? it is for Atmel chips after all
>>
>>2391394
see: >>2390717
>windows only
I'd use it if I could, Ben Heck says it's a lot better and that wouldn't surprise me.
>>
>>2391401
i still think you should try to get your old makefile project working. i'm almost certain its a minor issue with either a flag or a misplaced parameter that is triggering the linker issue. can you anonymize your project and upload it somewhere?
>>
>>2391416
The addresses it's trying to write to are wrong. Considering all the files it would get that information from are directly from mplabx, the only likely fault is in avr-gcc itself. I imagine that would be since it's not used to seeing MCUs that have progmem in the same memory address space as everything else. Just no clue where to even begin from here.
>>
how do I find a job in this field? there's not much positions open for interns that aren't fang shit.

I liked to use indeed but it's full of scams, I've switched to linkedin and that's better but theirs not a lot of results for embedded and especially for interns.
>>
Working with an stm32 in the Arduino ecosystem

Let's say I have 3 buttons connected to pins 1, 2, and 3.
I wanted to attach interrupts to all three, and have a function like "buttonHandler(int whichButton)" which would update a "buttonState[3]" array, but apparently an ISR can't take any arguments (???)
What then are you supposed to do? It sounds dumb as hell to have to make individual separate but nearly identical functions to handle 3 buttons
>>
>>2393578
>but apparently an ISR can't take any arguments
ISR call is triggered by hardware, you can't pass arguments to it. What happens when for example you press the button is
>you have configured an interrupt that will trigger when signal changes
>when signal changes special hardware in MCU will request CPU to stop executing main code and jump to special address (ISR function)
>once ISR function finishes it will jump back and resume executing main code
Detecting which button was pressed depends on type of the interrupt, some work with individual pins, others with whole port or multiple pins.
>What then are you supposed to do?
ISR_pin1 () {
buttonHandler(1);
}

ISR_pin2 () {
buttonHandler(2);
}

ISR_pin3 () {
buttonHandler(3);
}

There is no other way if you want to handle interrupts separately. If you for example changed your interrupt to that of a pin change then you could detect multiple buttons (if pins are handled with same interrupt hardware), but then you would have to determine which one was pressed by reading its value manually. There is nothing wrong with first approach even if it looks "ugly", don't try to apply software abstraction on this level, because you are dealing with physical hardware and you can't abstract away reality of hardware implementation. Interrupt signal generators are literally physical circuits on chips that you can configure with software.
>>
>>2392481
>that aren't fang shit.
do you mean generalist swe or a specific embedded role?
hard to be picky when you're an intern
>>
>>2394417
There just may not be a market for embedded where you live. If you're csci and not ee probably much less likely to get hired as well.
>>
was mcg always this dead or did everyone fuck off to webdev already
>>
got myself a basys 3 board to finally fuck around with FPGAs
is there like some series of exercises or projects i should work through with this thing to get familiar with vivado and fpgas in general?

i can't even say "let me just run through and implement everything in verilog by example" since i don't even know how to get this thing working
>>
Any recommendations for microcontrollers with bluetooth interfaces? Right now I'm thinking an ESP32 since I've heard the name before. I'd like to keep things small; would I save space rolling my own PCB antenna rather than using a module?

The application is an open source fitness band modelled after the OpenHAK, whose MCU/bluetooth interface is EOL.
>>
>>2394471
When I took an FPGA class, we just made a shitty calculator, and the test bench code was like 5x more work than the calculator itself.
>>
>>2394510
>and the test bench code was like 5x more work than the calculator itself.
as a SWE i vaguely relate. the test code and verifying it works before deploying to production takes much more effort than implementation
>>
File: file.png (771 KB, 1080x1080)
771 KB
771 KB PNG
I bought pic related (k150 pic programmer) but was not able to make it work under windows 10. it seems to be working under xp (that I installed under virtual box)

is this the only way? do I need to pay for a more official programmer (pickit I guess?) if i want to develop under windows 10?
>>
>>2394629
What software are you programming with? It may be an issue with drivers, or it may be an issue with the firmware on the K150 itself. Upgrading the firmware should be doable. If you have a logic analyser or DSO, you can try snooping the comm lines (both the USB ones between the PC and K150, and the ones from the K150 to the PIC) to look for a difference.
>>
File: file.png (23 KB, 635x426)
23 KB
23 KB PNG
>>2394646
this sketchy looking thing. I found it when I googled "k150" and seems to be working, I was able to compile a blinking led (using mplab x ide) and then write the hex binary using this tool

are there any alternatives I can use with this "k150" programmer? I am programming a pic10f202 if that matters
>>
>>2394480
nordic nrf52 mcus
>>
>>2394652
I suspect that software is the issue. As far as I know, there aren't any 3rd party PIC programming software that are open enough to be used with a large variety of user-made programmers, but I could be wrong. Look around for one, be it a full IDE like arduino or just a programming tool like AVRdude.
I'd see about writing your own program to interface with that hardware. What's the USB interface IC on that K150 board? If it's a USB-to-UART converter like an FT232 or CH340 then it will be really easy to interface that with even a high-level language like python. Making a command line program would probably be somewhat easy too, maybe. Same applies to any other class-compliant USB spec, FT232 or similar outputting something synchronous like SPI would be my bet, but I'm not familiar with PIC programming.
If it's a microcontroller using native USB that requires extra drivers, it should still be possible, but I couldn't tell you where to start.

t. retard
>>
>>2394663
Why these?
>>
File: pic.png (7 KB, 318x148)
7 KB
7 KB PNG
I am new with PIC assembly. See pic related

I am not sure how to do GPIO or how to use branches in assembly. Pic related works (at least on the simulator) but looks wrong.

Here I am trying to read value of INPUT_PIN (say a button) and write that to OUTPUT_PIN. So it sets OUTPUT_PIN bit to INPUT_PIN. But that is a lot of operations. Questions

(1) can I just write to GPIO using MOVWF? I am worried that I am "writing" to input pin as well. Or do I have to use bit operations such as BCF/BSF

(2) If I have to use use BCF/BSF on the output pins, is there an simpler way to do pic related?
>>
>>2394866
>But that is a lot of operations
welcome to assembly. as long as all those things like INPUT_PIN are defined correctly, the code looks fine to me.
>>
Someone explain "weak pull up" to me. What exactly it is and how does it work? How can I make PIC wake up from standby using it?

https://ww1.microchip.com/downloads/en/DeviceDoc/40001239F.pdf

If I am reading correctly it should act as an input IO pin and if I pull it to ground then it should wake up. should I leave it open-circuit otherwise? I am trying to make it work but no luck so far
>>
>>2395023
a strong pullup, I suppose, is a low resistance that is harder to overcome than a weak pullup which would be a larger resistance that can be easily overcome by something like a transistor.

it looks like you have to configure weak pullups and wake up on change for the three pins that have that capability and you have to do all three or none. you have to read the pins before entering sleep mode. you use a push button or an open drain or open collector to pull the pin to ground when you want to wake up. there may be other crap but I'm tired of reading the spec for you.
>>
Sorry for the beginner question. There are a lot of these things on the market today that say they "just work" with almost any Bluetooth device in existence. Would it theoretically be possible to interface with one of these with an esp32 microcontroller? I want to learn more about Bluetooth, and my goal is to hook up a microphone as input and speakers as output to create a "Bluetooth headset" that works wherever the dongle is plugged in to (PS4, my Linux PC). I can't find any documentation online for any of these cheap Chinese things. Any documentation or previous projects out there?
>>
>>2394866
I'm more familiar with AVR not so much PIC...looking at https://ww1.microchip.com/downloads/en/DeviceDoc/31029a.pdf, seems like pretty shitty instructions. Maybe someone can correct me, but it looks like for branching you have to use gotos and skips checking the status register after you do some operation. Probably want to look for some idioms somewhere instead of wasting your time figuring that out from scratch.
>>
>>2395334
>checking the status register after you do some operation
That's how assembly language works, anon.
>seems like pretty shitty instructions
Yes, PIC is a janky assembly language, but the rest of the architecture is also why C is so bad on it.
>>
>>2387488
You're still covering the chip numbers.
74xx is a common logic chip family. The one on the end is a 7404 aka hex (6) inverter
https://www.futurlec.com/74/IC7404.shtml

The CD4027BCN chip is a dual flip flop (1 bit memory cell) meaning it can store 2 bits. It appears he is using only one gate of the hex inverter, All the resistors are used to "pull up" logic gate values I'd need the other chip numbers to understand the circuit, but on the edges the short black and short red wires power the chips, other wires conduct logic.
>>
>>2395373
>why C is so bad on it.
This is actually because the company is 110% pajeet at this point...you don't want poos writing your compilers....the best part is they want you to pay for it!
>>
does anybody have some pid examples that aren't Arduino? I know calculus and the logic but my coding isn't too hot.
>>
>>2395500
What are you trying to control? Is your application just a controller or is it doing other things as well?
>>
>>2395530
Controlling a fan based on temperature data
>>
>>2395500
Just spitballing here, but I think you'd just have a continuous sum for I. No need for any complex data structures for that, and you don't need to worry about it overflowing since . For D, a naive approach suggests that just subtracting the previous value from the current value would work, but that wouldn't be very noise immune, so I think you'd want some sort of weighted sum. Perhaps something like:
>1*S(n) - S(n-1)>>1 - S(n-2)>>2 - S(n-3)>>3 - ... - S(n-6)>>6 - S(n-7)>>6
could work. Using factors of 2 like that mean the division is just bit-shifting, which is extra cheap. I suspect the actual weighting of the past values would have to total to 1, but it should be acceptable as slightly less. Either way, for that you'll need a looping data structure, a stack, a FIFO, whatever you call it, so you can increment through data addresses and easily loop back to the beginning. Pretty sure this should be done with memory pointers (or ASM I guess), I think there should be decent tutorials on using memory pointers for arduino that should apply.

As for sampling the ADC, just read the datasheet and follow how it tells you to handle the registers. Use an interrupt for "sampling complete" if you absolutely need to, but otherwise I'd likely find that my code is predictable enough that a little clock cycle optimisation gets me the ADC sample outputs at a good spot with minimal / no wasted cycles.

Also I glanced at this wikipedia article:
https://en.wikipedia.org/wiki/Discrete_calculus
But I didn't get far into it because brain problems. Looks like it may be handy though.

Also you can literally do PID with a quad op-amp IC. A dual op-amp IC even, if you don't mind it being near-impossible to tune after part selection. Plus a dual comparator for "triangle" wave generation and PWM.
>>
>>2395552
>bit shifts on 4chan
Oh fuck
>>
>>2395552
>you don't need to worry about it overflowing since
since negative feedback should prevent that from happening in the first place. If your system is sufficiently poorly tuned that it DOES happen, and you may want to include safeguards against it for predictability's sake anyway, it may pay to prevent it from overflowing back to negative integers when it goes too high.
Not sure the easiest way to do that. Maybe see if the two numbers being added together have the same sign (2's compliment, should be piss easy), then see if after adding they have the same sign as they originally had, then if it's different just snap the result to 0xFF or 0x00. Can probably do that with bitwise operations or boolean operations, not that I know how booleans actually work on an AVR.
>>
>>2395447
I can tell that you've never really looked at compiled code, or you would understand why the PIC architecture is inherently shit for languages like C that expect to have a proper stack pointer.
>>
>>2395540
For a fan controller you dont need a D term so that will simplify it a bit.
>>
My project was acting weird, randomly failing in weird ways. I think the cause is my shitty wires and breadboard.
>>
>>2395614
If there's any delay between the fan turning on and the thermal sensor seeing that change in temperature, I'm pretty sure D will prevent overshooting.
>>
File: 1652117344362.jpg (6 KB, 250x244)
6 KB
6 KB JPG
Has anyone looked at their ESP32's internet traffic? Is there any packets being sent out to any unidentified servers?
I'm kind of schizo about connecting mine up to my router
>>
>>2395930
anon stop being such a stickler for "muh security". how else can espressif improve their designs without having analytical insight into exactly what peripheral clocks are enabled?
as for your question, yes it will send a few packets with info about the current peripheral register configurations. so what? it just means that the next iteration of the chip will have a better selection of interfaces.
>>
File: 1650769137120.png (354 KB, 1125x911)
354 KB
354 KB PNG
>>2395935
haha... yeah...
>>
>>2395948
seriously though if youre that schizo, then you should be even more schizo about everything else that talks over ethernet. in which case you should already have the answer to your question, namely a firewall, and just add a rule for your esp32 wifi tranceiver MAC address to drop all packets that are destined outside of a designated ip address/mac address/your local network.
unless ofcourse you also dont trust your firewall, in which case, well...
>>
is there a fast, non blocking timer/delay for arduino? I need to receive a pulse, wait for a little bit, then send out another pulse, but during that wait there may be another pulse which the arduino would simply ignore while it's waiting out it's first delay. I can't have that. I know about interrupts, but it's unfeasible in this case, mainly because the number of pulse pins exceed the number of available interrupts on my arduino.

Any ideas?
>>
>>2396781
on the same pin?
what are you trying to build?
>>
>>2396781
How many clock cycles are you willing to spare checking the timer for a lineup? I'd do port reads to get 8 bits in at a time, have a timer in the background, and have a uint8_t for each pin. Whenever a pin gets a pulse, copy the current timer value to its uint8_t, but adding to it the desired timer offset. Then when the timer value equals the uint8_t value, output a pulse on the desired pin. Think that's going to be faster than continually decrementing a value for each pin, or anything else that isn't using interrupts.

Look into MCUs that have more interrupt inputs, IIRC the newer avrxmega3 series are good for that.
>>
>>2395930
If you're on a computer built after 2002, using hardware that has closed source firmware and blobs, with an OS that has closed source drivers, using closed source software, and connecting to the internet you are so totally, completely, and unbelievably owned in every way imaginable. There is not a single piece of information that an ESP32 could collect about you that is not already in dozens of databases.

I probably wouldn't build some kind of RFID credit card knicknack with one, but there are a million other things you should be worried about instead. You're worrying about whether or not it's safe to light a candle while your house is burning down.
>>
>>2396832
>How many clock cycles are you willing to spare checking the timer for a lineup?
~100 microseconds at worst case between pulses, but in reality most of the time it'll probably be ~1000 microseconds. This is basically wide open as far as the clock speed of arduino, I mainly just need a way to keep track of time without hogging the entire CPU.

>Look into MCUs that have more interrupt inputs
Thing is that just buying an MCU with interrupts feels like a crutch for my shitty programming. I know it's more than possible to do this without interrupts.
>>
>>2397056
>I mainly just need a way to keep track of time without hogging the entire CPU
they make RTC chips, or use a MCU with a built in RTC and throw arduino on it.
>>
>>2397056
I'll ask again more descriptively, if you want a proper answer explain what the fuck the problem you are trying to solve is rather than how to implement the solution to the the problem you are trying to solve.
Your solution of counting pulses or whatever might be completely convoluted solution but because you're a newbie its' the best you could think of. There are others here with more experience that when given the full scope of the problem might have a better solution that you didn't think of yet.
This is why it's always best to state the problem and why I asked >>2396798
>>
>>2386989
You are. Just spend the extra money
>>
>>2397056
>100 microseconds at worst case between pulses
Yeah that's piss-easy to do the way I described. Needs half a dozen or so cycles per pin being read, but 100µs on a 16MHz MCU is like 1600 clock cycles so no biggie. So long as you're doing direct port manipulation you'll never get anywhere near 1600 cycles.
>keep track of time
That's what the hardware timers are for, you may need the 16-bit one if 8-bit precision is insufficient. Throw the counter in normal mode (not PWM, no counter clear, no output pins, no interrupts) and it will just keep running from 0x0000 to 0xFFFF and wrapping back again. Set the clock-select register to have the desired prescaler. With good prescaler selection you may be able to just use an 8-bit timer, which makes things easier. That would look like the desired delay (e.g. 3ms) reaching almost to 255 on the counter (e.g. prescaler of 256 means that 3ms will happen when the counter is at 188)
You can read the timer value in one cycle per byte, so it's pretty fast.

>>2397085
RTC chips are only useful when you want power saving and your MCU doesn't have its own good RTC. But all modern MCUs have timers that can be used just fine when set at the right prescaler if power isn't an issue.
>>
>>2397396
Just learned about arduino having an RTC via micros() and millis(). neat. That solves alot of problems for me. Is there anyway to reset it to zero via software? I think adding and subtracting 20 digit numbers will eventually take it's toll.

>>2397096
kek, sorry anon. High speed morse code for high efficiency pig farming.
>>
>>2397456
>Is there anyway to reset it to zero via software
Yes, but if you're having an individual timer for each pin you'll run out of timers pretty quickly. That's why I recommended just running it so it naturally wraps back to 0x00 after hitting 0xFF, writing down the time when a pin gets a pulse, adding the desired delay to that time, and when the timer equals the desired time you send an output pulse.
If you need more than 16 bits on the timer you should really be using a prescaler on its input clock. Only if you need high precision and long delays will you ever need more than 16 bits, and if 1% is good enough precision then 8 bits should be fine. Any addition you do will wrap normally too, you know, 250 + 18 = 12 with 8 bits.

>High speed morse code for high efficiency pig farming.
uhh
>>
File: see the wave.jpg (2.57 MB, 4032x3024)
2.57 MB
2.57 MB JPG
>managed to get mplabx + avrdude working
at least i've got a workflow without arduino in it, and this one should have a working compiler for any avr and programmer under the sun, finally

also it's only 1 clock cycle per portb toggle on this mega328p. think the tiny1614 was 2 cycles, not sure what makes more sense.
>>
>>2397456
>I think adding and subtracting 20 digit numbers will eventually take it's toll.
Arduino is just a software SDK. Use it with a 32bit micro (atsamd21 for example is arduino's commonly used 32bit mcu) and you won't have any issues.
>>2397456
>High speed morse code for high efficiency pig farming.
Exactly my point, overly convoluted method for solving a problem due to lack of knowledge. Morse code was meant for low speed long distance communication with human encoders/decoders on either end. Modern mcu's have better, built-in hardware, for more robust communication methods like async uart that run on phys layers at substantially higher data rates.
For data integrity over long distances you want to use a differential signaling phys layer such as rs485. An even better solution would to go completely wireless over long range with LoRa and have solar powered batteries on nodes. If you have enough nodes in a close-ish distance even a zigbee mesh network would also work.
>>
>>2397485
>Exactly my point, overly convoluted method for solving a problem due to lack of knowledge. Morse code was meant for low speed long distance communication with human encoders/decoders on either end
You don't understand, anon. It has to be morse code or the pigs won't understand it.
>>
>>2397483
actually it's 1 cycle on the 1614 now too. eh
now i should spend some time streamlining my workflow. maybe it's possible to make it such that mplabx also invokes the avrdude script, but if not i'll likely mess about with python or a shell script instead
>>
>>2397483
>mplabx with avr
fucking why
There are tons of better IDE's for avr, hell the best is probably going to be vscode and platformIO.
>>
>>2397617
Well AVR-gcc didn't work properly with my chosen microcontroller, and Atmel Studio doesn't work on my OS. It may be possible to compile using XC8 from outside MPLABX, but I haven't a clue where to start. I'd be fine writing code outside of MPLABX and pasting it in for compilation, but that would probably take longer, and MPLABX already has the requisite syntax highlighting for the imported <avr/io.h>. Much less fucking about. I'm ignoring 90% of the IDE's capabilities though. If I had a PICkit 4 I'd consider using it as a full IDE, though I don't even know if the 4 can do UPDI AVRs or if I'd need an Atmel ICE. Those are expensive.
>>
>>2397631
Actually, looking into it, I can see that MPLABX just invokes shell commands
>"applications/microchip/xc8/v2.36/bin/xc8-cc" -mcpu=ATtiny1614 etc.
So I can almost certainly write myself a script to do that for me. Not sure if I can uninstall MPLABX while keeping XC8 though.

>>2397617
How have I never looked into platformio before now?
>>
>>2397483
your scope probes may be under-compensated (the roll-off on the signal edges is quite severe)
>>
Anyone ever used a voltage divider to read a keyboard matrix? Like this but say a 5x10 matrix. https://playground.arduino.cc/Code/OneWireKeyPad/
>>
Im probably SOL if I want to do full speech to text on an Arduino, right? From what I've seen it can do predefined commands pretty well, but it looks like what I want is just too much.
>>
>>2398518
Oh I read about that once. I figured it was just the MCU struggling to give solid edges at 20MHz, pretty sure my function generator's squares looks fine up at those frequencies, but I may be wrong. It has 50Ω output impedance, which may make or break the comparison.
>>
>>2398933
>It has 50Ω output impedance
you only need 50ohms when dealing with high frequency or direct coupling measurements.
All other measurements should be with a 10x 10M probe to not load the circuit
>>
>>2398886
if you don't wanna write the entire program from scratch, yes. But it's more than possible to do TTS with an arduino. That shit was done on far less speedy chips with far less resources back in the day.
>>
>>2398958
Yeah my probes are basically permanently at 10M.

Also the function generator's 10MHz wave is basically a pure sine as far as my scope can see, with or without the built-in 20MHz bandwidth limiter. It's a 100MHz scope, so I'm pretty sure that's just the fgen.

>>2399031
Isn't speech to text far more complicated than text to speech? Maybe you could get it onto an MCU in the form of a pre-trained neural net, but you'd at least have to put it into something with enough ram to hold a decently sized audio sample and with DMA, like an ESP32.
>>
File: file.png (205 KB, 405x355)
205 KB
205 KB PNG
this is the ordinary lipo charging module, do you think that if i take esp32 dev board which has micro usb and i connect wires from the data pins on the micro usb to the data pins on the usb c on the tp4056 i will be now able to use the the same usbc for both charging and data connection to the esp32?
>>
File: 8qyAj.png (67 KB, 729x300)
67 KB
67 KB PNG
>>2399380
probably, the hard part may be finding somewhere to connect if they aren't brought out to pads
>>
>>2399031
TTS is solved, it's the other way around I'm worrying about.
>>2399203
That seems to be the only way, but as far as I've seen that will only recognize predefined commands you train in. Getting thr feeling I'll need a Pi for this.
>>
>>2394471
try nand2tetris
>>
>>2399380
Yeah should be fine. Also connect the ground wire, and run a 3.3V regulator off the 5V wire, if you weren't already going to.

>>2399479
>that will only recognize predefined commands you train in
I was thinking more along the lines of a general speech to text neural net. There should be pre-trained ones you can just download, but I've no idea how small they can be. IIRC people have put pre-trained facial recognition neural nets on older raspis, I suspect speech to text is sufficiently smaller than that, and should fit on a DSP-capable MCU, but I'm just riding off intuition.
>>
>>2399797
I did some more research, and I think a Pi Zero 2 would be a better idea. I'm asking a lot out of a little Arduino, and the Zero can do the hard work of speech transcription while using a surprisingly low amount of power for the rest of the time.

Y'all got any recommendations for a low-power SIM module or will any old Chinese thing work fine?
>>
>the software debouncing I implemented kinda sucks
>hardware debouncing requires extra hardware
what is the best way to debounce without shelling out for better buttons (they won't solve the issue because the buttons I'm using are a stand-in for a rotary encoder, which will also need its own special debouncing)
>>
>>2400247
>without shelling out for better buttons
all mechanical devices will exhibit bouncing, crappy ones will exacerbate the issue but expensive ones won't solve it.

fundamentally what you want is to check that the signal stays continuously high for atleast X microseconds to trigger a logical "input".

An RC filter will statistically do this by nature of the capacitor charging. very easy and very cheap solution, though not 100% logically sound it will work in 99.99% of cases.

In software, you could do it like this: upon received edge interrupt, your edge interrupt handler looks like this:

```
volatile uint8_t debounce_in_progress;

void edge_interrupt_on_button() {
if (debounce_in_progress == 0) {
debounce_in_progress = 1;
start_pwm();
}
}
```

start_pwm() simply starts a down-counter, and enables the overflow interrupt for it (i.e., when the counter reaches 0, it fires an interrupt, say "pwm_counter_reached_0".)
In that function, you read the GPIO status, and if its still 1, that means we got an input:

```
void pwm_counter_reached_0() {
uint8_t button_pin_status;

/* (maybe?) protect against race condition: `edge_interrupt_on_button()` might fire right in the middle of us, but im not sure if thats a problem or not. */
#ifdef IM_FEELING_PARANOID
__disable_interrupts();
#endif

button_pin_status = read_button_pin();

if (button_pin_status) {
/* inform application event loop we got an event */
push_event_queue(BUTTON_PRESSED);
debounce_in_progress = 0;
}

#ifdef IM_FEELING_PARANOID
__enable_interrupts();
#endif
}
```

you set the debounce time threshold by setting the down-counter start value and the appropriate clocks. How long of a threshold you need to wait for can be determined experimentally by hooking up the button/rotary encoder to an oscilloscope, pressing it as fast as humanly possible, and seeing what margins you have available.
>>
>>2400279
i wish we could post code in /diy/ like in /g/
>>
Hello, I'm >>2393578 again.
tl;dr see next post

I need some guidance. I'm trying to design a basic GUI menu interface based around some push buttons and the u8g2 library. I'm still pretty new to C/C++ programming so sorry for noob questions. As a caveat, I know the u8g2 library now has its own menu interface, but this is a programming exercise for me (and I need my interface to work differently than how the u8g2 one works).

code here: https://pastebin.com/xFEvh2Ra
There are 3 push-buttons and a little OLED display. The left button (button 0) decrements a "currentEntry" counter (stored in a MenuState struct, described below). The right button (button 2) increments the same. The middle button (button 1) serves as "execute".
There are 4 primary structs (classes?) in my code right now. a Button class that handles the button inputs and contextually changes values in the MenuState struct. The MenuState struct holds state variables for the currently selected Menu and MenuEntry. It also has methods that display the fields of the Menu and MenuEntry structs.
the Menu struct serves as a container for MenuEntrys. Right now it's just a char array for a title, and an array of pointers to the MenuEntrys it will contain.
MenuEntry structs are the individual entries that will be listed in a column for each Menu (when I get around to implementing that). They consist of text to be displayed, an x coordinate, and a y coordinate.

My current milestone is implementing the functionality "have the buttons increment or decrement the current menu entry counter. Then, when the middle button is pressed, display a box with the text of the currently selected menu on the screen for as long as the button is pressed".

(continued)

>>2393594
Thank you. Sorry for the late response. In my embedded programming class, we started going over ISRs and interrupts at the hardware level and I now understand why they can't take arguments.
>>
>>2400247
If you really want to be sure, an SPDT switch and a 7400 will debounce the fuck out of it.
Other than that you need start kind of timer which will ignore the input change until 50ms or so has passed. Any change of input state and the timer starts over again. Usually this is done with the help of a 1ms interrupt that increments a master count global variable.
>>
>>2400292
To that end, I have two MenuEntrys - A and B, with text "A" and "B", and coordinates (10, 10) and (20, 20) respectively. I've gotten the code to successfully increment and decrement the counter, and it will even show a box in different places.
The problem is, somewhere in the chain my pointer juggling seems to go awry and it pulls in garbage data, leading to empty boxes placed at random on the screen.

The "sequence of events" for what I have implemented is
//defining Menu struct
...
typedef struct Menu{
char title[8] = {0};
MenuEntry *entries[] = {0};
};
...
//in program body
struct Menu mainMenu; //hard code mainMenu struct into program
...
//in void setup()
...
struct MenuEntry A;
struct MenuEntry B;
A.xPos = 10;
A.yPos = 10;
B.xPos = 20;
B.yPos = 20;
strncpy(A.text, "A", sizeof(A.text));
strncpy(B.text, "B", sizeof(B.text));
strncpy(mainMenu.title, "Main", sizeof(mainMenu.title));
mainMenu.entries[0] = &A; //store address of A into array of MenuEntry pointers in
mainMenu.entries[1] = &B; //ditto B
...
ok everything should be instantiated now. Here's the sequence of events for when I press the middle button to display the currentEntry field on the screen:
//in Button.buttonHandler:
//we pressed the middle button
case 2:
...
MenuState.drawEntry(mainMenu.entries[MenuState.currentEntry]); //pass a pointer to the currently selected Menu Entry into the MenuState.drawEntry method. I suspect the error is here.
...

//in MenuState
void drawEntry(MenuEntry *entry){
u8g2.clearBuffer();
u8g2.drawButtonUTF8(entry->xPos, entry->yPos, U8G2_BTN_BW1, 0, 1, 1, entry->text);
u8g2.sendBuffer();
}

somewhere in here I'm making a beginner mistake with the pointers but I just can't see what it is, and the result is garbage. Where am I going wrong?

>>2400282
you're telling me lol
>>
>>2400300
>>2400292
alright I got it working
I thought I could just define A and B in my setup() function but no, they gotta be... I don't know the terminology. Defined globally?
Either way, it's working now. For now.
>>
>>2400348
That may be the biggest problem in learning about pointers, is understanding the concept of scope, where things go when you declare them, and when they go away.
Yeah, stuff you declare locally in setup() is gone when it exits.
And if anyone you ever see someone trying to use alloca(), get them some medical attention immediately.
>>
>>2400355
See, that's what gets me. I am going to butcher this because I don't have an example and can't remember exactly what happens.
But I swear I've seen C programs that have "helper" functions that just generate instances of structs, without previously defining the struct, that just return a pointer to the struct - and yet the structs still exist in memory after the function returns. Shit's fucking magic and I just don't get it yet.
>>
I just realized I've been spending all my time designing the UI and DDS code for my synthesizer and I've thought absolutely 0 about how I'll actually play the damn thing
I assume there's a lightweight midi-over-USB stack I can throw on the microcontroller, but then I would need an external computer + DAW to play it
if I wanted a hardware keyboard interface, I assume it would come down to switches, multiplexing, and polling, right? Or is there a smarter way to do it?
>>
I want to modify a MX-518 mouse and make it wireless (dont care how much it costs).

Years ago I was given a freebie "USB cord" 2 piece dongle
Plug one dongle into a USB device, and one dongle into your PC and it worked wirelessly replacing the cord

Does that shit exist still in a board I can cram into a mouse?
Anything else that would mimic that functionality?

If I could get a USB wire dongle and just add an AA battery regulated to 5v to power the mouse inside, I would be perfectly happy

There are other people who have just replaced the guts with other wireless mice, which is an option too but I think this would be more elegant if there is some board out there that exists.
>>
File: ctbk2.png (624 KB, 611x592)
624 KB
624 KB PNG
>>2400750
Also I dont give a shit if its 2.4ghz with a dongle or straight Bluetooth or whatever.
A bluetooth module would probably be easier and better right?
Im just a boomer with carpal tunnel and a need for a wireless mouse now, and this is the mouse that fits me best.
>>
>>2400750
Easiest option may be ripping out the guts of an existing wireless mouse and transplanting them. May need custom 3D printing to get the sensor and buttons mounted properly.
>>
Anyone know a good sensor to measure indoor CO2, between 400 and 2000 ppm maybe? Preferably I2C
>>
>>2400824
Are you aware of the difference between CO2 and equivalent CO2 sensors? Either way, see Andreas Spiess's video on the topic. He covers a few of both and tests their effectiveness. Personally I'd have one of each, VOCs are useful to measure regardless.
>>
>>2400840
Yes, I'm specifically after just CO2. Thanks for the video tip
>>
>>2400750
>>2400800
easiest option acktuaally is to just go an buy one of those el cheapo wireless mice for like 10 bucks. but youd rather spend double that on some chink solution that may or may not work, and/or waste time fucking around with 3d printing
>>
>>2401573
Nobody asked for the cheap or easy solution. What are you a woman?
>>
>>2401573
Youre on a DIY board in a microcontroller general thread and youre telling someone to just buy a solution to their problem. What are you, a faggot?
>>
>>2401573
>easiest option acktuaally is to just go an buy one of those el cheapo wireless mice for like 10 bucks
That doesn't solve the core problem, that being ergonomics. I'm guessing the anon wants an obscure vertical mouse or trackball or whatever and they don't come wireless, which is fair enough.
>>
>>2387177
Its all cancer, once you realise the simplicity of *gcc or sdcc compilers, you would never want to go back to whatever cancerware IDE the manufacturer peddles. This is mostly true for 8 bit micros. For 32 bit ARMs there are some manufacturer supplied IDEs etc which are half decent so its fine
>>
>>2401646
My issue is that avr-gcc doesn't natively have support for my chosen AVRs, and trying to add it is a hack that was giving me grief. But I'll try using XC8 from the command line with some custom python or shell scripts or whatever, it's barely worse than avr-gcc from a user friendliness point of view. I think there's promise to it, as I can see exactly what shell commands are being called by MPLABX to copy them. With any luck I can uninstall MPLABX while keeping XC8 (they're in seperate folders), and hopefully still be able to import <avr/io.h>. I may be able to get away with the hacky importing of <iotn1614.h> and its addition to my programming environment's <avr/io.h>, but I'm not too sure. That may be something the compiler gets from its own files, which might be the ones inside MPLABX.

Also what's the equivalent of avr-gcc + avrdude to the esp32? And is it any good? It's like the only good cheap MCU that's in stock, even though I don't need anything with wifi.
>inb4 use stm knockoffs
>inb4 use stm knockoffs but risc-v
>>
>>2401661
>Also what's the equivalent of avr-gcc + avrdude to the esp32?
Its esp-idf and esptool. You can download both from here. Alternatively, you can use arduino IDE which contains both
>https://github.com/espressif/esp-idf
>>
Was hoping to get some advice. Currently working on modifying an attiny project found on the internet. Had an issue where the LEDs in a corner would never turn off completely. I could never understand why due to the matrix nature of the LED block so finally got some time this summer to really working on it and redid certain functions. Works perfectly now but with all the features it is pushing the attiny 4313 limited memory. I have made some attempts to reduce the size as much as I can but I am pretty inexperienced to all of this and wanted to ask for your suggestions.
https://pastebin.com/u9D951WB
>>
>>2402051
Nothing glaringly obvious, though it would take me a while to understand the full structure. Assuming there aren't any evident restructurings that would help, all I can think of is to hunt about looking for things to fold into functions.

You're running out of progmem, I assume? Or did you mean RAM? What AVR?
>>
>>2402124
Honestly not sure. Just noticed odd behaviour in functions that would be working. Have to jump around between Microchipstudio to write and arduino to program due to not having a programmer and it was telling me that it was running out of space.

So been trying to change things into loops and changing some ints to chars where it seems valid.
>>
>>2397617
Ok vscode and platformIO has promise, but it's a bit of a bloated mess and requires almost as much faffing about as custom shell scripts with avrdude and XC8. Also I'm not sure what compiler it uses, if it's still avr-gcc it may run into the same issues I was getting with it earlier, on the other hand it uses what are basically arduino cores so it will probably work just the same as arduino does. Definitely better than MPLABX, but not significantly so, and I can't figure out this one verification byte mismatch when programming.

At least it isn't like 20 fucking gigabytes like Xcode is.

>>2402168
>odd behaviour
If it's not explicitly giving you a memory error when flashing/compiling I imagine it's not a memory error. At least so long as the odd behaviour isn't indicative of some pointer-based overrun. I'd first check that all your math is consistent, things like using unsigned ints for everything, and double-checking that your character lookup tables are constructed properly.
Also timing issues. Doesn't look like you're using timers for all timing, just for the initial interrupt for each frame/line/whatever, so maybe accessing the timer value could help. IDK.
>>
File: file.png (241 KB, 336x447)
241 KB
241 KB PNG
i'm running out of esp32 so i want to refill my supply and order a box of new ones from chinks.
but i see there are a bunch of versions, so which one is the best?
the ones i have are esp32-wroom, but the pdf says it's not recommended for new designs. so what is the best versions of esp32 to buy?
i am not talking about dev boards but bare modules like pic
>>
TL;DR uC temp sensing for retards, is the best way of measuring temperatures on a micro just buying a thermistor and wiring it up manually?

Full story, I'm lost for options here
I bought some DHT11 boards for my ESPs because I want minute-by-minute temperature logging for my entire house + outside, but the temps I was getting from them was so wildly inaccurate and inconsistent I decided to re-order a bunch, but this time buying DHT22's, which allegedly have sub-degree accuracy.
They're pretty much even worse.
Should I stop buying chink modules, are there better suppliers, or is there a much better way to more reliably read temperature reliably and consistently using something like a NodeMCU?
I'm using adafruit's DHT library here, I can't imagine that's the problem, but thought I'd mention it.
>>
>>2402491
I have to jump between two IDE's. Both report different memory usages so I can't rely on these values. Basically just faith on whoever made the files for the board to be used on Arduino ISP. pretty sure the math was right as everything worked until I added the scrolling text function. It caused another function to reset the chip when it didn't before and swapping things around showed no issues. When looking at the function itself it takes a lot of program memory to use it so I assume because I use the Arduino IDE maybe it didnt know the memory was full and it overwrote a portion somewhere? I do not know which is why I am doing what I am now. So far so good in that regard.

It is using Timer0. Timer0 fires about roughly every 2.56ms with a compare timer CTC mode. This sets the need row flag to true and makes the device draw the next row.
>>
>>2402600
Never got those to work as is. Mines were pretty linear so I could use an equation and then made small value adjustments to make the microcontroller output match roughly to an actual thermometer.

If yours are so wildly out of place you could make a lookup table for it but may not be the best choice for your project.
>>
>>2402550
esp8266 have an 80mhz or 160mhz cpu + wifi preinstalled so less than the 240mhz you're used to.
They're about £1.50 each

https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20220608132603&SearchText=esp8266&spm=a2g0o.home.1000002.0
>>
>>2402600
I have a temperature module that was accurate, it's the Bosch BMP280. I can tell you it does room temperature very well, not sure about anything else. It's also i2c & there are libraries available on the arduino ide

https://www.ebay.co.uk/itm/272379854598?hash=item3f6b1abf06:g:n54AAOSwQmhejXd-&amdata=enc%3AAQAHAAAA4B6xfhZiYyTYGXjEljT3SmUH7K568JxuVKFMmgqhURytrMUsOlvyL1V2%2BRYiGGETLLeHPucCSu2jam6LKQooISZ%2BIVMdP6qfpedQAJ%2FenRoYYTXup1TM9oKDxRoqXgVG45F8Jqxq2hlbNIIE2yNTFqCxNzv%2FrCnULfSLZhdhZt7Or4rngNBrLl39lo37Cm8zwy60qlnak0kkMBTE%2FfIMA5RUc%2BhEDE%2Faz1q%2Bz46y%2FWXUyemM2SX0SVc5Z9QIDAmR5W%2B2KEGz4UBNp1lOHKvLqklbH%2BeZKR%2FJq04S7iPVhSw2%7Ctkp%3ABFBMjr_L06hg
>>
>>2402609
Right now I have two of them sitting side by side logging, was gonna leave them for a few days, then graph their variance, as long as they're always off by a known quantity then I'd work out their individual deltas and factor for that, but if they're drifting to and away from each other I think they're a write off.
>>2402812
Thanks anon, I'll grab one and see how it does, at very least I can use it as a reference to calibrate all the other modules I have.
>>
>>2402550
Consider the ESP32S for native USB purposes. It’s objectively better than an ATmega32U4 and probably cheaper too. AVRfags BTFO.

As the other anon said, the 8266s are about half the price of the 32s and are good enough for basically any non-bloat code. The low pin count is a bit shit though.
>>
>>2402807
aren't 8266 super old?
Also esp32 only costs like a buck more and since i don't mass produce anything just use them for my projects then it's better to use them since they are faster and have more pins and BT and shit like that

>>2403028
isn't wroom the same as esp32s?
Because there is also esp32 s2 and esp32 s3 which seems to be the latest esp32 model. the issue is that basically the thing i get has to be sold by chinks on ali since that is where i get my shit, they have tons of the old wrooms there, but not that many sellers have s3 or it's a sketchy shop, or it's overpriced etc. so it makes me think if i shouldn't just get more of the normal old wrooms i have now.
it's not really like my projects use every last clock cycle in those chips, it's usually reading sensors and shit like that that even the old ass atmega328 could do easily
>>
also i am so fucking tired of the retarded shipping costs
1 chip = free shipping
2 chips = $1 shipping
3 chips = $5 shipping
what the fuck? it's few grams.. and this happens in almost every shop. so what am i supposed to do? just place 10 order in a row in the same shop?
>>
>>2403121
>aren't 8266 super old
So is the mega328p, doesn't make it bad.

>isn't wroom the same as esp32s?
WROOM is the name for their castellated via dev-boards, have a look on their LCSC page to see what they actually sell and what the official names for them are.
>ali
I swapped to bulk orders from LCSC or Digi-Key ages ago. I recommend you do the same. More cost effective if you save up your list to make the shipping worth it, and you've got no chance of getting chink'd.

>that even the old ass atmega328 could do easily
Get some easy to program cheap shitty micros then. Be it an 8266 or some ATtiny chips. For minimum price you'd likely be looking at PIC10s, but you need to first get a PICKIT for like $30. STM8s may be worth considering since the STlink V2 clones are cheap.
>>
>>2403146
>LCSC
i used to order from them a lot but i can't do that anymore due to customs changes, ali handles the customs fee, but last i checked lcsc does not which means i would have to do ton of paperwork on every order
>>
>>2403146
>STM8s
what is the atmega328p of stm8 chips? i already have stlink i use it with my blackpill boards
the only codition is that it must work with arduino sdk because i just can't be bothered learning million different custom sdks for all the different chips i use
>>
>>2403157
Oh, yeah that's a pain. My country ignores LCSC's customs for now so I've been getting free lunches so far. Even though apparently JLCPCB does customs for you, and they're the same people. Maybe they'll change that eventually, or maybe you can get your parts through a JLCPCB order by giving them an inflated BOM to package with your boards. Worth a shot.
If I get an alert that I've been hit with customs I'll just bite the bullet and pay the fee I guess. No clue how I'd pay pre-emptively, but considering I make an order like twice a year it's probably worth learning.

>>2403163
>what is the atmega328p of stm8 chips
Asking the wrong guy I'm afraid, I'm tempted to try getting some, but I couldn't even figure out how to flash a blink code to my bluepill. I'd see on ali to see if there are any dev-boards and go from there. Chances are if there are they'll have decent specs and decent prices. And probably also be out of stock internationally, because that's what having a popular dev-board does to an MCU.
Picture me, buying a tiny84 for cheaper than a tiny85, even though it has the same specs and twice the number of pins. Obscure micros are the way forwards.

>arduino sdk
Take the text editor + command-line compiler + command-line programmer pill.
That or use PlatformIO, it's pretty damn easy to transition from arduino over to it and it uses a bunch of the same code for AVRs. Ultimately the Arduino environment is designed for AVRs and nothing else, people who got it to work with STMs and ESPs are ultimately just performing shitty hacks. Assuming you can make custom code templates, you should be able to use it just as easily as Arduino.
>>
>>2403181
>JLCPCB order by giving them an inflated BOM to package with your boards. Worth a shot.
yeah i considered doing that. designing a pcb with like one resistor on it a putting everything i want onto bom so they put it in a bag but that is really retarded when the are the same fucking company
>>
>>2403181
I am using platformio. pio is not sdk, it's an IDE which supports several sdk and arduino is one of them
>>
>>2403186
Well maybe I wouldn't order a board with a single resistor. Get some cool PCB rulers or project box faceplates if you don't have any PCB projects planned. Or even anime art so you can get /g/tards to gush over it. Get them to cut out one of those resistor leadforms. Make some dev-boards or IC programmers.

>>2403187
Shit, looks like you know a lot more about pio than I.
Does pio not have shit you can install for STM8s? They probably won't be via the arduino SDK, but what does that matter? There should only be one or two necessary for the whole STM lineup (8s and 32s are somewhat different), you'll only get a bunch of bloat if you're hopping between STMs and ESPs and PICs and AVRs and MSPs etc. The makefile equivalent file thing is done automatically, if you've got it set up right.
I wouldn't trust the Arduino SDK to be well optimised for STM32s in the first place, knowing what Arduino code can be like.
>>
>>2402491
I think it was a int thing or something not sure when I did a frame%19 or anything larger than 10 caused the device to freeze for a moment and jump to a different mode when it wasnt meant to. Added an if statement so it would do that past 7 which would draw off the board which is unnecessary seemed to fix the issue.
>>
>>2403754
Is 10 exactly the issue? Or was it 9 or 8? Consider 6, and go through all the binary equations on it to ensure there's no glaring faults. Break it into as many steps as possible. Then do 7, 8, 9, 10. Use a spreadsheet, with a row for each starting value. Chances are one of the you'll get an intermediate value over 255 or 65535 or whatever. That or you're in 2's compliment and you end up going negative.
>>
>>2403815
In this case I believe it is a memory space issue but not an out of memory one but a bug for whoever wrote this function.
got a couple of lines that looks similar to
r = (frame+0)%(19); bitmap[6-r] |= (1 << 0);
problem is bitmap is only 7 bytes. Since r can index past the bitmap it is placing values in spots it was never meant to potentially filling a variable currently being used by something else. If I reduce that 19 to around 10 it still works but that is a sort of hack fix. It should be prevented from writing anywhere except the bitmap but need the 19 for timing so to fix the issue I changed it to
r = (frame+0)%(19); if(r <= ROWS + 1) bitmap[6-r] |= (1 << 0);
This appears to have fixed the issue. Seem to have got all the glaring problems solved only one left I am not sure I even care to fix and managed to reduce memory usage a little.
>>
How do you neatly distribute power and ground in projects that have a lot of components?

I have a project that needs to power 4 different circuit boareds and a half dozen sensors all requiring a 5V input and ground. Normally I'd just use a small wago connector, but those only go up to 5 slots. Any recommendations?
>>
>>2404204
I haven't had anything with a big need for amps, so a simple USB hub has worked for me.
>>
>>2404209

interesting; he'd still need 10 cables, so that's getting a bit pricey. Pic related is still more than I'd pay; I'd just solder it up.
>>
>>2404220
getting closer...
>>
got $50 whats some shit I should buy off aliexpress
>>
File: idk man, the green ones.jpg (84 KB, 1000x1000)
84 KB
84 KB JPG
>>2404117
Does changing the "%19" to "%10" not alter the program's behaviour in some other way? What's the "6" in the "6-r" important for, I suspect each line is 6 pixels wide or something? There's almost certainly a smart method to get around the issue, it might be the "if(r <= ROWS + 1)" conditional, but I suspect there's something a little deeper.
You're incrementing "frame" right? What's the maximum value you expect it to get up to?

>>2404204
The small terminal blocks work, there's also those screw-terminals with the push-in connectors (not sure if they have to be PCB-mounted), which would make it easy to connect and detach 2-pin ones for individual projects. Picrel. Barrel-jacks or even 3.5mm audio jacks are pretty cheap and easy to wire up, and can be panel-mount or PCB-mount.

>>2404421
A single PICKIT 4
>>
>>2404434
>there's also those screw-terminals with the push-in connectors (not sure if they have to be PCB-mounted
they're often called phoenix connectors and they come in a lot of different configurations, such as keyed, locking, pcb mounted or not, etc etc
I like them better than JST connectors when I'm doing something semi-temporary or that I might want to reconfigure later
>>
>>2404443
Ah, neat to hear that they come in different mounting styles. The only issue I could think of is that you could plug in a 2-pin connector to a larger bank, but offset by one, and so end up with a flipped polarity getting to your device. But diodes would prevent any damage, and some colour coding would prevent any confusion.
>>
>>2404434
I didn't write this program here is where the original is from.

I am altering it to fix an issue that was showing up. From what I understand yes changing 19 to 10 will change behavior. It adds a kind of delay to the pixel being drawn. This code creates a sort of flame. the bigger the number the longer the pixel takes to be redrawn back on the screen and it moves up when frame is increased. The issue is fixed by adding the conditional. As whoever initially wrote this function did not take into account that if "r" if allowed to be unbound it will attempt to write to some address location at bitmap 6 - (unbounded r) . This may not be too big of an issue on an empty chip with the registers being completely free when I have a chip that is nearly full with several the the registers being consumed by globals it is possible the unbounded r write to a register that is currently being used by something else causing erratic behavior. The conditional binds r while still allowing the delay. At least this is how I am interpreting what I was seeing. But I am an EE not a coder so I am grasping at straws.
>>
>>2404434
>>2404719
Sorry my dumbass forgot to link the source code.
https://github.com/FablabTorino/tinyMatrix/blob/master/code/c%20programming/TinyMatrix.c
Mines if a bit larger and a bit modified compared to this.
>>
dunno if this is the right thread to ask, but i need a pcb-mounted female jst port for picrel
i don't know if there are different jst standards, but i'm assuming there are
https://www.aliexpress.com/item/32954418743.html
would the 4-pin port in this link be the same as the one in the picture?
>>
>>2405069
Not sure if they lurk here too, but on /ohm/ you can post any fucking obscure connector and some wizard will tell you exactly what it is within like 3 hours, they'll likely be even faster with a JST.
>>
>>2405097
Took 5 days for me but yeah those guys are wizards. Managed to locate a specific usb connector with a unique tab.
>>
Idk if I should ask here or /ohm/ but does anyone know of any good AXI tutorials in vhdl for both master and slave that don't need ZYNQ?
>>
>>2386764
I'm trying to build something simple with a breadboard, but I'm too stupid. Can someone help me? This is the functionality:

>1 LED
>2 buttons, "ON" and "OFF"

When "ON" is pressed:
>if LED is off, it switches on and stays on.
>if LED is on, it stays on.

When "OFF" is pressed:
>if LED is off, it stays off.
>if LED is on, it switches off and stays off.

I'm having trouble figuring out how to wire this up...
>>
>>2405511
Google SR latch
>>
>>2405515
thank (You).
>>
this question could go in either /ohm/ or here
are there DACs with gain control/VCA-like capabilities built in? If they do exist, are they super specialty/expensive or can I get one for a fiver or so?
>>
>>2404434
frame is an unsigned int so itll count up to max two bytes. I honestly suspect this is not necessary but due to the 4MHz speed the longest delay for a signal image frame is about 2 seconds or so. Changing the 19 to a 10 does change the behavior. This function draws "rain" a larger number causes the rain "drop" to not appear on the screen for a longer time after it has fallen out. 6 is the max value of a special array used to determine which pins on the attiny go high or low. You can consider it "video ram". It is 7 bytes wide for 7 Rows and 5 bits to describe 5 columns.

I added that conditional and it does fix the problem. Oh uh the 6-r is just a way to index the array using the variables I have.
>>
File: j8header-zero.png (219 KB, 500x907)
219 KB
219 KB PNG
>Testing GPIO connector on continuity tester on the Multimeter
>Pins 1, 2, 3, 4, 5, 6 ring altogether.
>The pi keeps working still
What is happening ?
>>
>>2405978
plus I don't see any tin connections in between pins.
>>
>>2405978
You know that power capacitors will show continuity until they're charged, right?
Go ask /ohm/ for the details.
>>
>>2405669
Why would a DAC have an AGC? Did you mean an ADC instead? Both may come with programmable gain amplifiers (or maybe just changing reference voltage), but I’ve never heard of one with an AGC.

>>2405978
Continuity testing is a current source + a voltmeter, so expect unusual results when probing intact circuits. Especially live circuits.
>>
>>2406037
I don't want automatic gain control, just a software-controllable amplifier so I can implement an ADSR without having to buy another IC. Given the purpose of an audio DAC, it just felt like it would be natural for them to have output gain control built in but apparently not
>>
>>2405978
continuity tester doesn't work right when the circuit is powered on.
>>
>>2406121
PGA circuits are common, but they only cycle through preset gains. Might be enough to do crude ADSR, but I doubt it. You'd be better off doing that in software to the sample values themselves if you're already getting the wave from a digital source. You know, multiply it by some integer between 0 and 255, then bit-shift it back down by 8.
>inb4 discrete digital synth without MCUs
If you're actually doing that that could be cool in a weird kinda way.

Not sure how I interpreted your original question as asking about AGCs, sorry.
>>
I wonder if I can use an ATtiny's USART (or other serial) hardware instead of bit-banging to a 74HC595? Could save some time. Not sure if I could do that with three parallel ones (i.e. I'd have to put them all in a string) but that might be worth it for the time savings.
Well, bit-banging is fun either way.
>>
Ok, I will ask here.
I am 100% new to building my own boards, not new to rebuilding/repairing on boards.

I have a problem/thing I want to solve.

I have 2 controllers, each one does a different but unique thing, I want to use a 1 board because it would just function better if everything is wired to that board, but because the other controller still serves a purpose that the other one can't replicate, I want to be able to use it as well.

there are in total 18 wires

6 of these wires need a connection in the middle of the wire for potential disassembly without the need to access the main board. so my thinking is this

inside the body I could either have connections branch off eachother think molex like connections, and swap between them

I could wire everything up to a pcb and have male and female versions, this would probably be the cleanest way

the connection between the bodies would also need molex or something.

I could also get something that acts as a switch between every single connection, not ideal, but potentially the most time saving of them

anyone able to recommend stuff to look at for this?

there is no rush on this so i'm planning to order from china to get whatever solution it is as cheap as possible.
>>
>>2406277
>wires
>switch
sounds like an /ohm/ problem
>>
File: the problem.jpg (148 KB, 1172x686)
148 KB
148 KB JPG
>>2406285
here, this is what i'm having problems with
>>
>>2406277
>>2406289
Absolutely no idea what you are talking about mate sorry
And stop fucking redditspacing jesus, fucking enormous post with wasted space lol.
>>
>>2406327
line breaks make it easier to read rather then being a giant wall of text.

the problem i'm having is connecting everything in a way that can use both microcontrollers, and a way to disconnect one of them before it even gets to the microcontroller because its components are meant to break away in transport.

I think my options I know names for are

molex
dupont
hole pin header

beyond this I have no other idea what things are called to even look up what the options I have are.
>>
>>2406337
>my problem with switches and connectors uses microcontrollers, so it's a microcontroller problem!
>>
Hey I want to modificate one of these Geiger counters so it doesn't react to radioactivity, but to magnetic fields. I plan to buy an arduino and to then attach it to the internal speaker. I need some sort of sensor which will react to magnetic fields.
This should be straight forward right?
Or am I overlooking something?
Does this project have any pitfalls?
>>
>>2406346
by extension talking about code is now a code problem, and talking about the project you are doing is not micro controller, so tell me the fuck is this even for if that's the case?
>>
/mcg/ sisters when will PSoC cy8ckit-059s be back in stock... there's literally nothing as flexible as them
>>
>>2406374
Why not buy a gauss meter? They look practically the same.
>>
>>2406337
Ok so you want to choose pin+socket headers for a particular purpose. From that purpose, what specs do you need them to follow? Size and pitch? orientation? Board or cable mount? Ingress protection? EMI protection? How many wires?
There aren't any dev-boards with anything other than standard 0.1" pin or socket headers, if that's what you're wondering, but you could easily design a "shield" to plug into a dev-board and provide a bunch of connectors.

Also anons on /ohm/ know a shitton of different connectors, but without knowing exactly what you want you'd get more use out of browsing digi-key.

>>2406699
>there's literally nothing as flexible as them
laughs in verilog
>>
I have a neurological condition that causes occasional memory issues/blackouts.

I want to be able to backtrack what has happened during these times. I am considering some kind of video recording, but due to file size, directionality, and how other people may get uncomfortable from them I'll stick with some kind of omnidirectional microphone for now.
I'll have the mics mounted in my home and carried with me.

What's the smallest and most energy-efficient MCU that will allow me to record audio to a SD card?
Probably gonna be
>microphone, battery, MCU, SD card

I have considered doing AES encryption on it too, but I'm imagining that will bump up the energy use quite a bit.
>>
I want to drive an old 4-wire HDD brushless motor, I've read I need an ESC but all I've found in AliExpress are 3 wire and for quadcopters
are there any "general" ESCs out there?
>>
>>2407075
>4-wire HDD brushless motor
The key term is "2-phase brushless". Not sure if they actually make ESCs for them though, you may need to get a couple of H-bridges and use the hall-sensor(s) for commutation.
>>
>>2406916

Ok, there are two boards, one it came with that can be used wirelessly, and one that will be wired and less prone to mess ups. nothing im sending over them is complex enough to need shielding. what I thought of before was just having molex connectors for both controllers and swap them out as needed, but looking at options, i'm thinking connect both of them to a pcb and have something like dupont connectors glued together act as a 10x2 pin connector, and use 2 pins to key so I can sway between boards if the situation ever calls for it.
So that is 1 problem is if this is the best way to do it or if there is a better ready made way

the second problem is the smaller blue circle, where come of the controls are farther away, said device disassemble there, for easier transport, so i'm also looking for a connector for that, again, this would be a 3x2 molex, i'm not sure dupont would work good here as this, when connected, should be a rather hard connection, i'm not sure how easy it would be for gravity/moving while assembled to keep it together. this is kind of where i'm at in terms of figuring out what to do.
>>
>>2407314
Connectors like JSTs and such have latches in them, little plastic tabs that need to be pulled out of the way before the connectors can come apart. If you're dealing with vibrations I'd go for something like that. JSTs themselves are only 1-row (I think) but there's bound to be latching connectors that are 2-row.

Dupont connectors aren't usually considered positive enough for permanent use, at 2x3 you're kinda borderline for the friction being good enough. At more than 2x6 or so it should be fine, but for 1x3s or whatever I'd avoid them.

Would there be any possible tugging on the cables themselves? If so, you may want to look into connectors designed with strain relief in mind.
>>
Where can I find a button for the raspberry pi that's just plug and play?
>>
>>2407915
https://www.adafruit.com/product/3582
>>
>>2407936
that looks like it takes the entire slot...
I'd just like add a button to the raspberry pi....
>>
>>2407936
>>2407937
The PCA9554 is one of those I2C port expanders, so it probably doesn't need more than 4 wires.
>>
>>2407936
do pifags really...
>>
what the fuck? esp32 reboots when it wakes up from deep sleep? what kind of retarded faggot design is that for fucks sakes?
that is so fucking stupid
why can't it simply continue where it left off just like literally any other chip does it?
>>
>>2408276
It's a fucking strange chip. Check if it's an issue with the strapping pins on your particular board, they want to be in specific modes for booting and maybe also for master/slave operation.

Read Kolban's Book on ESP32, maybe he's written something about it. Maybe it's as simple as a goto in your ISR.
>>
>>2408297
no, it reboots by design, all variables and shit get wiped, there is no way around this all you can do is store shit in rtc ram which is gay.
>>
>>2408336
if youre using deep sleep im assuming youre doing something periodically. therefore just save your programs state in flash before entering deep sleep. from here when the system resets most cpus ive worked with have "reset reason" register and allow you to figure out why the system reset. if this is the case you can see if you awoke from a deep sleep. in this case reload all your relevant variables and program state from the flash memory
>>
>>2408276
>just like literally any other chip does it?

I'm not contradicting that, but are you saying that "any" other chip can sleep at as low as 10 microamps like the esp32 (if you shut down the ULP processor) and wake up without loss of variables or program state? It seems like you might be happier with the light sleep mode which pauses the CPU and only uses 0.8 mA.
>>
>>2408486
>other chip can sleep at as low as 10 microamps
atmega328p can sleep at 3ua while keeping its ram intact
>>
>>2408276
yes, the default startup code sends all your shit back to china if a connection is available
>>
I love how this is the “arduino thread” but 90% of the shit talked about us way beyond the blinkies and their digitalWrite()s. Which is a good thing. If there’s anything we need more of it’s blinkies realising it’s not ok to spend 20 clock cycles pulling an output high, or to use a dev-board with a 2mA power LED on it for a low-power circuit.
>>
>>2386764
uh sirs I only have experience with electronic stuff like UART and I2C, can someone help me?
I want to to send commands to an orange/raspberry pi through my laptop, and get real time data at the same time. ANyone has good material on how to do that?
>>
>>2406374
>This should be straight forward right?
no
>Or am I overlooking something?
yes
>Does this project have any pitfalls?
yes

>I want to change this microphone so it doesn't react to sound, but to color

your problem makes no sense and even if it did, it is ill-defined
>magnetic field
at what frequency?
>>
Is there something like the raspberry pi zero w but with buttons?
>>
>>2411284
I want my boss to think that his coffee is radioactive.
I plan to glue a small magnet under his cup and then use the fake Geiger counter to scare him.
>>
>>2411613
Then a hall-effect sensor or three to measure magnetic fields, connected to a 555 timer's CV input to act as a VCO, which then drives the piezo. Higher magnetic field = faster oscillator frequency. There may be better VCOs to use, or just use a micro if you want to control it more.

See also: elektrosluch
>>
I have an arduino that is powered with a latching relay. Is it smart that it shut downs using one of its gpio pins? will it be able to latch the relay before it is out of juice
>>
>>2412265
you can get an ics that do this without a shitty relay, and is able to be used with a gpio to self turn off
>>
>>2411280
What kind of bitrate do you need? UART can go reasonably high, for which a USB-to-TTL converter would do you just fine. You can interface with computer serial ports pretty easily in a language like python, which I’ve been doing recently on my laptop.
>import serial
And away I go

>>2411474
Might be able to get a shield for it with buttons on it. But if you tell me what you want to do with it I can tell you to use a microcontroller dev-board instead.

>>2412265
It works but it’s easier to just use a P-chan.
>>
>>2411063
I'm a blinkie but I'm trying to get better....
>>
So i had this idea of making a 2.5 inch google auth with the raspberry pi zero w
But itd be +$40
So im thinking like why woukdnt i buy a burner instead at thst point lol
>>
>>2411613
what would be even more funny is if you literally just put a geiger counter near to it. i bet the natural background radiation of the world environment will be enough to get a few ticks per minute.
just don't turn it on when its away from the coffee - then the game will be up.
>>
>>2413916
Even more fun, stir his coffee with a thoriated welding tungsten!
>>
anyone have suggestions for what spare electronic components to keep in a kit? like for keeping in a bag to take to conferences and for reverse engineering
>>
>>2414373
Portable iron (Pinecil, TS100, etc.) and relevant consumables if you plan on doing soldering. Blu-Tak. An illuminated magnifier, maybe even an endoscope/inspection camera. An FT232 module with jumpers. A nanoDLA with jumpers. Good pliers, tweezers, spudger, etc.

Some really tiny dev-boards to bodge in place with enamel wire and UV-cure adhesive, plus the required programming hardware.

RFID and/or NFC readers + spoofers. An SDR.
>>
if a micro controller/IC has a "NC" "not connected" pin, is it OK if I connect it to something? Say a ground or vcc? It will make wiring a bit easier
>>
>>2414973
Depends on what the datasheet says. Often it's fine, but sometimes you get one that says "leave floating or tied to ground" or "do not connect anything to this pin".
You can always cut that pin off the IC and just run a trace through where it was, or in the case of an SMD IC just leave solder mask beneath that leg. That one worked a treat for me when I made a mistake when designing a board that would kill the half-bridge-driver if I tied the enable input up to the 12V rail, but it already had an internal pullup and a 5V zener so I could just leave it open-circuit after dotting a bit of solder mask under that leg.
>>
so i am newfag with all this.
i managed to connect mpu6050 to arduino and it's spitting out gyro values and accel values, and even more so they are both just changes over time, not absolute rotations.
the problem is i expect just 3 values, x y z rotation
so if i for example rotate it 90 degrees clockwise when it is sitting flat on a table i will get out put that is: x0,y0,z90 since i rotated it by 90 degrees on z axis.
Is it possible to get something like that out of the mpu 6050?
>>
>>2415814
>changes over time
Have a running sum.
>>
File: file.png (117 KB, 723x727)
117 KB
117 KB PNG
>>2415814
Use a more modern imu with less noise and grab the corresponding invensense smartmotion eMD drivers for it.
Will do rotation better than >>2415817 shitty integration method. It's a extended kallman filter which takes into account acceleration and optionally magnetometer for better rotation tracking.
https://invensense.tdk.com/developers/software-downloads/
>>
>>2416048
show me a good imu that is in stock on ali and doesn't cost like $10 and i'm all for it. all good imus are sold out it seems
>>
I have an arduino that works in 3.3v and can give analog output. However "analag output" is just pulse width modulation.

I was planning to use that output in another digital circuit that works in 2.4v as an input. Would that be wrong to do so since it is pwm? I guess I should use a voltage divider instead
>>
>>2416202
Yeah just use a voltage divider.
>>
File: file.png (128 KB, 1869x815)
128 KB
128 KB PNG
>>2416065
>show me a good imu that is in stock
pic related. listed on mfr website as a distributor.
> on ali
kek, none. even if there was i'd be a chink part lasered with the icm part number anyways to scam retards who shop for parts on ali.
>>
>>2414973
leave unconnected unless it says otherwise - some chips will actually do different things depending on what voltage that "nc" pin is tied to
>>
>>2416352
yeah nice 1st world sentiment there burger but ordering from stores that aren't ali is often not an option for me because local stores have no shit in stock and eshops often have super expensive shipping or don't handle customs, ali is super cheap and handles customs shit for me
>>
>>2386764
This is absolutely terrifying. And imagine, they could have been doing this all along, but now we're at the point where they're using human brains wirelessly!
>>
>>2416048
What actually is one of these? Does it have the MEMS sensor directly connected to an analogue integrator?
>>
Is there something like a Quinled but with constant current feature? Want to smartify an aquarium LED light.
>>
>>2417433
No clue what Quinled is, but I’m guessing it’s designed for LED strips. For LEDs without their own current limiting, just add resistors. An LC filter might even be able to work to turn a PWM signal into a voltage that raw LEDs can handle, so long as you have some sort of overcurrent safeguard.
>>
>>2416628
>Does it have the MEMS sensor directly connected to an analogue integrator?
no, it's the mems sensor connected to an ADC with some built in optional digital filtering.
The outputs are raw acceleration in g's and rotation in degrees/sec.
The software driver library is a Kallman filter which takes the gyro and acceleration inputs and does predictive estimations to give absolute rotation.
>>
>>2418035
>no, it's the mems sensor connected to an ADC with some built in optional digital filtering.
I'd have thought connecting it to an integrator / coulomb counter would make integrating acceleration far more accurate compared to doing it after in the discrete time domain. Maybe the 3-axis make the math a nightmare.
>>
i am confused
esp32 has serial pins marked in the pinout but when i start the serial i can pick literally any pins i want to use as serial, so what is the point of marking them?
>>
File: 2.jpg (1.25 MB, 3640x2730)
1.25 MB
1.25 MB JPG
Please help. I used
https://github.com/MickGyver/DaemonBite-Arcade-Encoder
to make an arcade stick. It uses an Arduino Pro Micro. I soldered the pins to the micro, then connected all my buttons and joystick, and it worked fine for an hour, but then the board started shitting itself. Pin #2 is constantly active, no matter what. I tried isolating the issue by disconnecting different pins, having only one pin connected, and it doesn't change. As soon as I give an input, pin #2 lights up as if a button connected to it is constantly pressed.
>>
File: 3.jpg (1.73 MB, 3640x2730)
1.73 MB
1.73 MB JPG
>>2418153
Here's how my connections look. A wire chain with snap on terminals to 1 leg for each button, which then connects via a dupont connector to one ground pin on the board. Then one wire soldered to each button, connecting to it's designated pin with a dupont again. Joystick came with it's own wire with ground and everything. So I'm not sure if my connections are retarded and caused the issue, if the board is just too Chinese, or if some pin touched something in side the case, because it was just sitting there in the jungle of cables and fried the chip.
>>
File: 1522872928376.jpg (43 KB, 650x793)
43 KB
43 KB JPG
>>2418153
>>2418158
please respond...
>>
>>2418158
>>2418153
replace it with a fresh board, if it still has an issue then it's your wiring, if not then the board blew.
>>
>>2418594
I did today, same thing happened, except a different pin. It spazzes out even with nothing connected to it though, just the USB for power. Could it be how the pins are soldered to the board? I really can't see how that would be an issue though, but what else?
>>
>>2418601
Probably need to check the pins with an oscilliscope to see if there is any noise issues.
Besides that make sure you run ground to each button terminal back to a single ground point on the board (star ground topology).
Use external pullups on the buttons not internal ones and use active low triggering.
Also might need debouncing capacitors.
>>
>>2418153
Those jumpers are unreliable at best, especially the cheaper ones. Does moving them around, or putting mechanical pressure on any other part of the circuit, accentuate it's intermittency?
>>
File: 1650857216374.jpg (57 KB, 640x770)
57 KB
57 KB JPG
>>2418647
>>2418655
Guys I couldn't fall asleep so I just got up and redid the entire wiring and now it just works. Doesn't explain why the board registered an input with nothing connected to it, but fuck it. The wiring I thought was more than good enough, but I guess not. I also did have one ground for all buttons, and moving/pressure made no difference before, but yeah. Thanks for replying still.
>>
>>2418698
>an input with nothing connected to it
All pins should be configured as outputs or have something connected to them, it's a basic rule of digital electronics.
>>
Those little OLED ssd1306 displays are all byte-addressed, meaning you need a, say, 128*64 byte frame buffer in your RAM. This is quite a lot of memory on a microcontroller.

While it would definitely be more complicated and finicky to write, what is stopping me from creating a 16x8 array of uint8_t's to serve as a bit field representation of a display instead, using bitwise manipulation to address bits in the array?
>>
>>2418823
>128*64 byte frame buffer
I thought they were just one color? (aside from the blue/yellow versions), so that would be 128*64 bits, not bytes.
As long as you have 1K of memory to work with, great.

I did one of those IL9335 LCD displays with no frame buffer, but you write them a pixel at a time, so there was no need.
If you're real careful you could drive one of those OLEDs with no frame buffer, you just couldn't do shit like draw diagonal lines all over. 16x8 text could be done with 8x8 characters.
IIRC the slices are vertical so you could use narrower characters to get more per line.
>>
>>2418832
I was under the impression that even though they're monochrome, since microcontrollers are almost always byte-addressable (with word size of 1 byte), you would need to use 1 entire byte minimum for each pixel, sorta like how a bool still has to use an entire byte even though it's only 1 or 0
>>
>>2418120
because ardutards and blinkies dont understand how a gpio mux works
>>
>>2418823
You don't NEED a frame-buffer if you generate the data as you need it. Not like the thing runs on DMA (does it?). But if you're rendering similar things over and over again it does make things easier, just update some bytes of the buffer instead of re-rendering the whole thing each frame.

And yeah, pretty sure it is just 128x64 bits like the other guy says.
>>
>>2418803
I meant to say it's registering an input in the device manager properties for the device after it's programmed as a controller. As if the button assigned to pin 2 in my case was always being pressed, when I had everything disconnected from the board. My next issue is that if I map the joystick to the D-Pad functions in the steam controller settings, it acts as if down is constantly pressed in Steam only, when in the device manager it works fine and doesn't register a down input, unless pressed. If the joystick is mapped to the joystick configuration in Steam it doesn't do it. My brain is fried at this point.
>>
File: file.png (350 KB, 1034x359)
350 KB
350 KB PNG
Do you think I can safely remove the usb plug and solder wires to an usb HAT? I'm trying to save space and stack modules on top of each others on my pi
>>
>>2418947
>Do you think I can safely remove the usb plug
that depends on how good your desoldering skills are.
>>
I've been using msp430s and want to jump to ARMs I have a blue pill that never bothered to use, and I have some questions
I know STM has CubeMx to do the HAL and bootstraping
is this code/library free as in freedom?
are there any replacements/alternatives?
is the HAL some kind of standard?
>>
>>2419026
Cube shit is from ST, and HAL is their official support library
CMSIS is ARM's support library for the common ARM Cortex bits



Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.