#avr | Logs for 2015-10-19

Back
[01:35:44] <gorroth> when you guys write your custom bootloaders, do you then write your own custom code to upload the program, or do you somehow use avrdude? i can think of how to do this using my own custom uploader, but i don't know how to do it if i want to get avrdude working with it
[01:42:15] <Casper> avrdude to flash and set the fuse
[01:57:51] <theBear> generally any kind of messing about with bootloaders, specially untested ones, you wanna have a "regular" programmer on hand and working
[04:46:48] * inflex still can't bring himself to use bootloaders
[06:33:32] <Lambda_Aurigae> gorroth, little of both. when I want to use avrdude I use a known protocol like stk500.
[06:43:15] <cart> Hi... is there some protection unit on an AVR that makes it restart when the power drops or the processing seemed to have locked up? I dont get why my MCU restart the entire time
[06:57:50] <Tom_itx> brownout
[06:58:15] <Tom_itx> you may need a pullup on reset
[06:59:01] <Lambda_Aurigae> brownout protection and watchdog both.
[07:00:01] <LeoNerd> If you have some communications mechanism, have your program print the value of MCUSR on startup
[07:00:08] <LeoNerd> Then next time it restarts you'll get the reason why
[07:00:19] <LeoNerd> I usually print a handy bootup message over UART early on startup
[07:04:32] <inflex> hi Tom_itx and theBear
[07:04:35] <inflex> and Casper :)
[07:19:36] <Tom_itx> hey inflex
[07:24:51] <inflex> How are things on your side of the world?
[07:28:13] <Tom_itx> cooling down for the fall/winter
[07:58:25] <inflex> Very nice. Obviously warming up here for the annual furnace :\
[08:11:46] <theBear> sup inflex :) how YOU doooin ?
[08:26:54] <inflex> yeah, kicking along, not doing much with electronics any more, other than to design trinkets that help me do my computer repairs / data recover
[09:40:04] <rue_house> inflex, ultrasonic screwdriver?
[10:01:45] <MarkX> i have an attiny85 with a micronucleus running. is it possible i can set fuse bits without an external programmer?
[10:05:12] <LeoNerd> I don't think you can write fuse bytes via selfprog
[10:06:24] <MarkX> dang
[10:06:48] <MarkX> well i have a stock attiny85 with just micronucleus installed on it
[10:07:33] <MarkX> http://codeandlife.com/2012/02/22/v-usb-with-attiny45-attiny85-without-a-crystal/ this post mentions setting fuse bits.
[10:07:42] <MarkX> i don't know if i need to set those or not. how can i find out?
[10:12:53] <LeoNerd> Well, do the settings in the fuse bytes match the settings you need for your application?
[10:18:28] <MarkX> i don't know my fuse byte settings. thats the thing
[10:23:16] <LeoNerd> Well, that'll be your first problem :)
[10:23:21] <LeoNerd> Determine what you'll need, then set it
[10:25:50] <MarkX> but how can i know what i have as the default?
[10:26:25] <MarkX> i don't have my spi programmer (currently at work) so i was hoping to make it work as is :P
[10:26:31] <LeoNerd> Hmm?
[10:26:45] <LeoNerd> Unless you've changed them, they'll likely be the shipped-defaults, which should be given in the DS
[10:26:55] <MarkX> ahhh okay
[10:26:56] <MarkX> i'll look
[10:52:36] <gorroth> Lambda_Aurigae: yeah, i was thinking of doing something like that, but it looks like the stk500 protocol has quite a few things I'll have to account for.
[14:06:50] <MarkX> LeoNerd: so i checked, the fuses i need to set are different from what is set by default. i believe when i burned micronucleus on the ic, that changed fuses as well
[14:09:10] <MarkX> so now i'm wondering, am i able to set fuses while uploading a hex using micronucleus commandline program?
[14:09:36] <MarkX> or do i have to use my arduinoisp?
[14:16:51] <LeoNerd> I have no idea what micronucleus is
[14:17:04] <LeoNerd> However: you can only set the fuses on a 'tiny85 using ICSP or HVSP, not SPM
[14:17:28] <MarkX> ah okay
[14:17:34] <MarkX> one more quick question
[14:18:55] <MarkX> https://github.com/micronucleus/micronucleus/blob/master/firmware/Makefile that is the makefile for micronucleus. just to make sure i'm reading that correctly, that disabled the reset pin, so i cannot use my spi on this chip anymore correct?
[14:22:36] <MarkX> ah looks like there is an include file for the makefile
[14:22:44] <MarkX> my mistake, that is where fuseopts is defined
[14:22:57] <MarkX> FUSEOPT = -U lfuse:w:0xe1:m -U hfuse:w:0xdd:m -U efuse:w:0xfe:m
[14:22:57] <MarkX> FUSEOPT_DISABLERESET = -U lfuse:w:0xe1:m -U efuse:w:0xfe:m -U hfuse:w:0x5d:m
[14:26:11] <MarkX> looks like it already has the correct fuse bits set
[14:26:17] <MarkX> now to figure out why it isn't working >_>
[17:11:12] <wizkid057> greetings. anyone have any example code to go on for self-programming an 8-bit AVR like the ATtiny24 that doesn't have a bootloader section?
[17:11:42] <wizkid057> the AVR simulator does not handle it well, and not having any luck debugging with debugwire eithere :(
[17:25:30] <FrankD> anyone here have experience with ADCs? specifically Linear Tech / LTC-2439 or similar?
[17:58:32] <Lambda_Aurigae> FrankD, what is the issue exactly?
[17:59:34] <FrankD> Lambda_Aurigae, unexpected results from the ADC
[17:59:53] <FrankD> pins 1-8 always read around 0x5500 - 0x5700 whether theyre at ~0v or 0.45v (as measured at the ADC pin)
[17:59:59] <FrankD> er well pins 0-7
[18:00:14] <FrankD> 8-15 are currently floating and usually read close to 0 (0xE or so)
[18:01:23] <Lambda_Aurigae> let me peruse the datasheet.
[18:01:52] <FrankD> COM and VREF- are both tied to ground
[18:01:59] <FrankD> VREF+ is tied to Vdd which is 5v
[18:03:05] <Lambda_Aurigae> set to single ended or differential mode?
[18:03:17] <FrankD> single ended
[18:04:51] <Lambda_Aurigae> REF+ is tied to VCC?
[18:04:58] <Lambda_Aurigae> what is REF- set to?
[18:06:19] <Lambda_Aurigae> hmmm...forget that question.
[18:06:21] <Lambda_Aurigae> still reading.
[18:07:14] <Lambda_Aurigae> or, unforget it...valid question.
[18:10:11] <FrankD> REF- is Gnd
[18:10:17] <Lambda_Aurigae> and F0?
[18:10:20] <FrankD> Gnd
[18:11:18] <Lambda_Aurigae> and your oscillator feed?
[18:11:36] <FrankD> for the AVR? internal 8MHz, bit banging SPI
[18:11:51] <Lambda_Aurigae> oh..duh...that's F0..gnd.
[18:12:00] <FrankD> yeah
[18:12:02] <FrankD> 60Hz rejection
[18:12:07] <Lambda_Aurigae> how fast are you trying to read data?
[18:12:25] <FrankD> well I just set CLKDIV8 and changed the baud rate to 300.. and I have lots of logging
[18:12:28] <FrankD> so right now very slowly
[18:12:29] <FrankD> :P
[18:12:39] <FrankD> and im getting exactly the same results
[18:12:48] <Lambda_Aurigae> ok..because with internal oscillator it can only produce 6.8 samples per second.
[18:13:04] <FrankD> yup
[18:13:32] <FrankD> i loop and wait for !EOC so that shouldnt be an issue anyway, although there is a manual delay between each conversion request
[18:15:40] <FrankD> im tempted to remove it and replace it with an LTC2418, im just sure im going to physically damage it by removing it and id hate to waste an LTC2418 if I have some kind of board errata
[18:16:18] <FrankD> but I did test Fo, Vref-, Vref+ and Com with a DMM and they all are what theyre supposed to be
[18:16:30] <Lambda_Aurigae> no clue...from what you have said, it is hooked up right.
[18:18:00] <FrankD> yeah I specifically grounded Fo because it's purely a DC parameter test of a JFET.. the reading point is buffered by an opamp which is followed by a resistive divider so make sure the ADC never sees more than about 3v
[18:18:24] <FrankD> i was going to manually adjust Aref+ based on the highest In+ for more accuracy once I got this to work
[18:18:41] <FrankD> but its not even close to right
[18:18:58] <Lambda_Aurigae> time to contact the manufacturer?
[18:20:18] <FrankD> maybe, good thing theyre samples and i didnt actually pay for them yet :p
[18:21:00] <Lambda_Aurigae> hehe.
[18:21:10] <Lambda_Aurigae> why using external ADC anyhow?
[18:21:46] <FrankD> needed 16 inputs and a small uC
[18:21:50] <FrankD> using an ATTiny1634
[18:22:02] <FrankD> and actually i wanted 24bit resolution
[18:22:05] <LeoNerd> Mmmmmmm 1634
[18:22:10] <FrankD> so i have some LTC2418s
[18:22:24] <FrankD> but the LTC2439 is pin compat, so I put those on the first proto
[18:23:36] <Lambda_Aurigae> 1634 is kind of a tiny mega...hehe
[18:25:01] <FrankD> yeah :D
[18:25:32] <FrankD> i assumed i needed >512 bytes of SRAM so that left out all the other ATTinys
[18:25:35] <Lambda_Aurigae> might as well be an atmega.
[18:25:44] <FrankD> and SOIC-20 is just small enough :)
[18:25:53] <FrankD> kinda wish it was TSSOP actually
[18:26:14] <FrankD> but yeah, mainly external ADC for 24bits of resolution.. and 16 channels
[18:26:17] <Lambda_Aurigae> kinda wish it was available in dip but, alas, it ain't.
[18:26:32] <FrankD> did you see my proto board?
[18:26:40] <Lambda_Aurigae> not sure..prolly not.
[18:26:45] <FrankD> i accidentally laid down SOIC-24
[18:26:58] <FrankD> and had to bridge pins, thank god i was only using 1 pin on that side of the chip
[18:26:59] <FrankD> :p
[18:29:36] <FrankD> i tried to make the PCBs at home but couldnt get the top and bottom layers to line up well enough
[18:29:45] <FrankD> just a few thousandths off each attempt :P
[18:30:13] <FrankD> Lambda_Aurigae, http://imgur.com/a/rnYMx
[18:30:49] <FrankD> Lambda_Aurigae, if you want I'll make some PCBs to go SOIC to DIP and send em your way.. single layer boards I can do easy enough :)
[18:31:02] <Lambda_Aurigae> so can I.
[18:31:08] <Lambda_Aurigae> I just don't want to.
[18:31:10] <FrankD> ok :)
[18:31:44] <Lambda_Aurigae> and, really, that attiny is not very useful to me these days.
[18:32:09] <Lambda_Aurigae> I've been hacking on pic32 chips mostly these days and get them in dip package.
[18:32:30] <FrankD> fun
[18:32:50] <Lambda_Aurigae> yeah.
[18:33:05] <Lambda_Aurigae> they are actually.
[18:33:23] <Lambda_Aurigae> 28pin dip 32bit processor that can execute from flash or ram internally.
[18:33:54] <Lambda_Aurigae> if I went to the bigger ones they can map external memory too but those require surface mount work...which I will do soon as I have some of the chips already.
[18:33:56] <FL4SHK> ooh neat
[18:34:16] <FL4SHK> I'm not familiar with Pics but that doesn't sound like a Harvard architecture to me
[18:34:21] <Lambda_Aurigae> mips32 processor core with pic peripherals.
[18:34:25] <FL4SHK> oh dang it is?
[18:34:26] <Lambda_Aurigae> it's not harvard.
[18:34:32] <FL4SHK> neatttttttt
[18:34:36] <FL4SHK> Now I want one
[18:34:38] <Lambda_Aurigae> and it's not true pic either.
[18:34:43] <FL4SHK> Well no, if it's MIPS, it's not
[18:34:48] <Lambda_Aurigae> pic32mx270f256b
[18:34:56] <FL4SHK> does it have hardware division and multiplication then, if it's MIPS?
[18:35:13] <Lambda_Aurigae> 256k flash, 64k sram, 40 or 50 mhz..up to 83dmips.
[18:36:09] <Lambda_Aurigae> haven't even gotten into the math part of the core.
[18:38:16] <Lambda_Aurigae> DSP-like Multiply-add and multiply-subtract instructions (MADD, MADDU, MSUB, MSUBU)
[18:38:41] <FL4SHK> Oh, neat
[18:38:43] <Lambda_Aurigae> M4K core.
[18:38:54] <FL4SHK> I need to add this to my Christmas list
[18:38:57] <FL4SHK> I want one of these
[18:39:00] <FrankD> no
[18:39:01] <Lambda_Aurigae> free samples for the win.
[18:39:04] <FrankD> you want an STM32F4 :p
[18:39:08] <FL4SHK> Hm?
[18:39:09] <FL4SHK> What's that?
[18:39:16] <Lambda_Aurigae> stm32f4 is an arm processor.
[18:39:21] <Lambda_Aurigae> but not available in dip package.
[18:39:25] <FL4SHK> I want DIP
[18:39:30] <FrankD> STM32F429 discovery board is ridiculous though
[18:39:32] <FL4SHK> DIP is way easier for me to work with
[18:39:44] <FrankD> 8MB (64mbit) of RAM, LCD, and a super fast Cortex-M4 for $17
[18:39:53] <FL4SHK> hm
[18:40:01] <Lambda_Aurigae> not a bad little toy that.
[18:40:06] <FL4SHK> neat
[18:40:09] <FrankD> yeah its got all the DSP extensions
[18:40:16] <Lambda_Aurigae> but that's 17 more than I paid for my microchip samples.
[18:40:21] <FrankD> hehe
[18:40:41] <FL4SHK> I'd like to turn one of my single board computers into a portable device
[18:40:58] <FL4SHK> I have a Raspberry Pi and a Beaglebone Black
[18:41:08] <FL4SHK> I should learn more about 3D modeling...
[18:41:11] <FL4SHK> and get a case made
[18:41:16] <Lambda_Aurigae> I have an rPI B+
[18:41:24] <Lambda_Aurigae> would like to get a second gen rPI.
[18:41:25] <FL4SHK> Is that the one with 512 MB of RAM?
[18:41:43] <Lambda_Aurigae> it's the mid range..not the latest version, but, yeah, 512MB ram.
[18:41:51] <FL4SHK> Yeah that's the one I have
[18:41:53] <Lambda_Aurigae> and 4 usb ports.
[18:41:56] <FL4SHK> Oh?
[18:41:57] <Lambda_Aurigae> and ethernet.
[18:42:00] <FL4SHK> Hm....
[18:42:08] <FL4SHK> I think I have an original Rev B
[18:42:22] <Lambda_Aurigae> https://www.crazypi.com/image/cache/data/B%20Plus/RPI%20B+-autoxauto.jpg
[18:42:30] <FL4SHK> Yeah
[18:42:40] <Lambda_Aurigae> 40 pin gpio port too.
[18:42:53] <FrankD> i have an odroid xu3 lite
[18:42:54] <FrankD> its pretty cool
[18:43:34] <Lambda_Aurigae> and just this past weekend found my old attempt at a multiprocessor board.
[18:43:39] <Lambda_Aurigae> using 8052 chips.
[18:43:45] <FL4SHK> I have an RPI with only two USB ports and I think it lacks an ehternet port
[18:43:48] <FL4SHK> but it has 512 MB of RAM
[18:44:58] <Lambda_Aurigae> it should have 2 usb ports and an ethernet.
[18:45:03] <Lambda_Aurigae> for to be an rPI B
[18:45:06] <FL4SHK> Oh
[18:45:09] <FL4SHK> Yeah ehternet
[18:45:18] <FL4SHK> it does have that, I just misremembered
[18:45:21] <Lambda_Aurigae> B+ and 2B both have 4 usb ports.
[18:45:38] <Lambda_Aurigae> 2B has 1GB ram.
[18:45:59] <Lambda_Aurigae> and a quad core 900MHz processor
[18:46:45] <FL4SHK> it's also ARMv7 isn't it?
[18:46:49] <Lambda_Aurigae> I find the rPI to be just powerful enough to use for a learning kit and not much else.
[18:47:22] <Lambda_Aurigae> yeah...Arm Cortex-A7 900MHz
[18:48:33] <FL4SHK> I want to turn my Beaglebone Black into a portable device
[18:48:39] <FL4SHK> something like this: http://www.thingiverse.com/thing:934119/#comments
[18:48:44] <Lambda_Aurigae> I made my rPI portable.
[18:48:47] <FL4SHK> How did you do it?
[18:49:10] <Lambda_Aurigae> I run it on one of those little usb battery packs.
[18:49:19] <Lambda_Aurigae> and it's mounted in a wooden box.
[18:49:26] <FL4SHK> I see
[18:49:44] <FL4SHK> Did you make the wooden box?
[18:49:49] <Lambda_Aurigae> no.
[18:49:52] <FL4SHK> I see
[18:49:57] <Lambda_Aurigae> it is about 8x8x2 inches.
[18:50:27] <Lambda_Aurigae> paid a dollar each at a cheap hobby store for the boxes.
[18:50:42] <FL4SHK> Do you have a screen also?
[18:50:50] <Lambda_Aurigae> not in the box.
[18:50:55] <Lambda_Aurigae> working on that.
[18:50:58] <FL4SHK> I want to have a screen in the box
[18:51:08] <Lambda_Aurigae> might have one to put on it but gotta figure out how to hook it up.
[18:51:59] <Lambda_Aurigae> I have several screens,,,with touchscreen even,,,from old copiers.
[18:52:47] <FL4SHK> I wouldn't know how to interface a screen like that with an RPi
[18:52:50] <FL4SHK> :/
[18:53:01] <Lambda_Aurigae> hence why I gotta figure it out.
[18:53:32] <FL4SHK> Could you somehow convert the HDMI output to that input of the screen?
[18:53:40] <Lambda_Aurigae> not likely.
[18:53:46] <FL4SHK> darn
[18:53:50] <Lambda_Aurigae> it's more of an lvds connection.
[18:54:01] <Lambda_Aurigae> there is a video output connector on there for such things.
[18:54:07] <FL4SHK> Oh, really?
[18:54:15] <FL4SHK> Is that hte same as composite video?
[18:54:16] <Lambda_Aurigae> just not well documented.
[18:54:21] <Lambda_Aurigae> no...not even close.
[18:54:24] <FL4SHK> Okay
[18:54:27] <FL4SHK> oh right LCD...
[18:57:56] <FL4SHK> Uh, so, do you know anything about a beaglebone black?
[18:58:13] <Lambda_Aurigae> have looked at it before but never bought one.
[18:58:19] <FL4SHK> Hm
[18:58:30] <FL4SHK> I wonder about maybe making the one of those that I have into a portable
[18:59:19] <FL4SHK> It's more powerful than the RPi I have
[19:00:12] <FL4SHK> I just don't know how I would go about doing it...
[19:02:18] <FL4SHK> I guess I'll start browsing benheck.com
[19:07:24] <FL4SHK> The biggest concern I have is the case
[19:10:38] <Lambda_Aurigae> http://www.pactecenclosures.com/
[19:11:03] <FL4SHK> neat
[19:11:04] <Lambda_Aurigae> http://www.pactecenclosures.com/free-samples.php
[19:28:19] <FrankD> holy @$&^)*!#%&
[19:28:23] <FrankD> everything was right
[19:28:33] <FrankD> i just forgot the pin mapping to JFET location was all over the place
[19:28:42] * FrankD epicly facepalms
[19:28:44] <FrankD> horrible
[20:13:14] <gorroth> is there something better than AVR061 that discussed how to write an stk500v1 bootloader?
[20:13:29] <gorroth> that document is like "we send this" (some enumerated type's name, but not the actual code)
[20:13:32] <gorroth> so it's useless
[20:38:49] <gorroth> screw it. i'm just going to do my own lame protocol
[20:38:56] <gorroth> not try to use avrdude
[20:41:36] <wizkid057> gorroth: I've been working on a bootloader for the ATtiny24... but the simulator doesn't handle SPM correctly, nor does debugwire :-\ ... any luck with those?
[20:46:53] <gorroth> no, i haven't written much code, because the documents from atmel blow
[20:47:02] <gorroth> so i'm just going to do my own protocol with my own uploader
[22:23:30] <gorroth> well, i think i have a bootloader
[22:23:40] <gorroth> untested, but looks legit i guess?
[22:23:46] <gorroth> now i just need to write an uploader
[22:27:31] <gorroth> no... actually sure it won't work
[22:29:57] <Tom_itx> gorroth, based on 109?
[22:33:00] <gorroth> psh, no
[22:33:04] <gorroth> doing my own thing
[22:33:11] <gorroth> those documents sucked so bad
[22:34:52] <Tom_itx> all the programs are available for each app note
[22:35:17] <gorroth> yeah, where? i've searched?
[22:35:27] <gorroth> s/searched\?/searched/
[22:35:46] <gorroth> google just takes me to PDFs
[22:35:57] <gorroth> but i'd much rather use one of the known programmers
[22:36:02] <gorroth> er, bootloaders
[22:36:12] <Tom_itx> they distributed an iso at one point with all the data sheets app notes etc on it
[22:36:19] <Tom_itx> i've got a copy
[22:36:26] <Tom_itx> they don't distribute it now
[22:37:17] <Tom_itx> was looking to see if i still had it on my server..
[22:37:23] <Tom_itx> would you like it?
[22:38:09] <gorroth> yeah, if possible, that'd be good
[22:38:18] <gorroth> how come they don't distributed the bootloaders anymore?
[22:38:38] <Tom_itx> they wanted ppl to visit their site more instead
[22:38:42] <Tom_itx> i pm'd the link
[22:38:47] <gorroth> thank you
[22:39:03] <gorroth> that doesn't make any sense. i visited their site, and it's shit for finding things
[22:39:11] <Tom_itx> i know
[22:39:30] <Tom_itx> 6.7 g file
[22:43:14] <Tom_itx> it's got 32bit stuff too
[22:44:29] <gorroth> np
[22:44:42] <gorroth> i haven't started the download just yet, because i'm seeing if atmel's site has anything like you said it does
[22:44:45] <gorroth> just curious is all
[22:45:09] <Tom_itx> i could post just the 109 software if you wanted
[22:47:23] <gorroth> okay, that'd be good :)
[22:47:36] <gorroth> i'll trigger a download on my rpi that always stays online though
[22:47:38] <Tom_itx> same dir
[22:47:40] <Tom_itx> just refresh
[22:47:55] <gorroth> thank you :)
[22:48:01] <Tom_itx> right off the cd
[22:48:10] <gorroth> that sounds great
[22:48:24] <Tom_itx> any others you want?
[22:48:42] <gorroth> i think that's it. i'll try to get this uploaded onto my atmega168 and see if it works
[22:48:58] <gorroth> Tom_itx: is the license such that i can put it in my public repo?
[22:49:12] <Tom_itx> i didn't ask :D
[22:49:18] <gorroth> oh :)
[22:49:43] <Tom_itx> it was available for public download at one time so...
[22:50:02] <gorroth> then it's all good :)
[22:50:07] <gorroth> plus, i see no license info
[22:50:15] <gorroth> i'm just wondering where atmel is hiding their stuff
[22:50:24] * gorroth checks if they have a weird server call eff tee pee
[22:50:30] <Tom_itx> it may have been on their norway site
[22:50:34] <Tom_itx> i can't remember now
[22:52:10] <Tom_itx> link doesn't appear good now
[22:52:23] <gorroth> yeah
[22:52:29] <gorroth> i don't know why they're making this so hard
[22:52:42] <gorroth> it's weird i can't find many bootloaders out there, actually
[22:52:48] <gorroth> i think i found an arduino one
[22:52:59] <gorroth> i think it's actually an stk500v1 bootloader
[22:53:30] <gorroth> the thing i wonder about the stk500v1 bootloaders is that it expects you to run at 115200 baud. that ain't gonna happen with my 8 mhz mcu
[22:53:37] <gorroth> 38400 bps is the max
[22:53:41] <Tom_itx> anyway, i'm gone for tonight
[22:53:46] <gorroth> okay
[22:53:50] <gorroth> thank you
[22:53:54] <Tom_itx> np