#avr Logs

Feb 05 2019

#avr Calendar

10:13 AM PublicWifi: dumb question, but when programming an atmega328p or something, does it have to have the ext crystal to flash teh rom?
10:17 AM polprog: depends on the fuse bytes
10:17 AM PublicWifi: i see
10:17 AM cehteh: srock/default doesnt need one
10:17 AM PublicWifi: if its been set for ext crystal ill have to change the fuse bytes before i can remove it
10:17 AM cehteh: stock
10:17 AM PublicWifi: ahh ty perfect
10:17 AM polprog: short answer, since its mega328p, if you took it out of an arduino uno then you need one
10:17 AM polprog: :)
10:17 AM PublicWifi: haha no arduino here
10:17 AM PublicWifi: im trying to make a dev board that can fit atmega328p and attiny in the same zif socket
10:17 AM polprog: haha i remember you, mcdonalds
10:17 AM PublicWifi: they share a lot of pins, but the reset pin on the attiny lines up with XTAL1 on teh 328
10:17 AM PublicWifi: hey!
10:17 AM PublicWifi: xD
10:17 AM PublicWifi: Decided it was time for a name change
10:17 AM polprog: :P
10:17 AM PublicWifi: okay another question
10:17 AM PublicWifi: when programming, are fuses set first or last?
10:17 AM PublicWifi: aka if i set a fuse to require a crystal will the flash then fail without one?
10:17 AM cehteh: depends on what you want to do. reads datasheet
10:17 AM PublicWifi: ahh okay
10:20 AM PublicWifi: xD
10:20 AM PublicWifi: looks like the pinout between attiny and atmega328p aren't gonna work well together.. oh well
10:21 AM cehteh: which tiny?
10:23 AM PublicWifi: in this case 85
10:23 AM PublicWifi: but 8 pin tiny's
10:24 AM PublicWifi: gnd is gonna be an issue haha
10:24 AM PublicWifi: i was going to try and keep this down to one zif socket for both types
10:24 AM cehteh: the differ significantly in other things as well
10:24 AM PublicWifi: well the vcc, sck, miso, and mosi all lined up
10:25 AM cehteh: well you may add some crossbar for some pins, but hell breaks loose when you do something wrong
10:25 AM PublicWifi: the zif connector i have has notches out the 8 middle pins, so its kind of key'd
12:17 PM gsi__ is now known as gsi_
01:08 PM davor_ is now known as davor
03:05 PM PublicWifi is now known as McDonaldsWiFi
03:06 PM McDonaldsWiFi is now known as PublicWiFi
04:35 PM MrTrick: morning! I'm trying to program a digispark with a bootloader hex file and an arduino-generated hex file in one pass. Is there a "duh here's the obvious solution" method?
04:36 PM MrTrick: I tried the srec_cat program, but got the error "srec_cat: modeCycle_5.ino.hex: 1: multiple 0x00000000 values"
04:45 PM cehteh: digispark comes with the mirconucelus bootloader
04:47 PM cehteh: ah and the hexfiles contain offsets, you have to correct that somehow ..actually dunno what you try to do there but you cant just cat code after each other and expect it to work unless you make other corrections
04:47 PM cehteh: best is to use the linker to build one single .hex file
04:55 PM MrTrick: cehteh: it's a bit tricky - the app developer isn't around now and all I've got is the arduino-generated hex file.
04:55 PM MrTrick: The bootloader I need is the one that checks a pin, rather than delaying.
04:55 PM MrTrick: (so eg hold down the button when powering on to program)
04:58 PM cehteh: no source?
04:59 PM cehteh: the micronucleus bootloader is pretty configureable when you bild it by yourself
05:03 PM MrTrick: Source for an older revision, the current one is lost somewhere
05:04 PM MrTrick: (but this is for 100+ units and as long as the boards work, no drama)
05:04 PM MrTrick: It seems like the program hex doesn't have any offset in it - is that how bootloaders expect to be given a program?
05:08 PM MrTrick: see both here: https://gist.github.com/MrTrick/bbd1d704d1f6aac204cda7f3f67c7a32
05:14 PM cehteh: .o(source lost.. wtf)
05:14 PM cehteh: use git
05:15 PM cehteh: mirconucleus can upgrade itself
05:16 PM cehteh: you need to refer to the docs for that
05:16 PM cehteh: afte done so you then use the new mirconucleus to flash your program
05:19 PM MrTrick: thing is, it's much easier in this application to flash over ISP than USB
05:20 PM MrTrick: I just want the bootloader in there for later users. (to put their own programs on)
05:20 PM cehteh: then flash by isp
05:21 PM cehteh: iirc avrdude has some option for offsetting code, *but* the code must work on that address whatever that means for your actual case
05:22 PM MrTrick: right. :-) hmm.
05:22 PM cehteh: mhm or you need to do the linker to do that or patch the hex whatever
05:23 PM cehteh: i'd prefer to have the source around :)
05:23 PM MrTrick: yeah fair enough
05:23 PM MrTrick: This is a toy, and software is just glue here. We're not making a rocket.
05:26 PM [1]MrMobius is now known as MrMobius
05:27 PM MrTrick: ooh! Program the chip laboriously, then read the hex out.
05:28 PM cehteh: or that
05:32 PM MrTrick: updated: https://gist.github.com/MrTrick/bbd1d704d1f6aac204cda7f3f67c7a32
05:32 PM MrTrick: I wonder if any of the file is "junk" that can be trimmed out
05:33 PM cehteh: your paste tells me as much as i can read and disassemble hex file as i read :D
05:33 PM cehteh: when it works just keep it as is
05:34 PM cehteh: when not, use the source
05:34 PM MrTrick: that's true. ^_^
05:34 PM cehteh: or patch your .hex .. glhf :D
05:37 PM MrTrick: doesn't seem like fun.
05:38 PM cehteh: when you lost the source it looks like self-inflicted harm
05:40 PM MrTrick: There's always difficulty when a person leaves. And doesn't document properly. And doesn't put their code into source control.
05:40 PM * MrTrick shrugs
05:40 PM MrTrick: at least this is a solution for now
05:41 PM cehteh: you set source control up at very first .. and use that as 'communication' medoum where the code it passed around
05:41 PM cehteh: i dont even know how with any sensible workflow it can happen that you have a .text w/o the source
05:41 PM cehteh: a .hex
05:42 PM cehteh: even if discouraged one may put the .hex under source control .. still no way to loose the source
06:13 PM i-make-robots: hi avr. I'm reading code for Marlin 3d printer firmware and trying to grok MultiU24X32toH16(), whose notes claim long1*long2>>24. i can't see why I'd want to >>24 after the mul.
06:14 PM MrTrick: cehteh: yes quite.
06:15 PM i-make-robots: for reference: https://github.com/MM56/Marlin-Dagoma-Discovery/blob/master/Marlin/stepper.cpp#L132
06:27 PM cehteh: haha i needed to write a special division for my stepepr driver as well to make it fast, but i did in C
06:32 PM cehteh: i-make-robots: B0 A0 are bits 24-39 and are the returned value
06:32 PM cehteh: the code in the comment is only example how to extract those bits, its not really shifted below
07:19 PM ruel is now known as lvlinux
07:49 PM [1]MrMobius is now known as MrMobius
11:34 PM day_ is now known as day
11:52 PM JoeMooCow is now known as JoeLlama