#avr | Logs for 2016-09-09

Back
[04:22:44] * twnqx reverse engineers some code
[04:22:54] <twnqx> and it reminds me again why i hate c++
[04:23:16] <twnqx> these guys xor-decode some byte array
[04:23:56] <twnqx> and probably have something like "string = string.append(newly_decoded_char)"
[04:24:22] <_ami_> twnqx: binary to asm to real code?
[04:24:35] <twnqx> which turns, for each char, into creating a new string from the char, calling append, and copying the string over
[04:24:38] <twnqx> using three functions
[04:25:00] <twnqx> where a simple *target++ = new_char; would suffice
[04:25:06] <twnqx> _ami_: yes that
[04:27:14] <twnqx> the one thing that worries me is that i can see the std::string::string call, but not the std::string::~string
[04:27:52] <twnqx> maybe no memory is allocated, but i also see no refcount decrement or anything that would show a garbage collector that it can clean up
[04:46:05] <_ami_> twnqx:i am sure of the fact that you are having fun ;)
[10:13:08] <NoSu> on a hall effect sensor the sensitivity ranting -11 mV/mT to +45 mV/mT if you want a less stronger magnet to trigger it what direction would you go for?
[10:14:43] <sabor> a weaker magnet has less mT so you want a bigger mV/mT rating
[10:26:13] <NoSu> thank you sabor
[15:05:46] <owl-v-> what is bigger version of attiny13a ?
[15:09:23] <owl-v-> you have makefile, avr-gcc, avrdude. how do you debug your avr code?
[15:17:10] <cehteh> owl-v-: attiny25, 45, 85 .. but they have some differences to the tiny13
[15:17:49] <cehteh> iirc there is no 100% compatible but bigger (as in more flash/ram) version to the tiny13,
[15:19:09] <cehteh> but for most cases the 25,45,85 have more features, not less, maybe some registers are at different positions, so you need to recompile and port your program
[15:19:30] <cehteh> i've done that and usually its no trouble
[15:20:04] <carabia> owl-v-: with/without the target?
[15:21:44] <cehteh> logic analyzer and/or blink a led on a output
[15:21:54] <cehteh> which is a bit tight on the tinys :)
[15:21:55] <owl-v-> debugging with the target, but without using atmle studio
[15:22:12] <owl-v-> how do you read register files?
[15:22:28] <owl-v-> or variables ?
[15:24:56] <cehteh> i dont
[15:25:04] <carabia> Well, first of all you need something capable of JTAG
[15:25:17] <cehteh> tinys have debugwire
[15:25:24] <carabia> or DW (which is proprietary atmel and you're kind of fucked unless you go atmel studio)
[15:25:25] <cehteh> but i never used that
[15:25:45] <cehteh> just instrumentate your code, write simple understandable code, make it robust and working
[15:25:50] <cehteh> optimize later
[15:25:50] <carabia> and then you need something like avarice/openocd + gdb
[15:26:01] <carabia> But i wholeheartedly recommend going with atmel studio.
[15:26:09] <cehteh> logic analyzer helps a lot too
[15:26:30] <cehteh> clocking the chip down is sometimes nice for debugging, doing things in slowmo
[15:26:40] <carabia> There's really no reason not to if you want to do DW, and really you have no alternatives (at least not any sound ones)...
[15:27:59] <carabia> then again, i don't really think you need in circuit debugging for attinys, or even megas for that matter...
[15:29:08] <carabia> But if you insist I guess you can get a rough idea by using a simulator (simavr?) and gdb :)
[15:29:40] <carabia> (never done that myself, seems overkill anyway)
[15:30:00] <cehteh> yes
[15:30:29] <cehteh> just instrumentate your code, add some safety checks, maybe do unit tests in the life system
[15:30:52] <cehteh> you cant do terribly complex things on a tiny anyway .. unless you are Jartza
[15:33:21] <carabia> and you really even shouldn't. Hell you can get arms putting out way more mips, memory and gpio for the same price as an attiny13a.
[15:33:44] <cehteh> i have some leftover tiny13 .. but they are no fun
[15:33:57] <cehteh> new tiny things will be at least tiny45 here
[15:34:12] <cehteh> they are almost as cheap for hobby projects and have way more features and space
[15:34:48] <cehteh> who cares if a chip cost 90 cent or $1.5 .. if you build the thing only a few times
[15:38:46] <carabia> Surely if i'm doing a /certain/ project for which I need something /super/ simple and I need it perfboarded the same afternoon I could go for an attiny.
[15:43:07] <carabia> even then, if you have a moment it's not terribly complicated to prototype something with a quad flat pack either.