#avr Logs

Dec 27 2019

#avr Calendar

10:06 AM twnqx: do i have do fuse-disable jtag if i want to use I/O pins shared with jtag pins?
10:12 AM twnqx: this board is more challending to program then expected. so many mistakes to be made :P
10:14 AM Fuchikoma: What board?
10:15 AM twnqx: self-build, mega32u4 that controls up to 16 5V ports (up to ~4A each, theoretically)
10:15 AM Fuchikoma: Neat
10:16 AM Fuchikoma: Should've left yourself an ISP header and just used that
10:16 AM twnqx: yeah, some friends needed something to hard-reset some things like raspberry pis
10:16 AM twnqx: oh, i have an ISP header (stupidly wired wrong :( )
10:16 AM twnqx: and i am not even using JTAG, but apparently that's fuse default
10:16 AM Fuchikoma: Unintentionally proprietary :D
10:17 AM twnqx: nothing jumper wire can't fix!
10:18 AM twnqx: also, already fixed in the PCB design
10:20 AM twnqx: https://i.imgur.com/wcF2KC3.jpg :)
10:20 AM twnqx: they can be stacked via I2C, aith automatic address selection, though the code doesn't exist yet, and so the hardware isn't tested :S
10:22 AM Fuchikoma: That's adorable
10:22 AM Fuchikoma: I like the PCB mounted WAGO connectors. I didn't even know that was a thing
10:23 AM twnqx: only the orange one is a wago :P the other ones are RND (i think metz connect or something)
10:27 AM Fuchikoma: So this is just switching other electronics boards on and off? There's not much in the way of IO protection
10:28 AM twnqx: there's just ESD diodes on both I2C and USB lines
10:29 AM twnqx: and yes, the 100R to limit the mosfet drive is probably too small to prevent overvoltage from going into the avr :P
10:29 AM twnqx: the only other protection is a fuse (car fuse type)
10:30 AM twnqx: out of curiosity, what would you have added?
10:31 AM Fuchikoma: Well if you were dealing with higher voltages, some optoisolation. Or if inductive loads like coils/motors, flyback diodes
10:31 AM twnqx: if higher voltages where a thing i'd have added a second transistor or moved the pull-ups at the mosfets to the atmel's VCC, but since it's powered straight from VIN too..
10:31 AM twnqx: both correct, but it's explicitly meant for electronics
10:31 AM Fuchikoma: Yeah so it's not really a rpoblem
10:32 AM twnqx: and 5V only, hence straight diodes from both USB and the big fat connector to the avr's VCC
10:32 AM twnqx: no regulators or anything
10:33 AM twnqx: on some other board i used a SEPIC regulator there that would give 5V from ca. 3V-36V
10:33 AM Fuchikoma: Well with mosfets it's generally okay to have a mismatch between switched and switching voltage
10:33 AM Fuchikoma: So I'd not even think twice switching 12V with a 5V MCU that way
10:34 AM twnqx: these are P-Channel anyway, so they turn on with gate=0V
10:34 AM Fuchikoma: potayto-potahto :p
10:34 AM twnqx: not quite, don't want a boost circuit to run n-channel
10:34 AM twnqx: though they are more efficient iirc
10:35 AM Fuchikoma: Dunno why a boost circuit would be necessary for n-channel mosfets?
10:35 AM twnqx: for high-side switching
10:36 AM twnqx: of course you could just do low-side switching and not need a boost voltage
10:37 AM Fuchikoma: I'd also never consider doing high side switching with n-channel so I was a bit confused there
10:37 AM twnqx: there are some cases where you want that
10:38 AM twnqx: but it's crazy that these tiny sot-23 can handle 4 amps...
10:38 AM Fuchikoma: Just needs adequate heat sinking
10:39 AM vmt: twnqx: you're running out of io on that u4?
10:39 AM vmt: *cough* should have used a proper mcu
10:39 AM twnqx: vmt: 100% use, if you consider the unpopulated serial port, yes
10:39 AM twnqx: and i wouldn't say running out, perfect fit:P
10:40 AM vmt: is it a u4 because of usb?
10:40 AM twnqx: yes
10:40 AM vmt: loonix niggers need their rpis to be booted from a master rpi via usb?:DD
10:40 AM vmt: is this for some cluster rpi idiocy?:D
10:41 AM Fuchikoma: Dogecoin miner
10:41 AM twnqx: it's actually (too) cheap chinese TV boxes for pokemon GO scanning, but who am i to judge what others do
10:41 AM vmt: what the actual fuck
10:42 AM twnqx: android TV box with 2G ram and 16G flash for 14€ including shipping, the price must come from bad components
10:42 AM twnqx: so these... crash
10:42 AM vmt: b-b-but
10:43 AM vmt: 16 of them??
10:43 AM twnqx: apparently they need ~100 for one city :P
10:43 AM Fuchikoma: This is some Minority Report level shit, but with Pokemon
10:43 AM vmt: apparently they need to get laid
10:43 AM twnqx: that's why the things are stackable
10:44 AM vmt: Fuchikoma: yes, though i'm thinking the power plant guy from simpsons going eexxcelleent
10:44 AM twnqx: so far they are using PoE breakouts... and PoE switches... to cycle them...
10:44 AM twnqx: which is slightly more expensive...
10:44 AM vmt: now they can just write cool shell scripts?
10:45 AM twnqx: like "echo cycle 1/15 > /dev/ttyACM"
10:45 AM Fuchikoma: "A Suicune has been spotted by the lake in central park - Deploy the SWAT!"
10:45 AM twnqx: great shells cripts...
10:45 AM vmt: "first we take berlin then we take pikachu"
10:46 AM twnqx: i mean
10:46 AM vmt: twnqx: for cool hackery you also need to print out stuff to stdout when you do these kinds of things
10:46 AM twnqx: they probably use shell scripts already
10:46 AM vmt: like *** BOOTING DEVICE ID 0x21A1 ***
10:47 AM vmt: *** BOOT SEQUENCE COMMENCING ***
10:47 AM vmt: *** BOOT SEQUENCE COMPLETE *** ... *** WELCOME BACK, COMMANDER ***
10:47 AM twnqx: none of my business
10:47 AM twnqx: i needed to jump into LUFA and ACM shit for work anyway, so this is a nice warmup
10:48 AM vmt: sure, if they pay you anywho
10:48 AM vmt: but LUFA is just... no
10:48 AM twnqx: it is kind of ugly yet convenient
10:49 AM vmt: also the avr usb line is very limited. i suggest stm32s
10:49 AM twnqx: it's good enough
10:49 AM vmt: i mean the devices themselves are very limited, avrs which have usb hw
10:49 AM Fuchikoma: I don't see how this application is anywhere near the limits
10:50 AM vmt: Fuchikoma: no, not this application
10:50 AM twnqx: does stm32 work without any vendor shit like "use this crap IDE that only exist on windows!"?
10:50 AM vmt: yes. arm-gcc
10:50 AM nohit: of course it does
10:51 AM twnqx: ah, arm cores
10:51 AM vmt: stm32 == arm cortex-m
10:51 AM twnqx: i had to deal with TI's MSP430 recently
10:51 AM twnqx: that was... less convenient
10:51 AM nohit: AVR is more like "use this crap IDE that only exist on windows!"
10:52 AM twnqx: you mix up arduino with AVR
10:52 AM nohit: ST's ides work on all platforms, if you wanna use one
10:53 AM twnqx: maybe some day when i hit the limits of avr i'll check that out
10:53 AM vmt: who cares about the IDEs. you can just use arm-gcc and openocd to debug
10:53 AM twnqx: so far i use NXP's cortex-m
10:53 AM vmt: THEN AGAIN if you're on avr and you want to use debugwire or whatever is that new protocol
10:53 AM Fuchikoma: UPDI
10:53 AM vmt: it's like pay up AND USE THIS CRAP IDE THAT ONLY EXISTS ON WINDOWS
10:54 AM vmt: well wait updi works outside of that i guess.
10:54 AM Fuchikoma: Or whatever it's just a 1-wire serial port
10:54 AM twnqx: jtag works outside of that, too
10:54 AM vmt: yes but small devices don't have JTAG
10:54 AM twnqx: with a gdb debug bridge
10:54 AM vmt: and i guess the old devices don't have updi
10:55 AM vmt: then again the need for debugging on small devices is questionable at best
10:55 AM twnqx: i guess stm32 in 6 or 8 pin packages also don't jave jtag :P
10:55 AM vmt: they have SWD
10:55 AM vmt: single-wire-debug
10:55 AM twnqx: true
10:55 AM vmt: which is supported by openocd
10:55 AM twnqx: yeah, i've actually thrown AVRs on "i need a digital 50hz signal"
10:55 AM vmt: comparing avr to stm32, avr is more the "use this ide that's crap..."
10:56 AM twnqx: which is kinda... overkill
10:56 AM twnqx: but definitely won't require debug :P
10:56 AM vmt: avrs are too expensive for that
10:56 AM vmt: unless mcp has brought the prices down
10:56 AM vmt: no doubt because they have more production capability
10:56 AM twnqx: dunno, some are 70ct or so
10:57 AM vmt: yes *some* which get you 1½ bytes of flash and a nibble of ram running on half a hz clock
10:57 AM twnqx: but yeah, the price tag of these mega32u4 is... ugh
10:57 AM vmt: because for some reason avr people are obsessed with being small. and this doesn't mean the physical size
10:57 AM twnqx: remember the TV boxes for 14€? well, these chips cost nearly 4€... in comparison...
10:57 AM vmt: twnqx: i'm aware
10:57 AM vmt: stm32's would be considerably cheaper
10:57 AM vmt: for the same feature set
10:58 AM vmt: but you aren't doing a huge batch i figure. <10 devices i guess. so you can just charge the pimplehead nerds some extra
10:58 AM twnqx: if it wasn't for the price of tie for learning all the stuff i'd have switched long ago to something saner
10:59 AM twnqx: time*
10:59 AM twnqx: hm, i have something in mind i want build next year
10:59 AM twnqx: maybe that will be good thing to try STM32s out
10:59 AM twnqx: AVRs have too many annoying side effects
10:59 AM twnqx: like
10:59 AM twnqx: want 16MHz? better use 5V, not 3.3
11:00 AM Fuchikoma: Are you too good for BASIC stamps? :D
11:00 AM twnqx: yes
11:00 AM Fuchikoma: Thank goodness
11:02 AM vmt: twnqx: it does not take a whole lot of time to learn stm32s
11:02 AM Fuchikoma: What if I prefer to program everything in assembly?
11:02 AM twnqx: in the end, all chips are alike
11:02 AM twnqx: or, almost all :P
11:02 AM vmt: ...then do so
11:03 AM vmt: twnqx: well with stms you have a lot more registers to set up for peripheral and clock configuration
11:03 AM twnqx: obviously
11:03 AM vmt: but once you learn that bit, it's all smooth sailing from there
11:04 AM vmt: and, with most devices you get a dma controller too
11:04 AM vmt: brb
11:15 AM circuit is now known as elektrinis
11:51 AM nohit: Fuchikoma: then you buy the excellent book ARM ASSEMBLY LANGUAGE - Fundamentals and Techniques
11:51 AM nohit: no reason why you couldnt use assembly with stm32s
11:52 AM nohit: sometimes you want to use assembly to acceess the special DSP insturctions
11:53 AM nohit: altho you can use intrinsic functions with C to use them
11:53 AM Fuchikoma: I dot' even use libraries
11:57 AM vmt: i don't even use an assembler
11:57 AM nohit: you assemble by hand?
11:57 AM nohit: on paper
11:57 AM vmt: just write out the machine code out directly
11:58 AM vmt: mnemonics are overrated
11:58 AM nohit: yeah
11:58 AM Fuchikoma: https://wikileaks.org/IMG/jpg/HUOptII_hackers_keyboard.jpg
11:59 AM vmt: writing one bit at a time is really counterproductive
12:01 PM vmt: you should just have a keyboard with keys from 0 to FF and write a nibble at a time
12:01 PM vmt: F*
12:01 PM vmt: you'd be 4 times more productive. 16 keys isn't that bad. how about it?
12:02 PM Fuchikoma: I may have to waste calories moving my wrist to reach them all
12:03 PM nohit: i have this book about finnish games and it says that back in the 80's it was really common to code on paper and then assemble it by hand
12:03 PM nohit: among game devs
12:03 PM Fuchikoma: I did that shit in high school for the Z80
12:03 PM Fuchikoma: Kinda sucks TBH
12:07 PM vmt: doesn't sound that wild, really. instruction sets weren't as big as they are now. just try to do that with an x86 ISA
12:07 PM Fuchikoma: Still sucks
12:08 PM vmt: sure. and of course you can still do mundane and inefficient programs just as easy with an x86 isa, but there are so many specialized instructions
12:08 PM vmt: in any case. should probably do something productive rather than hang around in irc
12:09 PM vmt: 9/10 top dentists worldwide recommend avoiding irc
12:09 PM Fuchikoma: That's proof that irc prevents cavities
12:10 PM vmt: yeah, the conspiracy
02:22 PM PublicWiFi is now known as lol
02:57 PM lol is now known as PublicWiFi
05:40 PM twnqx: nohit: can confirm, i taught myself asm on the C128 - though that one had an some assembler in rom
05:42 PM twnqx: there just were no other usable languages (the ROM based BASIC was too slow) - though there was Pascal on CP/M for the C128's Z80 CPU, dunno if C existed for that though, never had it
05:55 PM nohit: ok
05:56 PM nohit: i never did programming with my c64, except writing example programs from the manual with my sister
05:56 PM nohit: *typing
05:57 PM nohit: i was too young
05:57 PM nohit: or maybe not too young, but that didnt interest me back then
05:59 PM nohit: i did try C with c64 few years ago
05:59 PM nohit: cc65
07:52 PM davor_ is now known as davor
11:56 PM day__ is now known as day