#avr Logs

Oct 11 2017

#avr Calendar

12:09 AM day__ is now known as daey
12:34 AM rue_: #define SetBit(BIT, PORT) (PORT |= (1<<BIT))
12:34 AM rue_: #define ClearBit(BIT, PORT) (PORT &= ~(1<<BIT))
12:39 AM Thrashbarg: rue_: there's probably an assembler macro to use the sbi and cbi op-codes too
12:39 AM Thrashbarg: rather than doing a read/modify/write cycle
12:40 AM rue_: gcc reduces it to the instruction
12:40 AM Thrashbarg: ah!
12:40 AM rue_: but if you use that macro, its readable code
12:40 AM Thrashbarg: yea
12:40 AM rue_: esp if you stack it in names
12:41 AM rue_: #define ledport PORTB
12:41 AM Thrashbarg: yeah
12:41 AM rue_: #define ledbit 1
12:41 AM rue_: #define ledOn() SetBit(ledbit, ledport)
12:41 AM rue_: #define ledOff() ...
12:42 AM rue_: which reduces itself nicely so sbi or cbi
12:42 AM rue_: BUT, if you use the macro on a memory location, it still works
12:43 AM rue_: unsigned char Flags;
12:43 AM rue_: #define explodeBit 3
12:43 AM rue_: #define explode() SetBit(explodeBit, Flags);
12:44 AM rue_: er, less semicolon
01:19 AM Jartza: Lambda_Aurigae: I actually hate USI and I never use it for i2c or spi :D
01:19 AM Jartza: for i2c and spi I have my bitbanging libs, and USI is only mis-used for other purposes
01:19 AM Jartza: like 12-bit timer, VGA pixel drawing etc :)
01:37 AM ravon: Any Atmel devs who work on Start alive?
01:44 AM rue_bed: dont think so
01:44 AM rue_bed: Jartza, I think the usi is more work and code than a good bitbang lib
02:35 AM JanC is now known as Guest86327
02:35 AM JanC_ is now known as JanC
02:59 AM Jartza: rue_bed: well, not necessarily more code, nor work, but as USI only has start & stop detection and rest of it is just shift register + clock handling + black box, you have more control with just bitbang :)
05:25 AM Emil: https://emil.fi/jako/kuvat/2017-10-11_12-54-18_D56EwzD0.png
05:25 AM Emil: I should do something about this
05:34 AM MacGeek: Emil: I've actually gotten down to 0 bytes free a couple of times. the system... wasn't very happy.
06:18 AM Lambda_Aurigae: MacGeek, look at the octapentaveega
06:19 AM Lambda_Aurigae: 32 bytes of ram...all used...plus using registers from unused peripherals for variable storage.
06:19 AM Lambda_Aurigae: oops
06:19 AM Lambda_Aurigae: 512bytes of ram
06:20 AM Lambda_Aurigae: still, all used, and then some.
06:20 AM Lambda_Aurigae: the ram is used as a single block of video display buffer.
07:39 AM Emil: https://emil.fi/jako/kuvat/2017-10-11_15-08-01_DTATwVIG.png
07:39 AM Emil: Fucking Chrome REEEEEEEEEEEEE
07:45 AM thardin: rooo
07:47 AM Emil: https://www.youtube.com/watch?v=N9dc5f3OUGY daily "animu was a mistake" humour
11:46 AM polprog: Emil: why does it say "if her age is on the clock, she's ready for..." in polish in the description o_O
11:59 AM Emil: Whatcha mean?
11:59 AM Emil: Do you have autotranslation on?
11:59 AM Emil: YouTube has this shitty feature nowadays
11:59 AM polprog: i dont think so
11:59 AM polprog: oh god
11:59 AM polprog: no
12:00 PM Emil: where the description and subtitles can be contributed
12:00 PM polprog: please dont translate shit for me....
12:00 PM Emil: :D
12:00 PM polprog: https://www.youtube.com/watch?v=zBRLvYInEbs
12:00 PM Emil: https://emil.fi/jako/kuvat/2017-10-11_19-28-52_s2aLOZW6.png
12:25 PM thardin: what if the child consents tho???
12:30 PM doppler: omg
12:33 PM thardin: /s of course
02:48 PM carabia: Funky question, is anyone aware of sd cards which would have a guaranteed ability to set the CID register?
02:50 PM carabia: I read an article of some samsung cards which may/may not let you change it, but tracking down the exact batch / whatever seemed shaky at best
02:54 PM doppler is now known as Guest33649
03:04 PM cehteh: what do you try to do?
03:04 PM carabia: i'm trying to change the CID, is it not clear?
03:04 PM cehteh: by standard ist readonly
03:05 PM carabia: ist achtung. yes i am aware, refer to my question
03:05 PM carabia: ty for input
03:05 PM cehteh: hehe
03:05 PM cehteh: well no manufacturer would gurantee some out of spec shit for you :D
03:05 PM carabia: oh hey thanks again, much obliged
03:06 PM carabia: refer to my question again
03:06 PM cehteh: its hard enough to get certification that is within spec :)
03:06 PM cehteh: yes
03:06 PM carabia: ...
03:06 PM cehteh: so, bit pointless to ask here
03:06 PM carabia: ask of you, in any case
03:06 PM cehteh: even if someone here has such card that not gurantee you anything
03:07 PM cehteh: maybe you can ask some chinese knockoff manufactuerers :)
03:07 PM carabia: oh hey gee wiz, thanks again!
03:07 PM cehteh: :)
03:08 PM carabia: asking in irc is kind of pointless to begin with i guess. for a very concrete problem some smartass comes along and offers a workaround solution that is either a) incredibly stupid, or b) not applicable
03:08 PM polprog: alibaba has some cards that are called "Custom OEM cid" and all that jazz
03:08 PM cehteh: the ppl whi did this bad usb stuff iirc has some success to reprogramm sd card controllers as well
03:08 PM carabia: or c) doesn't know anything but provides the channel with input anyway
03:08 PM polprog: but SD cards from alibaba are for me a write only memory :P
03:08 PM cehteh: that could be a pointer
03:09 PM carabia: polprog: yeah, i know, stuff in alibaba is usually sold in bulk in very large qty, isn't it?
03:09 PM polprog: some of them have mqq as low as 10pcs
03:09 PM carabia: i have no experience in dealing with that, apparently they would factory-set the CID for you?
03:09 PM cehteh: he asked about ability to set the CID, he didnt asked about reading it right?
03:09 PM polprog: neither have i
03:09 PM carabia: cehteh: I'm aware of those china-houses too that at least offer you "custom CID"
03:10 PM cehteh: write only :)
03:10 PM carabia: and that'd be enough for me, i'm wondering if anyone over here has experience in dealing with them
03:10 PM carabia: well, read-only actually
03:10 PM cehteh: nah write only
03:10 PM carabia: they would just apparently set it for you
03:10 PM carabia: at least that's the idea i'm getting
03:10 PM cehteh: :D
03:10 PM carabia: or do they sell them bulk with id XXX-XXX
03:11 PM cehteh: lots of scam and you hardly ever get the direct manufacturer only some inbetween merchant
03:11 PM carabia: i'm not interested in a cut they take in-between, no fucks given there
03:11 PM cehteh: prolly over different steps and he doesnt know what he sells
03:12 PM carabia: yes, that's why i'm wondering if anyone has tried them. your input is again much appreciated
03:12 PM cehteh: do you need the CID for identification?
03:12 PM carabia: are you like, one of those experts?
03:12 PM cehteh: nop
03:12 PM carabia: isn't that what IDs are for, don't you think?
03:13 PM carabia: kind of stands for identification, doesn't it
03:13 PM cehteh: not when they are customizeable and fakeable
03:13 PM cehteh: i'd rather consider them void features
03:13 PM carabia: well, it still is for identification. just of different sorts
03:13 PM carabia: though, this discussion is going nowhere with you
03:13 PM cehteh: maybe a weak id for selecting a mountpoint or raid member on disks or such
03:14 PM carabia: hey great, we can talk about loonix and shit
03:14 PM cehteh: but i'd rather burn some strong id onto it
03:14 PM cehteh: was just an example, same for embedded stuff
03:14 PM carabia: and completely irrelevant
03:15 PM cehteh: i just cant imagine any reasonable use case
03:15 PM carabia: you need not know the use-case.
03:15 PM carabia: reading comprehension sometimes is a dubious suggestion over at freenode
03:15 PM cehteh: well go on searching
03:16 PM polprog: in this case you'd get better help asking about making an avr emulate an sd card with a huge flash chip :P
03:16 PM carabia: an avr :)
03:16 PM carabia: what's that use-case for avrs again, oh yeah, into the dumpster it was
03:17 PM polprog: what's your mass to volume ratio carabia ?
03:17 PM carabia: what's my whatthefuckfuck?
03:17 PM polprog: how dense are you
03:17 PM carabia: eeheh that was easy
03:17 PM carabia: first of all, you wouldn't use a crappy avr to do that
03:18 PM carabia: second of all, well the suggestion isn't outside the realm of possibility, though a very elaborate one
03:18 PM carabia: you'd at least want dma to do that. avr + dma, oh wait.
03:23 PM carabia: anyway yeah, question's still valid. if someone's ever done stuff like that, drop me a line
03:24 PM carabia: great compensation awaits you
03:26 PM carabia: also, talking about being dense and working on a temp sensor for a few weeks while still not completing it, well i wouldn't know.
03:26 PM * carabia whistles
03:28 PM Tom_L: for the full specification you can buy a 2k license and additional costs for product distribution
03:29 PM polprog: what if i told you i dont do electronics 9 to 5.
03:29 PM polprog: maybe because i have a social life
03:30 PM Tom_L: i wouldn't care either way
03:30 PM carabia: what if i told you writing the interface takes about an hour, following the datasheet which explicitly tells you how to communicate with it
03:31 PM carabia: if even that. also Tom_L yeah i know, but i don't think that helps either as some registers are out-of-spec and designated by the manufacturers themselves, not by the sd spec
03:31 PM Tom_L: i have a few of the docs on the topic but not all by any means
03:31 PM carabia: of the CID specifically?
03:32 PM Tom_L: i'm not sure
03:32 PM Tom_L: it's been ages since i looked at that
03:32 PM carabia: hmm, sounds interesting
03:33 PM carabia: the way *someone* changed the cid register, was that they figured out how to drop the *samsung* card into some kind of a maintenance mode (this was done via an unspecified register reserved for mfs), and in that mode it let you set the cid manually
03:34 PM Tom_L: Read CID/CSD Registers
03:34 PM carabia: register, well command, as the spec calls it. That's at least how the short-spec described said command, that it was reserved for mfs. I don't have the full spec.
03:36 PM Tom_L: http://tom-itx.no-ip.biz:81/~webpage/pdf/mmc/SD/ProductManualSDCardv2.2final.pdf
03:36 PM carabia: yeah, those are in-spec commands
03:36 PM Tom_L: there's something for sandisk
03:37 PM carabia: yeah, that's in the sd-spec too. thanks anyway!
03:41 PM polprog: night
06:58 PM robinak is now known as robink
07:48 PM NonaSuomy: I disassembled some code off an avr http://termbin.com/vh2i it was a thermostat does it seem like a good dump where I could sit plunk away at to figure out how it works basically
07:49 PM Lambda_Aurigae: looks like a crap dump to me.
07:49 PM NonaSuomy: Are you making a joke?
07:49 PM Lambda_Aurigae: not really.
07:49 PM NonaSuomy: what is wrong with it?
07:50 PM Lambda_Aurigae: that doesn't look like much of a functional program.
07:50 PM NonaSuomy: Why's that?
07:51 PM Lambda_Aurigae: having written a bit of assembly code over the years, it really doesn't look like a functional program to me.
07:52 PM NonaSuomy: Yeah just wondering what is poking you in the eye about it
07:52 PM Lambda_Aurigae: and having had experience with disassemblers, I've seen similar in the past....
07:52 PM Lambda_Aurigae: well, doing an ORI on the same register several times in sequence
07:56 PM Lambda_Aurigae: yeah,,just looks,,,wrong...
07:57 PM Lambda_Aurigae: I could be totally off my rocker too.
08:02 PM NonaSuomy: I dumped the processor avrdude -c usbtiny -P usb -p m169v -b 19200 -U flash:r:/home/user/avrbackup/m169v/backup_flash.hex:i and avr-objdump –j .sec1 –d –m avr5 backup_flash.bin > backup_flash.txt
08:03 PM NonaSuomy: *backup_flash.hex
08:38 PM NonaSuomy: Have you ever tried avr-objdump?
08:41 PM Lambda_Aurigae: never needed it myself.
08:42 PM NonaSuomy: anychance you understand what those attributes are .sec1 avr5
08:42 PM NonaSuomy: I think avr5 is the architechture of the chip
08:47 PM NonaSuomy: Ah I found this http://www.nongnu.org/avr-libc/user-manual/using_tools.html
08:48 PM NonaSuomy: Well that's good was the right value there avr5 atmega169 __AVR_ATmega169__
08:52 PM NonaSuomy: have you ever dumped your eeprom? with avrdude?
08:53 PM NonaSuomy: When I tried to dump it, it got to 85% and then segmentfaulted
08:58 PM NonaSuomy: avrdude -c usbtiny -P usb -p m169v -b 19200 -U eeprom:r:/home/user/avrbackup/m169v/backup_eeprom.hex:i
08:59 PM absynth is now known as dan2wik
09:00 PM NonaSuomy: I'll see what radare2 does
09:03 PM NonaSuomy: Would there be a bootloader and then a point where it would start the actual code
09:06 PM NonaSuomy: Maybe it's not supposed to be dumped via :i intel hex?
09:09 PM NonaSuomy: Is .sec the header
09:28 PM NonaSuomy: https://www.onlinedisassembler.com/odaweb/FEih8zTV
09:28 PM NonaSuomy: Guess that basically spits out the same thing from the binary
09:31 PM NonaSuomy: If anyone has anything interesting to point out let me know it's a thermostat with an lcd screen on it 3 relays and termistor with 4 buttons on the display that engage options
09:32 PM NonaSuomy: https://docs.google.com/document/d/1RjELEAwVwomQNZ85qxeLYVS9LX1El6dRp2yQ6xPOCFs/edit?usp=sharing
09:32 PM NonaSuomy: I've been mapping out the circuit as well but haven't put it in the braindump above just yet
09:33 PM NonaSuomy: I want to essentially figure a bit how their firmware was working then rewrite it from scratch.
09:34 PM NonaSuomy: maybe add a wiznet ethernet adapter to it.
09:35 PM NonaSuomy: Maybe add a weekly schedule to it
09:41 PM NonaSuomy: Kinda like this project https://piontecsmumble.wordpress.com/2013/02/25/openhr-20-tutorial-part-0-introduction/
09:47 PM NonaSuomy: Could there be an issue that I dumped it with ISP instead of Jtag as to why the code looked unusal to you?
09:47 PM NonaSuomy: maybe it's missing something
09:52 PM rue_: hmm
10:00 PM NonaSuomy: the hr20 and this thermostat use the same processor not that that means much but it was interesting
10:01 PM NonaSuomy: rue_, any clues about anything in general?
11:12 PM rue_: burried in my own stuff, what you working on?
11:41 PM rue_ is now known as rue_mohr