#avr Logs

Apr 23 2017

#avr Calendar

12:07 AM daey_ is now known as daey
03:15 AM JanC_ is now known as JanC
04:02 AM polprog: ive come up with this as a quick discharge protection circuit for the li ion battery i have
04:02 AM polprog: https://drive.google.com/file/d/0B7nrducTAtMTTmh6dHhyYzU3T00/view?usp=drivesdk
04:02 AM polprog: i cant find any schematics on google, just some that use some IC
04:03 AM polprog: wait, mistake on the bottom schem
04:04 AM polprog: forget it, its useless
10:53 AM polprog: any tips on using resistor footprints as wire jumpers in kicad? i need to jump over a couple traces, and even though both pads of the footprint are on the same net, it shows unconnected net warning. i'd like to disable that so i can focus on real unconnected nets
10:56 AM Casper: there is no wire jumper?
11:05 AM Lambda_Aurigae: 0 ohm resistor?
11:07 AM tpw_rules: polprog: yeah you'll have to draw them in your schematic
11:10 AM Lambda_Aurigae: or a couple of vias and a top trace.
11:11 AM Lambda_Aurigae: and you don't etch the top trace, just do it after the fact as a jumper wire.
11:12 AM tpw_rules: polprog: actually i forgot, what you can do is go into the pad properties for each pad on the resistor footprint once it's placed on your pcb, then set their net names
11:14 AM tpw_rules: that way you don't have to put it in the schematic, and it won't get deleted as redundant when you clean up the board
11:14 AM polprog: that's what i do
11:14 AM tpw_rules: it shouldn't list it as unconnected, unless it's truly unconnected
11:14 AM polprog: but it's showing a ratsnest line between those two pads
11:15 AM tpw_rules: ahh, yeah. hm
11:15 AM polprog: and adding jumper resistors on the schem is nonsens :)
11:15 AM tpw_rules: #kicad is on this network
11:15 AM tpw_rules: ask them?
11:15 AM tpw_rules: but tbqh i think their answer might be to add jumper resistors...
11:15 AM tpw_rules: kicad is not super great in that respect...
11:15 AM polprog: whatever. it's a one-off proto, i'll etch it at home. no big deal
11:37 AM julius: hi
12:08 PM adicarlo: hup!
12:14 PM adicarlo: man, really having troubles still with avarice
12:15 PM adicarlo: in this config I'm trying now, I'm connecting to an Uno using the 6-pin ISP header and independant power; avr_dude works fine to read fuses, but avarice cannot
12:17 PM adicarlo: avarice always says: Reported JTAG device ID: 0xFFFF -- so I think that's my indication of some problem
12:19 PM adicarlo: oh ah, this is trying to make use of an AVR Dragon; i guess I should check for other options on programmmers
12:23 PM Lambda_Aurigae: jtag is your problem
12:23 PM Lambda_Aurigae: avarice is an ice..in circuit emulator
12:23 PM Lambda_Aurigae: requires jtag
12:23 PM Lambda_Aurigae: ISP interface is programming only.
12:24 PM adicarlo: Lambda_Aurigae: hmm, ok
12:24 PM adicarlo: although in this case I'm just trying to read fuses
12:26 PM adicarlo: so, i'm using avarice to talk to my avr dragon but I'm using the dragon in ISP mode where I shoudlb e using JTAG mode?
12:26 PM adicarlo: ... and against a JTAG-capable AVR
12:33 PM Lambda_Aurigae: not sure avarice software can run in non-jtag mode.
12:34 PM Lambda_Aurigae: and jtag has to be turned on on the chip itself...I think it comes on by default on those that have it though.
12:34 PM Lambda_Aurigae: jtag is different pins from isp too.
12:34 PM adicarlo: yes indeed, there's a whole different header for that which I'm not using ATM
12:35 PM adicarlo: i *am* sure avarice can run in non-jtag mode, there's a section of the man page talking about debugwire, which is even stupider than the ISP mode
12:35 PM Lambda_Aurigae: debugwire is another emulator interface
12:35 PM Lambda_Aurigae: not isp
12:35 PM adicarlo: yes i nknow
12:36 PM Lambda_Aurigae: debugwire and jtag can both be used for programming
12:36 PM Lambda_Aurigae: but,,again, different pins.
12:36 PM adicarlo: moreover avarice lists support for chips like the atmega328p which do not support JTAG
12:36 PM adicarlo: Lambda_Aurigae: the goal here is simple, I'm trying to get a gdb remote stub on an atmega328p
12:37 PM adicarlo: or, know the reason why its not possible, i guess :P
12:37 PM Lambda_Aurigae: then you need jtag
12:37 PM Lambda_Aurigae: or debugwire
12:37 PM Lambda_Aurigae: you can't do gdb remote on the chip with isp.
12:37 PM Lambda_Aurigae: atmega328p supports debugwire though.
12:37 PM adicarlo: ok, very interesting
12:37 PM Lambda_Aurigae: just installed avarice and looking here..
12:37 PM Lambda_Aurigae: manpage only mentions isp via debugwire.
12:38 PM Lambda_Aurigae: avarice does not seem to support the ISP interface.
12:38 PM Lambda_Aurigae: and ISP does not support debugging
12:38 PM adicarlo: well I guess that would make sense if ISP is useless for what avarice does
12:38 PM Lambda_Aurigae: ISP is ONLY programming...read/write/verify
12:39 PM adicarlo: Lambda_Aurigae: bless you! you're saving me endless frustration here
12:39 PM Lambda_Aurigae: In System Programming...
12:39 PM adicarlo: ok i can get a debugwire rig going
12:39 PM Lambda_Aurigae: ICE = In Circuit Emulation
12:39 PM Lambda_Aurigae: which is jtag or debugwire
12:39 PM Lambda_Aurigae: the main indication was from your post "Reported JTAG....."
12:39 PM adicarlo: gotcha, so the ISP is basically just an on chip interface to, basically, reading or writing memory
12:40 PM Lambda_Aurigae: yup.
12:40 PM Lambda_Aurigae: ISP = In System Programming...that's all it does.
12:40 PM adicarlo: i don't know why, I was thinking ISP was a superset of what Debugwire can do
12:40 PM Lambda_Aurigae: nope.
12:40 PM Lambda_Aurigae: debugwire has programming capability
12:40 PM Lambda_Aurigae: but ISP has no debug capability
12:40 PM adicarlo: yah, limited but ... no hardware breakpoints
12:40 PM Lambda_Aurigae: yup.
12:41 PM Lambda_Aurigae: which, I've never used...debugwire or jtag.
12:41 PM adicarlo: no?
12:41 PM Lambda_Aurigae: I do debugging the old fashioned way....I read and understand my code...and use LEDs!
12:41 PM adicarlo: yes well, man, steppping code is the best
12:41 PM Lambda_Aurigae: I can do that too.
12:41 PM adicarlo: i got this all going on my msp430 toolchain
12:42 PM Lambda_Aurigae: single step CPU clock.
12:42 PM adicarlo: but not avr yet
12:42 PM Lambda_Aurigae: using a 555
12:42 PM Lambda_Aurigae: yup.
12:42 PM Lambda_Aurigae: on an avr
12:42 PM Lambda_Aurigae: on a pic
12:42 PM Lambda_Aurigae: on an 8052
12:42 PM Lambda_Aurigae: on an msp430.
12:42 PM Lambda_Aurigae: just can't see what it's doing without outputting something to the LEDs
12:42 PM adicarlo: i have to say, the ti launchpad is a much better programming rig that the ARD stuff
12:42 PM Lambda_Aurigae: but the software side sucks.
12:42 PM Lambda_Aurigae: specially on the linux side of the world.
12:43 PM Lambda_Aurigae: unless it has gotten much better than when I last messed with it.
12:43 PM adicarlo: i didn't have any problems but I was mostly working in ASM
12:43 PM Lambda_Aurigae: which, granted, was 2 years ago.
12:43 PM adicarlo: the c compliler seemed fine though when i did use it
12:43 PM adicarlo: the simulator is quite limited but...
12:43 PM Lambda_Aurigae: I might have to dig it out again.
12:43 PM Lambda_Aurigae: but I'm on to bigger and better things mostly.
12:43 PM Lambda_Aurigae: primarily pic32
12:44 PM Lambda_Aurigae: and touching on arm but that's a whole other can of dead worms.
12:44 PM adicarlo: yah i wanna play around with pics, they are such a legendary chip
12:44 PM adicarlo: ARM too, that is a can of worms, also very JTAG oriented
12:44 PM adicarlo: one thing at a time
12:44 PM Lambda_Aurigae: not pic
12:44 PM Lambda_Aurigae: pic32
12:45 PM Lambda_Aurigae: pic core sucks
12:45 PM Lambda_Aurigae: pic32 is MIPS32 core.
12:45 PM Lambda_Aurigae: with pic peripherals
12:45 PM Lambda_Aurigae: which rock.
12:45 PM Lambda_Aurigae: and can execute code from sram, which also rocks.
12:45 PM adicarlo: nice -- are you a pro?
12:46 PM Lambda_Aurigae: not even
12:46 PM adicarlo: just curious
12:46 PM Lambda_Aurigae: I'm a hacker from many many moons ago.
12:46 PM adicarlo: aye me too, i'm a refugee from the open source/ web/linux world
12:46 PM adicarlo: must step out now, thanks for help
12:46 PM Lambda_Aurigae: I've been playing with electronics since I was 8, computers since I was 12, microcontrollers since about 2000.
12:46 PM Lambda_Aurigae: daym, 41 years ago I fixed my first radio..hehe
12:55 PM NoHitWonder^: avr dev boards suck. all stm32 boards have in-circuit debugger and programmer built-in and they cost like 10 bucks.
12:56 PM NoHitWonder^: and that debugger can be used externally too
01:03 PM Emil: Hey!!
01:04 PM Emil: How many of you are interested in some Finnish traditional thing / Celebrate Wappu|First of May / Like students / want something cool
01:31 PM Lambda_Aurigae: Emil, sex, drugs, or alcohol?
01:31 PM Lambda_Aurigae: or all three?
01:32 PM Lambda_Aurigae: first day of may
01:32 PM Lambda_Aurigae: we call that May-Day around here.
01:33 PM Lambda_Aurigae: all the virgins get stoned and dance around a pole with a bunch of fancy streamers on it.
01:33 PM Lambda_Aurigae: usually, nobody over the age of 10 dancing.
01:49 PM Emil: hehe
01:50 PM Emil: Well, this year you gain your Finnish Äpyzenship with the Finnish Äpypassport!
01:50 PM Lambda_Aurigae: apprenticeship and passport?
01:51 PM Emil: It costs 15e for middle class and that's the recommended price, beginning from 25e is the rich-people price and beginning from 50e is the elite price
01:51 PM Emil: there's also the student/poor pricing of 10e
01:52 PM Emil: This is only available this one week
01:52 PM Emil: after which it is gone forever
01:53 PM Emil: At least NoHitWonder^ will buy it : )
01:57 PM Emil: Also 2 middle class äpys are 35e, 3 are 55e and so on
02:17 PM Tom_itx: `123460
02:50 PM learath: That's the password on my luggage!
02:56 PM polprog: My tinyasm (the learning rasterboard) grew a 74hc595 and a 7 segment display
03:08 PM Emil: polprog: wanna learn finnish
03:08 PM polprog: i though about this once
03:09 PM polprog: thought*. maybe if i had more time...
03:11 PM Emil: polprog: buy one of the Äpys I have
03:11 PM Emil: The Finnish Äpy password
03:11 PM Emil: you gain your Finnish Äpy-citizenship, too
03:11 PM Emil: ;)
03:11 PM polprog: Äpys?
03:13 PM Emil: Äpy is a Finnish Wappu "magazine", released every 2n+1 year since 1948
03:14 PM Emil: It contains excellent humour and it is the best thing you can bring with you to a Wappu brunch after Champagne
03:14 PM polprog: looks cool.
03:14 PM polprog: i'll see if i can get it
03:14 PM polprog: i suppose you are a part of that uni, right :)
03:15 PM Emil: I can send you one, I believe the shipping is between 2-5e iirc
03:15 PM Emil: polprog: ywah
03:20 PM polprog: how is that _delay_ms function implemented in assembly? i don't have the coding lappy with me now.
03:20 PM polprog: i suppose the simple loop is not the best idea
03:21 PM Lambda_Aurigae: polprog, it's just a do nothing loop.
03:21 PM Lambda_Aurigae: and not exactly calibrated so well either..it's a rough loop.
03:21 PM polprog: wait, just a delay loop?
03:24 PM Emil: Lambda_Aurigae: eh?
03:24 PM Emil: Lambda_Aurigae: it is quite perfect imho
03:24 PM Emil: polprog: eh, of course it is a delay loop :D
03:26 PM adicarlo: polprog: are you talkign about the avr-libc imlementation? I have that up
03:26 PM polprog: yeah
03:26 PM adicarlo: is ipmlemented in c not ASM btw
03:27 PM adicarlo: yes its just a loop, tries to be sensitive to the cpu freq
03:27 PM adicarlo: there are places where just a delay loop is perfectly fine although I prefer to set a timer event and wakup; i guess it depends on how much you care about current
03:27 PM polprog: cos last time (the blinking leds) i used just 3 registers and two nested loops of DEC and BRNE
03:28 PM Lambda_Aurigae: if all you are doing is blinkys then that works fine.
03:29 PM adicarlo: you can use a single register/single loop if you like too
03:29 PM adicarlo: assuming you don't care about efficiecy, other tasks, etc
03:30 PM polprog: now im doing blinkys. it will probably be mostly for stuff like glue logic signal gen, more sensitive stuff will be done with timers
03:30 PM polprog: adicarlo: i had to use two loops, becuase it needed to wait for 50k cycles
03:30 PM polprog: for the blinker to blink
03:30 PM polprog: :)
03:31 PM adicarlo: oic heh
03:31 PM polprog: it was all calculated
03:50 PM polprog: also i'm thinking about reprogramming the fuses so it uses the internal 128khz crystal
03:51 PM Lambda_Aurigae: it's not a crystal
03:51 PM Lambda_Aurigae: it's an RC oscillator.
03:52 PM polprog: yeah i just looked at the datasheet
03:53 PM Lambda_Aurigae: would be sweet if they put a crystal in the chip somewhere
03:53 PM polprog: but it doesn't mention it's an rc oscillator. it just calls it an oscillator. is the RC part obvious?
03:53 PM Lambda_Aurigae: save some i/o pins.
03:57 PM Emil: hmm
04:18 PM ibanezmatt13: evening all. I've been trying to program an atmega328p 3.3v 8mhz with fuses so I can set an arduino pro mini bootloader, however on setting efuse I get a content mismatch error, preventing the bootloader from being flashed correctly
04:18 PM ibanezmatt13: hfuse and lfuse set fine, but efuse throws up the error, does anybody have any idea as to why? :/
04:18 PM Lambda_Aurigae: ibanezmatt13, what efuse setting?
04:18 PM Lambda_Aurigae: remember, there are 4 bits in efuse that are unprogrammed and unprogrammable...and must always be written 1
04:19 PM Lambda_Aurigae: just as it says in the datasheet.
04:19 PM ibanezmatt13: hmm, I've been trying to set 0x05 for efuse
04:19 PM Lambda_Aurigae: and, you didn't read the datasheet.
04:19 PM polprog: that the problem :)
04:20 PM Lambda_Aurigae: oops....5 bits, not 4
04:20 PM Lambda_Aurigae: http://www.engbedded.com/fusecalc/
04:21 PM Lambda_Aurigae: use the fuse calc.
04:21 PM Lambda_Aurigae: or read the datasheet
04:21 PM Lambda_Aurigae: or both, as i just did.
04:21 PM ibanezmatt13: I see :/
04:21 PM ibanezmatt13: thanks guys, yeah that's a major overlooking
04:21 PM Lambda_Aurigae: read read read read
04:22 PM LeoNerd: avrdude doesn't understand the missing bits in fuses
04:22 PM ibanezmatt13: yep
04:22 PM LeoNerd: Quite often it gets upset if those missing bits read back differently to what it wrote
04:22 PM LeoNerd: Usually you're lucky and the chip will read back missing bits as 1, but not all chips do that in my experience :/
04:22 PM Lambda_Aurigae: they SHOULD
04:22 PM Lambda_Aurigae: but don't always,
04:23 PM Lambda_Aurigae: unused fuse bits are supposed to read back as unprogrammed
04:23 PM Lambda_Aurigae: or 1
04:24 PM ibanezmatt13: I see. When using fusecalc it doesn't seem to take into account the extra 1 bit required
04:25 PM Lambda_Aurigae: the one I did set the fuses correctly...setting the unused bits to 1
04:25 PM Lambda_Aurigae: you can't really set efuse to 0x05 though.
04:26 PM Lambda_Aurigae: because bit 3 is always 1.
04:26 PM Jartza: ouch
04:26 PM ibanezmatt13: yeah, it's saying set to 0xFF
04:27 PM Jartza: my internet operator has capacity problems
04:27 PM Jartza: and they know it
04:27 PM Jartza: but have no plans to fix them
04:27 PM Lambda_Aurigae: Jartza, do they involve dynamite or nitroglycerine?
04:36 PM Jartza: probably not
04:36 PM Lambda_Aurigae: well, what's the fun in that?
04:36 PM ibanezmatt13: I've tried to setting 0xFF instead of 0x05 but not luck :/ same mismatch error
04:52 PM Emil: ibanezmatt13: what is the error?
04:53 PM Emil: you dont really have to care about the fuse error most of thw time
04:53 PM Emil: if you use values from the fuse calc
04:53 PM ibanezmatt13: the error is a content mismatch after setting efuse which prevents the bootloader being uploaded
04:53 PM ibanezmatt13: however I've just discovered a rather horrifying reality
04:54 PM ibanezmatt13: I think I've been feeding the 3v3 chip 5v from the programmer :/
04:54 PM Emil: ibanezmatt13: yes that is a commong problem, disregard it
04:54 PM Emil: ibanezmatt13: you mean an avr?
04:54 PM ibanezmatt13: yeah
04:54 PM ibanezmatt13: 328p
04:54 PM Emil: lol it doesnr care
04:55 PM Emil: especially if you power it from the usb, too
04:55 PM ibanezmatt13: oh, good. So the issue seems to be this setting of 1 bits that are unused and I'm not sure how to go about it :/ it's preventing the bootloader being uploaded
04:55 PM Emil: ibanezmatt13: you should really consider investing in basic electronics knowledge
04:56 PM Emil: how do you kmow it os preventing that?
04:56 PM Emil: the fuses are separate from the software inside
04:56 PM Lambda_Aurigae: 328p can run at 3.3V or 5V
04:56 PM Emil: you can program whatevrr you want
04:56 PM ibanezmatt13: I'm not sure, but the Arduino IDE won;t upload the bootloader after me trying to set the fuses
04:56 PM Lambda_Aurigae: ibanezmatt13, what is your efuse setting?
04:57 PM Emil: ibanezmatt13: fix your fhz on the arduino
04:57 PM Emil: ibanezmatt13: it assumes 16MHz
04:57 PM Emil: not 8MHz
04:57 PM ibanezmatt13: 0x05 but I believe not setting the unused bits as 1 is causing that to be an issue
04:57 PM Lambda_Aurigae: so it should be 0xFF
04:57 PM Lambda_Aurigae: no
04:57 PM Emil: ibanezmatt13: not, they are not the issue
04:57 PM Lambda_Aurigae: duh.
04:57 PM Lambda_Aurigae: missed a bit.
04:57 PM ibanezmatt13: on the boards setting I've chosen the 3v3 8mhz option for the bootloader, and I've tried this after setting 0xFF as well
04:58 PM Lambda_Aurigae: 0xFA ?
04:58 PM ibanezmatt13: FA?
04:58 PM Lambda_Aurigae: 11111101
04:58 PM Emil: ibanezmatt13: you are fixated on the fuses
04:58 PM Lambda_Aurigae: as opposed to 00000101
04:58 PM Emil: ibanezmatt13: those are not your issue
04:59 PM Lambda_Aurigae: why the hell does arduino run at 16mhz anyhow? the chips it runs on are generally capable of 20mhz.
05:00 PM ibanezmatt13: yeah, hmm. So if I set 0xFA I should be okay for the efuse?
05:00 PM specing: Lambda_Aurigae: not the atmegas, the attinys
05:00 PM specing: Lambda_Aurigae: I guess the MUL is the problem
05:00 PM Emil: Lambda_Aurigae: because 16MHz is pretty nice
05:01 PM antto: 20MHz has waaay to many zeros
05:03 PM Emil: Lambda_Aurigae: a search engine gave an acceptable answer
05:04 PM Emil: which is "legacy code support" :DDDDD
05:04 PM Lambda_Aurigae: bah.
05:04 PM Emil: I mean wtd
05:04 PM Emil: wtf*
05:04 PM Lambda_Aurigae: ardweeny started on 20MHz capable chips.
05:04 PM Emil: You already control the fucking hal
05:04 PM Lambda_Aurigae: yup.
05:04 PM Emil: "legacy code support is not a fucking issue :DDD
05:05 PM Emil: Lambda_Aurigae: it apparently didnt start on the 328p
05:06 PM Emil: Lambda_Aurigae: yeah it was m8 and m168 before m328p
05:06 PM Lambda_Aurigae: oh.
05:06 PM Lambda_Aurigae: I thought it started with the m88
05:06 PM Emil: the funny part is that arduino is just a rebranding of the wiring lib
05:07 PM Lambda_Aurigae: pretty much.
05:07 PM Emil: but eh, it has brought be affordable hardware at the cost of some newbies
05:07 PM Lambda_Aurigae: microsoft of the microcontroller world...let's abstract everything and round off the corners so you don't hurt yourself.
05:07 PM Emil: I'm okay with thay
05:08 PM Emil: Lambda_Aurigae: and then assume your users are idiotic to the core
05:08 PM Emil: and need to be pandered
05:08 PM Lambda_Aurigae: that's microsoft.
05:08 PM Lambda_Aurigae: and ardweeny
05:08 PM Emil: yeah
06:28 PM jaggz: so.. a year ago I was working on a LUFA mouse, but had lots of problems in windows with the com port recognition
06:28 PM jaggz: I had to go set the COM parameters from commandline each time I hooked the thing up
06:28 PM jaggz: is there a more reliable library+windows driver system to use?
06:28 PM jaggz: (I was using a promicro16)
06:29 PM Lambda_Aurigae: shouldn't mouse use hid rather than com port?
06:31 PM Emil: yeah wtf? :D
06:32 PM Lambda_Aurigae: nobody uses serial mousies anymore.
06:32 PM Lambda_Aurigae: specially windows.
06:32 PM Lambda_Aurigae: surprised it even still worked.
06:32 PM Lambda_Aurigae: you should always use hid for mousie.
06:34 PM jaggz: Lambda_Aurigae, dunno
06:34 PM Lambda_Aurigae: so look at lufa hid mouse.
06:35 PM Lambda_Aurigae: http://www.fourwalledcubicle.com/LUFA.php
06:35 PM Lambda_Aurigae: it's in there...mouse device.
06:35 PM Lambda_Aurigae: it's a hid device.
06:35 PM jaggz: maybe I was doing it wrong.. yeah..
06:35 PM jaggz: :)
06:38 PM Lambda_Aurigae: maybe
06:38 PM Lambda_Aurigae: I can see how it would work that way.
06:39 PM Lambda_Aurigae: usb-cdc then an old serial mouse driver.
06:39 PM Lambda_Aurigae: but I can also see how it could break badly.
06:40 PM jaggz: :)
06:40 PM jaggz: if and when I return to this I'll see if I can do HiD
06:42 PM jaggz: Lambda_Aurigae, Emil, ahh.. i was using serial only for debugging information
06:42 PM jaggz: when testing my cap sensors
06:43 PM jaggz: I didn't even get to mouse clicks yet
06:43 PM Lambda_Aurigae: there's demo code on the lufa site.
06:43 PM jaggz: yeah I went off their demo
07:14 PM grog_c is now known as Grogdor