#avr | Logs for 2015-07-30

Back
[02:20:40] <redspl> hi
[02:21:31] <Casper> \o
[06:24:57] <Ingram> on atmega64m1 how effective are the SPIEN/DWEN/RSTDISBL fuses compared to internal flash lock bits when attempting to protect the contents of flash from unauthorized access?
[06:27:16] <Lambda_Aurigae> well,
[06:27:32] <Lambda_Aurigae> rstdisbl just disables the reset pin...that can be gotten around by using high voltage programming
[06:28:04] <Lambda_Aurigae> if you disable both spien and dwen then you won't be able to reprogram the chip or, in theory, read the chip...however, I believe high voltage programming will get around that.
[06:28:27] <Lambda_Aurigae> if you want the flash protected, use the flash protection fuses.
[06:28:41] <Ingram> is high voltage programming possible without destroying the contents of flash?
[06:29:19] <redspl> ingram: check this out;)
[06:30:09] <Lambda_Aurigae> with high voltage programming you can read or write flash, eeprom, and fuses.
[06:30:27] <Lambda_Aurigae> writing is necessarily destructive as you have to do an erase first before writing to a block.
[06:30:34] <Lambda_Aurigae> reading is not destructive, however.
[06:30:45] <redspl> 1.read 2.write
[06:31:09] <Ingram> alright, that's what I wanted to know, thanks
[06:31:28] <Lambda_Aurigae> the high voltage in high voltage programming just refers to providing 12V to the reset pin to put the chip in programming mode.
[06:31:36] <Lambda_Aurigae> it's all in the datasheet.
[06:34:26] <Ingram> funny thing is that I just reached to that part on the datasheet as well
[06:34:43] <redspl> ;d
[06:36:35] <Ingram> the problem I am facing is that when the devices that I am working on are sent to the other side of the planet, I still need a way to do remote updates
[06:36:51] <Lambda_Aurigae> ok..
[06:36:59] <Lambda_Aurigae> again, you haven't read the datasheet completely.
[06:37:24] <Lambda_Aurigae> with flash protection on that just means you can't read it from the programming interfaces,,,hvpp, hvsp, isp, debugwire, jtag, etc.
[06:37:28] <Lambda_Aurigae> doesn't mean you can't write it.
[06:37:45] <Lambda_Aurigae> also, with the protection bits on you can still use a bootloader that can write to the flash.
[06:39:07] <Ingram> yes, I read about that
[06:41:38] <Ingram> however what happens if bootloader needs to be overwritten
[06:42:22] <Lambda_Aurigae> you are screwed.
[06:42:26] <Ingram> exactly
[06:42:30] <Lambda_Aurigae> or, you use a dual level bootloader.
[06:42:38] <Lambda_Aurigae> one that takes up only half the bootloader section.
[06:43:06] <Lambda_Aurigae> or, you use an external programmer hardware, leave SPI enabled, and just turn on the protection bits.
[06:43:28] <Lambda_Aurigae> the external programmer can still erase and write to the chip...it just can't read from the chip.
[06:43:37] <Lambda_Aurigae> you can build the external programmer right into the system.
[06:44:02] <Lambda_Aurigae> make it usb connected or whatever.
[06:48:19] <Ingram> well the complicated part is that the only connector it has is for operating power and CAN bus, so I was thinking that for instance download the new bootloader to application section, let it go to special bootloader section which we wouldn't overwrite and that would read the application code and copy it to general bootloader section
[06:48:51] <Ingram> but that means it has to be readable
[06:49:28] <Ingram> but it might be possible that we'll just go through a redesign and add a set of programming pins
[06:49:34] <Lambda_Aurigae> well, on most AVR chips, only code operating from the bootloader section can write to flash.
[06:49:58] <Lambda_Aurigae> or,,,you can add a second small avr and an spi or i2c ram chip.
[06:50:20] <Lambda_Aurigae> push your firmware update to the ram chip then have the small avr read that and reflash the big one.
[06:50:37] <Lambda_Aurigae> and, as part of the code on the big one,,,have it able to write to the small one...
[06:50:42] <Lambda_Aurigae> recursive programmers!
[06:51:01] <Ingram> well in theory you never need more than 2
[06:51:17] <Ingram> as they can program eachother
[06:51:29] <Lambda_Aurigae> and with that mode, you could even have some encryption built in so you can distribute your firmware upgrade encrypted..
[06:51:44] <Lambda_Aurigae> which, you can do with a bootloader too for that matter.
[06:52:17] <Lambda_Aurigae> ok..time to shower and head for worky.
[06:52:31] <Ingram> ok, thanks for the advice
[07:26:20] <jben> Hi guys,
[07:27:34] <jben> I joind this channel searching a community of people working on AVR, on ATmega in particular
[07:28:28] <jben> with the topic of the chan, I seem to be in the right place
[07:31:35] <jben> I have trouble about sleep mode, it's the first time I used it. My program is completly driven by interupts (UART data transmit empty, UART received, timer1 compa A, timer1 compa B), and I want to be in sleep mode all the time.
[07:32:49] <jben> when I used in C, sleep_enable(), and sleep_cpu(), in the main, it appears I don't stay in sleep mode.
[07:39:08] <twnqx> mh
[07:39:15] <twnqx> the C macro is just sleep()
[07:41:28] <twnqx> and you have to be careful to select the right sleep mode,
[07:41:36] <twnqx> like set_sleep_mode (SLEEP_MODE_IDLE);
[07:41:43] <twnqx> or your chip will not wake up by interrupts.
[07:42:20] <twnqx> oh, i was wrong
[07:42:31] <twnqx> set_sleep_mode (SLEEP_MODE_IDLE);
[07:42:37] <twnqx> while (1)
[07:42:37] <twnqx> sleep_mode ();
[07:42:46] <twnqx> so you were right, jben
[07:43:07] <jben> sleep_mode() ?
[07:43:11] <twnqx> or do you use that weird arduino dialect and not native avr libc?
[07:43:36] <twnqx> i just quoted from my code
[07:43:39] <jben> twnqx: I do NOT use tu arduino
[07:43:50] <jben> only native avr libc
[07:44:36] <twnqx> http://www.nongnu.org/avr-libc/user-manual/group__avr__sleep.html
[07:44:42] <twnqx> i use the simpler, upper example
[07:45:00] <jben> twnqx: I've seen it
[07:47:18] <twnqx> maybe you used the wrong sleep mode
[07:48:03] <twnqx> e.g. i had major issues with the one i chose first because it would trigger analog/digital conversion and automatically wake up the chip once the conversion was complete
[07:51:00] <jben> oh well, I have to put the sleep_enable(), and the sleep_cpu(), inside a while(1) loop
[07:51:14] <twnqx> yes of course
[07:51:39] <twnqx> the cpu does not go back to sleep after your interrupt handler fires
[07:51:46] <twnqx> errr finishes
[07:52:08] <twnqx> once the interrupt hander finishes, you will be back where you sent the cpu to sleep
[07:52:16] <jben> okay… I have the point
[07:55:24] <jben> thank you, the life-time of my battery will be improved
[08:24:00] <LeoNerd> Wow.. This current sense amp works a lot better than I imagined it would
[10:50:48] <twnqx> http://www.damninteresting.com/on-the-origin-of-circuits/ where exactly did i just pick up this link if not here...
[11:18:28] <Jartza> well
[11:18:30] <Jartza> moard pixels
[11:18:31] <Jartza> moar
[11:18:37] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxVWh0SDJXdDhEUzA/view?usp=sharing
[11:18:47] <Jartza> needs better font, though
[19:51:32] <phinxy> Is it possible to skin atmel studio 6 like visual studio community ?
[19:53:28] <Lambda_Aurigae> umm.
[19:53:31] <Lambda_Aurigae> no clue here.
[19:53:35] <Lambda_Aurigae> it won't run on my computer.
[19:54:18] <phinxy> Lambda, what do you use?
[19:55:00] <Lambda_Aurigae> for what?
[19:55:38] <Lambda_Aurigae> for editing text files, usually vi, vim, kate, or gedit, depending on the computer I'm currently using.
[19:55:50] <Lambda_Aurigae> for compiling programs for the avr, avr-gcc
[19:55:56] <Lambda_Aurigae> for uploading programs to the avr, avrdude
[20:01:54] <phinxy> Lambda_Aurigae, i guess you cant debug tough?
[20:02:31] <Lambda_Aurigae> why not?
[20:02:55] <Lambda_Aurigae> include debug code in my code,,,output to LEDs or serial port.
[20:03:23] <Lambda_Aurigae> just because I don't have a handy little simulator in windows doesn't mean I can't debug code.
[20:03:49] <phinxy> =)
[20:04:28] <phinxy> Im a noob so i dont know enough to say anything
[20:05:25] <Lambda_Aurigae> if I wanted to do source level debugging I could use avr-gdb and simulavr
[20:05:29] <Lambda_Aurigae> never had need for it.
[20:40:06] <phinxy> Have anyone here a dark themed Atmel Studio? i cant install the VS2010 theme manager
[20:43:18] <phinxy> Maybe ill just roll with visual studio 2015
[20:43:26] <phinxy> gotta figure out how to compile
[20:50:27] <theBear> just wear sunnies while youprogram... you'll look coole too
[20:53:47] <Lambda_Aurigae> don't forget to update to microsoft-wewantallyourdata-windows 10.
[20:54:14] <Lambda_Aurigae> which is the same as microsoft-wearegonnastealyourbandwidthtospreadautomaticupdates-windows 10.
[20:55:08] <Thrashbarg> I thought it was Windows-not-another-XP-moment-10
[20:55:28] <Lambda_Aurigae> xp was the third best windows ever released.
[20:55:33] <Lambda_Aurigae> behind nt and 2k.
[20:55:49] <Thrashbarg> that's why it stuck around for so long... and MS don't want that happening again
[20:56:38] <Lambda_Aurigae> only windows I currently have installed in this house is a copy of win2kpro on a vm that I haven't used in several years.
[20:56:45] <Thrashbarg> heh ok
[20:56:47] <Lambda_Aurigae> beyond the ones in my walls.
[20:58:10] <Lambda_Aurigae> ok..off to bedzies.
[21:31:23] <Jartza> https://drive.google.com/file/d/0B2dTzW9TMeBxWW5Fa3c5cjJZbTQ/view?usp=docslist_api
[21:31:48] <Jartza> moar pixels. 192x96
[22:24:00] <phinxy> amazing!!
[22:24:23] <phinxy> how long time does it take to update the whole screen?