#avr | Logs for 2012-08-29

Back
[02:32:55] <xaxes> hey all :) Finally I got my jtagice mkI clone working! :) But Im only able to flash/read/fuse the target using avrdude.. Neither avarice nor winavr cannot synchronize "often", some answers seems to be correct, then it fails .. it also seems, that my clone only works with 19200 baudrate. Anyone an idea what could went wrong? http://old.nabble.com/avarice---cannot-sync-td27204117.html have almost the same situation
[04:21:49] <OndraSterver> tmpvar, :)
[04:21:54] <OndraSterver> sorry mate, I was asleep already
[04:22:50] <OndraSterver> the schematics looks nasty :D
[04:23:21] <OndraSterver> wait
[04:23:33] <OndraSterver> oh
[04:23:35] <OndraSterver> it is really nasty
[04:23:42] <OndraSterver> GND should be ALWAYS on the bottom
[04:23:46] <OndraSterver> Vcc ALWAYS on the top
[04:23:55] <OndraSterver> it just confuses people :)
[06:19:44] <karlp> bleh, borrowed a dragon to try and do some debugging, but the damn thing won't even program in isp mode reliably
[06:25:36] <OndraSterver> it is reliable
[06:26:06] <karlp> I'm sure it's meant to be.
[06:26:46] <karlp> but if I have to use avrdude at -B 20 instead of -B 1, it's not working for me.
[06:26:54] <OndraSterver> too long ISP cable?
[06:26:57] <karlp> maybe.
[06:27:16] <karlp> about half as long as on the usbtinyisp that I normally use :)
[06:27:21] <OndraSterver> actually my jtag cable is something between 40 and 50cm
[06:27:22] <karlp> it runs at -B 1
[06:27:34] <karlp> well, the dragon cable is about 12cm
[06:27:51] <karlp> anyway, ok, so -B 20 does work, that's not too slow I guess.
[06:27:56] <karlp> now, debugging time!
[06:27:58] <OndraSterver> there was no cable in the package with dragon
[06:28:17] <karlp> s/the dragon cable/the cable on this dragon/
[06:29:01] <OndraSterver> I do wonder, what size is the die? 180nm?
[06:29:14] <OndraSterver> as in between transistors
[06:30:13] <karlp> meh, also, it disappears after every program.
[06:43:36] <karlp> yeah, I get a disconnect/reconnect, and a whole heap of "hub 2-0:1.0: unable to enumerate USB device on port 1" awesome sauce
[06:55:02] <karlp> OndraSterver: it's this: http://old.nabble.com/-bug--34339--back-to-back-avrdude-commands-fail-on-dragon_isp-on-Ubuntu-10.10-td32500790.html
[06:55:15] <karlp> seems the dragon disconnects itself and then has to reenumerate
[06:55:17] <OndraSterver> ah
[06:55:21] <OndraSterver> yes
[06:55:22] <OndraSterver> it has to
[06:55:34] <karlp> "has to" ?
[06:55:41] <OndraSterver> it reboots to different mode :o
[06:55:43] <OndraSterver> sometimes
[06:55:53] <karlp> yeah, fine, if I asked it to switch modes maybe
[09:46:39] <karlp> awesome, turning debug wire on makes my program die
[10:10:23] <theBear> then don't turn on debugwire <grin>
[10:18:52] <karlp> theBear: yeah, or find another way to debug it.
[10:19:09] <karlp> I hhave working and non-working code, was trying to fidn out what was in teh non-working that was stopping it
[10:19:18] <karlp> but with dw on, even teh prior working code stops
[10:19:26] <karlp> I think it's stack explosion.
[12:11:50] <tomatto> is good way to connect AVCC and AREF together?
[12:19:24] <specing> tomatto: What is AREF?
[12:19:42] <tomatto> specing: Analog reference input pin
[12:20:06] <specing> So what does a reference do?
[12:21:23] <tomatto> i don't know how explain it
[12:22:10] <Tom_itx> it sets the upper limit for the adc
[12:22:43] <tomatto> yeah, it is right
[12:23:31] <tomatto> so because of it is better to have AVCC higher than AREF, isn't it?
[12:24:32] <Tom_itx> greater than or equal to
[12:25:40] <tomatto> because my idea is connect both together. it is equal to. what do you recommend?
[12:27:18] <Tom_itx> you can unless you need a lower v ref
[12:28:24] <tomatto> i have AREF voltage now 3.68V and AVCC connected to 5V UCC
[12:29:12] <tomatto> but on 5V is lot of noise
[12:34:06] <Kevin`> tomatto: avcc needs to be the same as vcc. the only reason it's a seperate pin is so you can add filtering if you want
[12:34:54] <Kevin`> tomatto: be aware that depending on the adc settings, aref can be connected to the inernal voltage reference. don't drive it hard to something if you are still testing code
[12:35:26] <Kevin`> if you are using the internal voltage reference, stick a capacitor on aref
[12:35:33] <Kevin`> (actually, do that anyway)
[12:37:00] <tomatto> i need higher reference voltage than internal
[12:41:10] <Kevin`> tomatto: you can't supply a higher voltage than vcc to the mcu's pins because of the protection diodes. use a voltage divider.
[12:41:40] <tomatto> i know. i have supply voltage 5V and reference voltage 3.68V
[12:41:50] <tomatto> that is ok, isn't it?
[12:41:53] <Kevin`> that's fine
[12:41:58] <Kevin`> just be careful to set up the adc correctly
[12:42:13] <tomatto> i hope i have
[12:42:16] <Kevin`> you don't want to connect that 3.68v to the internal 2v or whatever reference
[12:42:24] <Kevin`> use a resistor if testing :)
[12:43:15] <karlp> so, -O0 results in __cxa_pure_virtual undefined refierences, but -O1 or -Os compiles ok, is that an easy fix?
[12:43:42] <tomatto> Kevin`: have set only ADEN and ADPS2, ADPS1 to one on atmega8. i hope it is correct
[12:43:46] <Kevin`> are you using some of the library code that depends on precise timing, karlp?
[12:44:04] <tomatto> in register ADCSR
[12:44:19] <tomatto> ADCSRA
[12:44:38] <tomatto> and REF bits setted to 0
[12:45:40] <karlp> Kevin`: nah, just trying to get some sensible debug with dragon,
[12:46:03] <Kevin`> karlp: Os tends to give IMO sensible asm code
[12:46:33] <karlp> except it optimizes everything out :)
[12:47:04] <karlp> I just added an extern ref for it, from here: http://stackoverflow.com/questions/920500/what-is-the-purpose-of-cxa-pure-virtual
[12:47:20] <karlp> but I was a little surprised that I needed to add that for -O0, but not for any other levels
[12:48:29] <karlp> huh, also, my bug has now gone away :|
[12:48:36] <karlp> unfun
[12:50:21] <tomatto> Kevin`: what division factor do you suggest for adc?
[12:50:27] <OndraSterver> specing, you were into yiffing or who was it?
[12:50:28] <OndraSterver> http://9gag.com/gag/5205275
[12:50:28] <OndraSterver> :D
[12:50:32] <tomatto> or how correctly set it
[12:51:14] <Kevin`> tomatto: for the clock scaling? set it to something that results in a final frequency that's within the specifications defined in the datasheet
[12:53:01] <tomatto> Kevin`: i know between 50 and 1000 KHz, but what is better for voltage sampling?
[12:53:18] <Kevin`> tomatto: also, the external filtering you have for your signals should match or be less than the configured bandwidth of the adc
[12:53:43] <Kevin`> tomatto: are you sure it's ok at 1000 khz? I haven't looked at the datasheed
[12:53:47] <Kevin`> datasheet*
[12:54:31] <Kevin`> tomatto: a higher frequency, within the specs, is better, since you can oversample it more
[12:54:46] <Kevin`> it's not likely to be critical.
[12:55:03] <tomatto> 1MHz is max value
[12:55:51] <tomatto> input bandwith is 38.5KHz
[12:55:54] <Kevin`> the chip will allow you to set it far outside it's recommended operating conditions, btw
[12:56:16] <Kevin`> (to be compatible with different clock configurations)
[12:56:59] <specing> OndraSterver: WTF is that
[12:57:05] <OndraSterver> no idea
[12:57:24] <OndraSterver> but were you the one who talked here about yiffing?
[12:57:35] <specing> No
[12:57:42] <OndraSterver> hmm
[12:57:43] <OndraSterver> damn
[12:58:22] <OndraSterver> ah it was amee2woof + GuShH
[12:58:25] <OndraSterver> sorry then, specing
[12:59:48] <specing> http://www.urbandictionary.com/define.php?term=yiff
[13:00:23] <karlp> yah, must be stack overflow. same code compiled with -mcu=328p runs ok, with -mcu=168 it fails.
[13:00:49] <OndraSterver> specing, I know what yiff is, I don't know where that picture is from
[13:01:00] <OndraSterver> ignore that messag
[13:01:01] <OndraSterver> e
[13:01:04] <OndraSterver> it was not ment for you
[13:02:30] <specing> OndraSterver: Btw I would seriously "yiff" if those two asked for it ;P
[13:03:42] <OndraSterver> who wouldn't..
[13:03:54] <specing> :)
[13:11:14] <RikusW> xaxes: good to know you got it working
[13:11:28] <RikusW> xaxes: avarice connects to avr-gdb
[13:11:52] <RikusW> getting that set up is a bit complicated, you'll need to read quite a few docs
[13:20:08] <amee2woof> OndraSterver: when did I yiff GuShH? o.O
[13:25:48] <OndraSterver> amee2woof, are you the same person as amee2k?
[13:28:18] <amee2woof> yes
[13:29:25] <OndraSterver> well then
[13:29:35] <OndraSterver> I have already closed the log
[13:29:45] <OndraSterver> but there was something with you and GuSh and yiffing :D
[13:30:44] <amee2woof> OndraSterver: gushh once made a big deal about finding out i'm a fur a while back
[13:30:45] <RikusW> yiffing ?
[13:31:05] <amee2woof> in fact, finding out, after pretty much everyone already knew for like a year
[13:31:07] <OndraSterver> amee2woof, that can be it
[13:32:50] <amee2woof> RikusW: yiffing is furry sex/porn
[13:33:33] <RikusW> google seems to think so too ;)
[13:34:47] <RikusW> first time I came across the term
[13:38:43] <tmpvar> hey OndraSterver
[13:39:33] <OndraSterver> tmpvar, hello there
[15:10:37] <OndraSterver> hmm
[15:10:42] <OndraSterver> when I have ISR(some vector) { .. }
[15:10:49] <OndraSterver> can I actually jump out of the ISR using return; ?
[15:11:09] <specing> probably
[15:11:19] <specing> see if it generate the rjmp to pops
[15:11:23] <OndraSterver> because I see in ASF always goto blabla_end
[15:12:31] <OndraSterver> yep
[17:02:56] <annath> Hey guys, quick question. I am looking at an LSS file generated from some simple C code that I wrote (for an ATtiny2313), and generally trying to figure out what is going on. I keep seeing registers identified in the ASM by this r## notation. I've figured out what a couple of these are (X, Y, and Z mainly), but the others I can't figure out. Is there a list somewhere in the datasheet that maps these numbers to each register? On
[17:02:56] <annath> page 9/10 of the 2313 datasheet I found a reference to it, and that's also where I found X, Y, and Z. Where can I find the others?
[17:03:39] <Landon> iirc there's a map near the end of the datasheets
[17:05:01] <annath> There's the register summary on page 211, but I don't see X,Y, and Z on it and I can't figure out how the numbers it gives map to the R## notation
[17:05:16] <Landon> yeah, looking at it now, I was wrong :(
[17:06:14] <Landon> looking at page 10, what doesn't that have that you need?
[17:06:14] <annath> Yeah. It looks like the general purpose working registers are separate somehow, as the list on 211 starts at 0x20 and the GPWRs end at 0x1F
[17:06:58] <annath> I was thinking that there were other named registers in that file
[17:07:04] <Landon> nope, just XYZ
[17:07:07] <annath> ah, okay
[17:07:25] <Landon> some of them might be generally used for a specific purpose, but that's more on the compiler side
[17:07:38] <Landon> (such as storing 0 in r0 and 1 in r1)
[17:09:07] <annath> One of the things that had me confused is that one of the first commands in my main function(in my C file) is to set DDRD to 3, and the first instructions in the LSS file are push r28, push r29, and ldi r24 3. I get the two pushes, those are just preserving the current register states, and I though that the ldi was loading DDRD, but R24 just maps to one of the GPWRs
[17:09:21] <annath> so that's what had me confused
[17:10:59] <Erlkoenig> ldi can't directly load an IO register, so it has to load one of the core registers (apparantly r24) and then probably the OUT instruction will be used to transfer the value to DDRD
[17:11:06] <Erlkoenig> @annath
[17:11:19] <annath> ah
[17:11:20] <annath> that makes sense
[17:11:44] <annath> Yep
[17:11:53] <annath> next instruction is out 0x11, r24
[17:12:15] <annath> Thanks a ton guys, that helps a lot
[19:54:33] <jadew> can anyone familiar with ISP have a look at this and tell me if they can spot anything wrong? http://pastebin.com/WfB0RPcY
[19:55:29] <jadew> here's output from the debug messages: http://pastebin.com/gte4vdca
[19:55:50] <jadew> the 0x13 at the top is CMD_PROGRAM_FLASH_ISP
[19:59:33] <jadew> it's been baffling me for the last few hours
[19:59:50] <jadew> I guess a logic analyzer would help now
[20:03:03] <Tom_itx> absolutely
[20:03:07] <Tom_itx> i love my saelae
[20:03:31] <jadew> yeah, but it's not cheap enough :)
[20:03:41] <jadew> I think I'm gonna get an open bench la
[20:05:17] <Tom_itx> those look ok too
[20:05:26] <Tom_itx> i just have no experience with them
[20:05:33] <Tom_itx> i like the saleae package
[20:05:36] <Tom_itx> and software
[20:05:50] <Tom_itx> they have drivers for several protocols which it very handy
[20:06:29] <jadew> I tried out the OLS (it's an alternative software for the open bench la), I changed it to work with my thingie and I must say it fails to properly decode 1-wire
[20:07:26] <jadew> not hard to fix it tho, but not in the mood either
[20:16:43] <Tom_itx> saleae has the 1wire protocol
[20:17:58] <jadew> I'm sure, I didn't need to analyze it, just wanted to see what that software can do
[20:18:18] <jadew> my bus tool can sniff it tho