#avr Logs

Sep 22 2020

#avr Calendar

04:06 AM LeoNerd: Today it's "adventures in SCPI", or at least: how close to an SCPI-ish type thing can I implement over a simple UART console
04:15 AM LeoNerd: I need a variant of strcmp_P() which is aware of the shortening forms of SCPI commands. E.g. "OUTPUT" shortens to "OUTP" (4 chars), but "INPUT" becomes "INP", because if the 4th char is a vowel it gets dropped too
06:22 AM LeoNerd: I wonder if avr-gcc has a feature whereby I can somehow explain that a bunch of static vars in one .c file are never going to be live at the same time as a bunch of static vars in other .c files, so it might as well share the same RAM for them both
06:22 AM LeoNerd: I can't just "union" them because different ,c files
06:26 AM cehteh: union things/swapping would be portable
06:27 AM cehteh: otherwise you would need to put them into their own section and let the linker do the overlay
06:28 AM cehteh: cant you make a shared-vars.c|h for the union thing and implement these overlays there?
06:28 AM * cehteh wanted to do that once, but lost interest because it never became important
06:31 AM vmt: sounds like a pretty trivial thing to do, really
06:32 AM cehteh: yeah, but good way to shoot into your foot
06:33 AM vmt: you have to be an extremely aspiring metaprogrammer to manage to make a spaghetti avr program
06:34 AM cehteh: not necessary, you can modularize that well
06:35 AM vmt: modularize what? some trivial ~100 loc modules that do what? set up peripheral regs?
06:35 AM cehteh: huh? thats nothing to do with hardware
06:36 AM vmt: then i lost you, did you mean some kind of a device config?
06:36 AM cehteh: just implement some discrimiated union thing, make an api around where you define what vars are put into that shared space
06:36 AM cehteh: no
06:39 AM vmt: yeah alright for a second there i thought we changed subjects, my bad
06:40 AM vmt: anyway i'm not sure what do you mean by saying can't just "union" because different .c files
10:06 AM J0ND03: What would you say is good documentation (not a guide) for avr programming to start with?
10:17 AM polprog: the dataaheets are pretty good at explaining peripherals if you know the very basics
10:17 AM polprog: they come with code examplea
10:17 AM polprog: examples
10:47 AM vmt: i'd say the datasheets and app notes are the only *documentation*
10:48 AM vmt: however if you're not familiar with the subject matter to begin with then it's not really what you want
10:49 AM vmt: then you'd probably be best off picking up a copy of the new edition of the art of electronics and going from there. i only have the 2nd ed which is a dinosaur by everyone else's standards save for rue's, but i've heard the third ed is brought up to speed at least somewhat
11:00 AM J0ND03: I have programmed mcus before
11:02 AM vmt: well then just pull up the datasheet and get going. avrs have very little boilerplate setup that needs to be performed yourself
05:24 PM cehteh_: any recommendation for a HV capable programmer for rare use? old tinys? something cheap
05:32 PM Rab: STK500 is probably pretty cheap if you can find one. avrdragon is a little newer, but it's kinda fragile.
05:32 PM cehteh_: yeah heared about that
05:34 PM Rab: Looks like 0 avrdragons on eBay, and STK500s start at $60 inc. shipping...more than I'd want to pay for one.
05:34 PM cehteh_: exactly
05:35 PM cehteh_: usually i leave reset enabled, but a project may need it disabled
05:35 PM cehteh_: possibly i can develop and test it all with one gpio less and only fuse it as last step
05:36 PM cehteh_: if a hv prgorammer would be around $10 then mkay
05:36 PM cehteh_: only brainfart stage yet, just asking if anyone knows thne i could order one to have it when needed
05:44 PM vmt: probably less of a hassle to make one yourself
05:46 PM cehteh_: yes, just googled there are some easy hackish things, will only be used once in a while so it would be ok
05:47 PM cehteh_: if there was one available for 10-15 bucks .. some generic china clone then i would just order it
06:12 PM vmt: you've got to be fucking kidding me. aliexpress throws http 500
06:14 PM vmt: with their hotshit web stack react native js restful nodejs vue beautify.js wasm django mongo redis clusterfuck, how could this ever happen!+?!?!
06:15 PM vmt: throw on top a dozen security nerds who cream their pants while having wet dreams about crypto, this is surprising!
06:20 PM vmt: oh yeah, forgot microservices. very important
06:30 PM splud: cehteh_ - if is that you need an actual HV programmer, or just need HV fuse reset?
06:31 PM cehteh_: splud: asked for cheap programmer because that would just solve it one for all, program chips no matter of fuse settings
06:32 PM cehteh_: otherwise, if its a fucked up tiny i'd just toss it away
06:32 PM splud: a little board with a charge pump does the trick for resetting, then I just use an AVRISP with pogo pin adapter.
06:32 PM splud: I got a bunch of Tinys on a spool, and they arrived - reset locked..
06:32 PM cehteh_: yeah knowing that, but thats not the question, i hoped someone points to me something i can click on amazon for less than $15 or so
06:32 PM splud: Clearly excess stock that had been preprogrammed...
06:33 PM cehteh_: still its only brainfarting dunno yet how i later solve this
06:34 PM LeoNerd: You know all the new ATtiny chips have much nicer HV programming
06:34 PM LeoNerd: It's just the same as regular programming but with a momentary enable pulse, Any programmer will work
06:35 PM cehteh_: its abooutv tiny85 or 45 here
06:35 PM LeoNerd: Software doesn't need to care
06:35 PM vmt: https://www.amazon.com/PowerLix-Cappuccino-Chocolate-Stainless-Bubblegum/dp/B08CVNM2ZH/ref=gbps_img_m-9_475e_73df5669?smid=A2OET8EV45HR4D&pf_rd_p=5d86def2-ec10-4364-9008-8fbccf30475e&pf_rd_s=merchandised-search-9&pf_rd_t=101&pf_rd_i=15529609011&pf_rd_m=ATVPDKIKX0DER&pf_rd_r=973EBCD5TCQR5AR44K7R
06:35 PM vmt: here. < $15
07:25 PM twnqx: that shit is usually <5
07:27 PM twnqx: and while i have an stk500, a generic HV might be interesting. oh well.
11:13 PM day_ is now known as day