#avr | Logs for 2011-11-22

Back
[00:00:08] * soul-d gonna grab some coffee and see if can find some more happy news to start the day :)
[00:13:04] <grummund> time travel is now possible, is that good enough news for you?
[00:18:23] <Casper> grummund: sadly, they only succeded in one way
[00:32:31] <Landon> I should be using my time travel machine shortly
[00:32:38] <Landon> already past midnight
[00:52:40] <soul-d> time travel was already possible but now also backwards ? :P
[02:08:17] <inflex> okay, for those who are truly bored... logged data from my servo logger being driven by my booster-all-in-one board, plotted with gnuplot :D http://dxp.me/i/servo-smps.png
[02:08:36] <inflex> (blue= voltage, red = amps, green = servo pulse width, purple = time)
[02:09:03] <inflex> what's really curious is how the servo current dips a lot back to zero
[02:13:17] <earthshine> o/
[04:06:56] <ziph> inflex: Sure it isn't undersampled?
[04:19:27] <theBear> oh, maybe servo pwms internally ?
[04:38:21] <inflex> ziph: not sure to be honest
[04:38:38] <inflex> I really need to get at least 1000sps to be more accurate
[04:38:51] <inflex> when the servos are pushing against a stall load, you can feel them pulsating
[08:43:02] * inflex ponders a RLE algorithm
[09:00:11] <ziph> inflex: Just for the voltage and current?
[09:00:32] <inflex> ziph: well... looking at it all... I almost had it going for me, then I realised deltas had to be + and -
[09:00:58] * inflex had it in 2bytes of data... XRVVPPPP and then a full byte for current
[09:01:17] <inflex> blah... except thatjust won't work, because the pulse can change quickly
[09:01:28] <inflex> and +/-1 on volts won't be enough either
[09:01:57] <ziph> So the graph at http://dxp.me/i/servo-smps.png is what you're trying to compress?
[09:02:11] <inflex> pretty much, yep
[09:02:20] <ziph> Nasty.
[09:02:27] <inflex> doesn't show any wiggles on the V line, but they're there in normal use
[09:02:30] <ziph> Did you find why the current is bouncing?
[09:03:04] <inflex> I think it was actually my ADC in part... but also the servo still
[09:03:16] * inflex put a stiffer Aref on the board and ended up with...
[09:03:48] <inflex> http://dxp.me/i/s.png
[09:04:04] <inflex> notice the V line is wiggling this time too (blue)
[09:04:14] <ziph> Do you see it on a CRO?
[09:04:24] <inflex> I've already eliminated the purple line (time), so it's just blue, red and green now
[09:04:32] <inflex> I can't on the scope, it's not a DSO
[09:04:41] <inflex> and the image won't stay stable long enough
[09:05:02] <inflex> I do know though that the servos do pulsate at ~50Hz when I try to stall them
[09:05:46] <ziph> You were doing that towards the end? :)
[09:06:08] <inflex> trying to turn the servo
[09:06:17] <ziph> Yeap..
[09:06:19] <inflex> (but not changing the servo position from the controller)
[09:07:21] <inflex> as I pushed it beyond just the first sort of hold point you can see it consumes more current longer to push me back
[09:07:30] <ziph> What's the x axis scale?
[09:07:39] <inflex> basically the compressional absorption of my flesh ran out ;)
[09:07:46] <inflex> that's just sample-count, it's roughly 50/sec
[09:08:15] <ziph> Can you run it any faster?
[09:10:11] <inflex> sure but I lose my precision, I can probably go about 10x faster... I think
[09:10:15] <inflex> 500/sec
[09:10:35] <inflex> yeah, lemme try that for kicks and giggles... though ugh, pulse data will have to be dropped because that's my sync pulse
[09:10:42] <ziph> Or do an FFT on the data and see if the spectrum looks interesting.
[09:10:47] * inflex saves his current code to another file ;)
[09:10:59] <ziph> You don't use SVN?
[09:11:18] <Kevin`> you don't use git?
[09:11:20] <inflex> nope, I used to... but these days, with so much HDD space, I just dump whole snaps
[09:14:50] <karlp> it's not about the disk space....
[09:14:59] <TwisteR> SVN and other VCS are all about handy automatic version control, not disk space saving ;)
[09:15:01] <inflex> I know, really, I do
[09:15:03] <TwisteR> karlp: :)))
[09:15:18] <inflex> been coding for 30 years now and I've used things all from rcs and upward
[09:15:29] <karlp> and clearly hated them all, or you'd be using them :)
[09:15:32] <inflex> but for this sort of stuff, I just like to store whole-snaps
[09:15:36] <karlp> rcs will do that to you :)
[09:16:20] <inflex> didn't hate them -all-, but in a 1-person coding situation a lot of their appeal does wear a little thin... some things I still use with git
[09:16:39] <inflex> but 2K AVR coding *shrug* I don't bother
[09:17:00] <karlp> except.... you're having problems and feeling the need to keep the versions seprate... ;)
[09:17:10] <karlp> I use git for single developer.
[09:17:16] <ziph> inflex: You're wrong and they won't be happy until you agree.
[09:17:21] <ziph> inflex: ;)
[09:17:22] <karlp> ziph: here here!
[09:17:25] * karlp grins
[09:17:29] <inflex> the best bit is always when mangement goes "Okay, we've moving to a new revision system" *tear own faceoff*
[09:17:37] <inflex> it's "hear hear" ;)
[09:17:55] <karlp> unless I was saying, "here here! look at me over here!" ?
[09:17:59] <karlp> (yes, ok, my bad)
[09:18:03] <inflex> hah
[09:18:12] <ziph> One place here I have the pleasure of not working at makes people e-mail changes to a change control person who then checks them in to SVN.
[09:18:19] <ziph> That's the kind of thing management actually does. ;)
[09:18:26] <inflex> for this situation, git wouldn't be much use, since the new code I'm writing obliterates much of the original
[09:18:41] <inflex> so it's really more of a separate program entirely.
[09:19:03] <inflex> send me some diff's ;)
[09:19:37] <inflex> (and god help the person who didn't use -b
[09:23:40] <inflex> downloading data ow
[09:23:45] <inflex> now
[09:23:52] * inflex throws this POSH keyboard out the door
[09:24:05] <inflex> can't wait for me to be rich enough again to buy a new IBM-clicky
[09:25:18] <ziph> You'd really love a new iMac keyboard.
[09:25:18] <ziph> :)
[09:27:58] <inflex> you want the raw data?
[09:28:48] <inflex> dxp.me/i/servo.log (52K)
[09:29:04] <inflex> #1 is volts, #2 current... numbers are effectively meaningless
[09:29:23] <ziph> I'm tempted, but it's either that or writing in invoice so I can pay my rent this week. ;)
[09:29:32] <ziph> an invoice
[09:29:40] <inflex> hahah, np, I'll dump animage
[09:30:32] <inflex> http://dxp.me/i/ss.png (very wide, 3500 x800)
[09:31:05] <Kevin`> probably should have made it even wider
[09:31:10] <ziph> Now I really want to run an FFT on that.
[09:31:26] <inflex> well,I can in gnuplot just zoom in ;)
[09:31:26] <Kevin`> also, you need a higher sample rate :)
[09:32:03] <inflex> well, here's a tiny sample.
[09:32:15] <inflex> 162 0
[09:32:16] <inflex> 161 154
[09:32:16] <inflex> 161 148
[09:32:16] <inflex> 162 1
[09:32:24] <inflex> column 2 is current
[09:32:36] <ziph> How many readings does it stay 0 at
[09:32:37] <ziph> ?
[09:32:44] <inflex> 1
[09:32:57] <ziph> Regardless of the sample rate from the look of it...?
[09:32:58] <inflex> never stays at 0 or 1 for more than 1 column typically
[09:33:20] <Kevin`> inflex: http://kwzs.be/~kevin/irctl.png - wider ;) - from something else I needed to paste up a while back
[09:33:21] <inflex> maybe I should try a non-stalled servo
[09:33:42] <ziph> inflex: I take it you won't want to put an opamp on that board? :)
[09:33:51] <inflex> nice to see another gnuplot'er
[09:34:01] <inflex> ziph: no thanks
[09:34:26] * inflex tries a non-loaded servo
[09:39:26] <inflex> on a non-loaded servo, the gaps are bigger
[09:40:13] <inflex> I wonder if they're commutations from the brushed motor in the servo?
[09:41:25] <ziph> Wouldn't they be killing the AVR in that case?
[09:41:56] <ziph> Or is the current shunt on just the motor?
[09:42:47] <inflex> the AVR is on its own decoupled supply
[09:44:17] <ziph> What do people want to do with the current information?
[09:44:19] <inflex> okay, http://dxp.me/i/ss2.png
[09:44:32] <inflex> ziph: determine if they're overloading the BECs on their flight gear
[09:44:39] <ziph> inflex: You didn't chmod that
[09:44:41] <inflex> (or how close they are to doing that
[09:44:42] <inflex> fsck
[09:45:10] <inflex> try now
[09:45:40] <ziph> Oh, so they mainly care about peak rather than current*voltage?
[09:46:10] <ziph> Wow, even weirder. :)
[09:52:38] <inflex> yes, because it's the peaks that yank the voltages low on the supply which makes the receivers go into reset/reboot
[09:52:44] <inflex> which causes the planes to fall out of the sky
[09:53:35] <ziph> So you're calling this Project Icarus? :)
[09:54:11] <ziph> Oops.
[09:54:18] <ziph> Apple-W on the wrong screen. :)
[10:17:06] <inflex> haha
[10:51:42] <karlp> heh, hooray for fun failures. don't put your avr chips down rotated 90 degrees
[10:51:51] <karlp> we've managed to blwo the rx line, but not the tx line.
[10:52:11] <karlp> so you can program some debug firmware printing out handy heartbeats, except it won't reply to anything.
[10:56:54] <sw33tlull4by> hey there following code compiles and runs but the ISR is not called, wrecked my brain about this for 2 days now, probably something trivial, can you guys help me? http://pastebin.com/8Wmvf7qx controller is the ATmega328p, the reason for the setup of the program is, it is compiled and flashed onto the chip using the arduino ide
[10:57:51] <ziph> sw33tlull4by: Is the timer running
[10:58:08] <sw33tlull4by> TIMERCNT1 changes the value yes
[11:09:38] <ziph> sw33tlull4by: I don't have the datasheet in front of me, but are you enabling the compare interrupt but putting a handler on the overflow interrupt?
[11:12:09] <sw33tlull4by> yes,because: once I couldn't get the TIMERCOMPA interrupt to work I figgured that if the interrupt might miss,for whatever reason I might still get an overflow for the counter constatnly changing value
[11:12:45] <sw33tlull4by> however both failed, on line 15 you can see the enableing of the COMPA interrupt for Timer1
[11:14:50] <Casper> sw33tlull4by: ardnuino code there... yuck... but anyway... is your main function reaching the end?
[11:16:29] <ziph> sw33tlull4by: The interrupt you're enabling is for Input Capture.
[11:16:35] <Casper> and have you confirmed that you use the right vector name? it can change from chip to chip
[11:16:55] <Casper> and that was the last thing that I tought: wrong interrupt (I don't have my datasheet on hand)
[11:16:55] <ziph> sw33tlull4by: You want TOIE1
[11:17:41] <sw33tlull4by> well arduino because I listed to one of my colleagures, it is cheap and will do the job, anyway, there is no such thing as a main-function the loop -function is executed over and over again once setup() finished, so I guess yes the all finish
[11:17:56] <sw33tlull4by> oh thank you no wonder i can't get an overflow interrupt even if it occures
[11:24:13] <sw33tlull4by> finally some movement, i get jibberish now, probably due to the change of tmpval, I think I'll try it again from here, and once I get the overflow interrupt working with nice output, i try the compareinterrupt for OCRA again
[11:24:27] <sw33tlull4by> thank you
[11:25:37] <ziph> No problem.
[11:25:57] <ziph> When things like that don't work it almost always means you haven't read the datasheet carefully enough.
[11:26:22] <ziph> Finding example code and application notes can help with that too.
[11:26:46] <sw33tlull4by> ok will do that
[12:02:06] <scuzzy> hey RikusW!
[12:02:08] <scuzzy> how you doing dude?
[12:02:20] <RikusW> a bit tired
[12:02:31] <RikusW> had quite a bit of rain here :)
[12:02:41] <RikusW> ATmega324A-PU (RS: 719-3957) got a RTC on the chip
[12:02:52] <RikusW> Cheap too
[12:03:08] <RikusW> hows the knee ?
[12:07:53] <scuzzy> Kee is getting better
[12:07:56] <scuzzy> Knee
[12:08:06] <scuzzy> some days are worse than others
[12:08:10] <scuzzy> today hasn't been too bad
[12:08:14] <scuzzy> but, still a long long way to go
[12:08:37] <RikusW> so you can at least walk ?
[12:08:42] <RikusW> or using crutches ?
[12:09:44] <scuzzy> I can walk
[12:09:53] <scuzzy> I managed to get rid of them in a week and a half
[12:09:57] <scuzzy> I hate using them
[12:10:01] <scuzzy> can't carry anything
[12:10:26] <scuzzy> down stairs is still a problem
[12:10:31] <scuzzy> but getting there
[12:12:41] <scuzzy> Does rain mean lots of work for you?
[12:13:36] <Casper> RikusW: full RTC? or just the 32768 crystal input for one timer?
[12:15:04] <RikusW> Casper: seems timer2 is used as RTC...
[12:15:32] <Casper> I knew it
[12:15:40] <Casper> just a clock source
[12:15:46] <Casper> and you still have to do it in software
[12:16:15] <RikusW> At least you have TOSC1/2 inputs for the 32kHz crystal
[12:16:23] <scuzzy> indeed
[12:16:24] <RikusW> and m324 is cheap
[12:16:25] <Casper> http://www.pinkbike.com/video/227689/?trk=vlogo ← skip to 1:05
[12:16:26] <scuzzy> support for 2 cyrstals
[12:16:31] <scuzzy> very handy indeed
[12:16:31] <RikusW> cheaper than m328 in fact
[12:16:39] <RikusW> and m324 is 40 pin dip
[12:16:44] <scuzzy> same price as a mega32u4
[12:16:45] <scuzzy> );
[12:16:47] <scuzzy> just about
[12:16:57] <scuzzy> yeah, I can't use dip
[12:17:02] <scuzzy> I need this to be as small as possible
[12:17:09] <RikusW> scuzzy: m32u4 is now R44 at RS...
[12:17:32] <scuzzy> exactly
[12:17:45] <RikusW> m324 is available as tqfp
[12:17:48] <scuzzy> http://za.rs-online.com/web/p/microcontroller/7153798/
[12:17:56] <RikusW> m324a seems to be cheaper
[12:17:58] <scuzzy> R48.50
[12:18:23] <scuzzy> as a TQFP
[12:18:38] * RikusW wonder why dip is cheaper
[12:18:54] <scuzzy> because hobbiest will love it?
[12:18:55] <scuzzy> I dunno
[12:18:58] <scuzzy> I wondered that too
[12:20:12] <scuzzy> see the secrecy bill is passed
[12:20:14] <scuzzy> happy days!
[12:20:32] <scuzzy> now Zuma and his cronies can go "what arms deal? don't you mean 25 years in prison?????"
[12:20:50] <RikusW> seems everyone wants to fight it...
[12:21:15] <scuzzy> and why wouldn't they?
[12:21:25] <scuzzy> you happy to have the ANC pull the wool over your eyes?
[12:21:38] <RikusW> no
[12:21:58] <RikusW> maybe should be called the coverup bill
[12:22:15] <scuzzy> well, technically, it's called the "protection of information act"
[12:22:33] <scuzzy> but, it's just a way for them to cover up all their dirty undies and not be held accountable to anything
[12:22:41] <scuzzy> Ciao democracy, was nice to almost know you
[12:22:53] <RikusW> but it will probably be abused...
[12:23:04] <scuzzy> no doubt
[12:23:19] <scuzzy> anyway
[12:23:23] <scuzzy> onto happier topics
[12:23:38] <RikusW> like SARS ? ;)
[12:23:41] <scuzzy> Haha
[12:24:06] <scuzzy> SARS is the most efficient gov body
[12:24:12] <scuzzy> the rest are all pretty crap
[12:24:20] <scuzzy> like "Hey, how about some electricity?"
[12:25:02] <RikusW> Electricity is more expensive these days...
[12:25:15] <RikusW> like R800 line fees on a farm...
[12:25:24] <RikusW> even with no usage
[12:25:28] <scuzzy> what?
[12:25:32] <scuzzy> how is that even legal?
[12:25:49] <scuzzy> wankers
[12:26:04] <RikusW> R914 actually
[12:26:09] <scuzzy> crikey
[12:26:11] <scuzzy> robbery
[12:26:13] <Casper> when battery and solar will become cheaper, they will see lots of customer leaving
[12:26:27] <RikusW> R0.6948 / kWh
[12:26:28] <scuzzy> I'm trying my best to get off grid
[12:26:43] <scuzzy> I pay R1.07/kWh
[12:26:53] <scuzzy> I installed a Gas hob
[12:27:03] <scuzzy> all my lights are CFL's or LED
[12:27:11] <RikusW> we too have gas for power outages...
[12:27:35] <RikusW> my CFL blew, so I now have 40W incandescent
[12:27:42] <scuzzy> use a fire to keep warm
[12:27:48] <scuzzy> don't use heaters, etc
[12:27:59] <scuzzy> timer on the hot water made a HUGE difference
[12:28:03] <RikusW> heaters use too much electricity...
[12:28:10] <scuzzy> yeah, way too much
[12:28:25] <scuzzy> I think I use about 420 kWh pm
[12:28:30] <RikusW> so how long does it take to heat up the water about ?
[12:28:30] <specing> burn some politicians
[12:28:38] <RikusW> 2 hours ?
[12:28:40] <RikusW> 3 ?
[12:28:47] <scuzzy> RikusW: not actually sure, but I have the timer on for 3 hours a day
[12:28:48] <scuzzy> that's all
[12:28:52] <scuzzy> and there is always enough hot water
[12:28:53] <RikusW> 878kWh here...
[12:28:55] <scuzzy> even the next morning
[12:29:08] <RikusW> how about solar water heating ?
[12:29:14] <Casper> I kinda doubt "huge" difference
[12:29:21] <Casper> but it can make one for sure
[12:29:29] <scuzzy> RikusW: I actually wanna try using a fire coil heater for winter
[12:29:33] <scuzzy> for heating the hot water
[12:29:55] <RikusW> or a coil around the chimney ?
[12:29:56] <scuzzy> cus I manage to scavange plenty of wood
[12:30:10] <RikusW> we have a galvanize pipe type
[12:30:11] <scuzzy> Hmmm, I wanna make a burning stove in the garage
[12:30:18] <scuzzy> to a) keep my office warm
[12:30:23] <scuzzy> and b) heat the water
[12:30:29] <Casper> you want to be able to control the heat, or find a way to cool it down before it boil
[12:30:33] <scuzzy> will coil around the flu, or maybe even inside it
[12:30:48] <scuzzy> Casper: yeah, I know, will install all the safety bits and pieces
[12:30:51] <scuzzy> blow off valves, etc
[12:31:29] <Casper> scuzzy: did you saw the mythbuster water heater one?
[12:31:34] <scuzzy> no?
[12:31:39] <RikusW> ah
[12:31:42] <RikusW> kaboom
[12:31:52] <RikusW> high into the air...
[12:31:56] <scuzzy> there are ways of making it work
[12:31:59] <RikusW> no more shack... :-P
[12:32:13] <scuzzy> yeah, steam can make a nasty explosion
[12:33:02] <scuzzy> besides, I try not use mythbusters as a basis for scientific basis
[12:33:20] <scuzzy> basically, if there is a chance of an explosion, they will weight the "evidence" to produce just such a result
[12:33:41] <RikusW> they like explosions ;)
[12:34:18] <RikusW> scuzzy: m325 also got rtc
[12:34:54] <scuzzy> RikusW: indeed they do!
[12:34:55] <RikusW> as does m169a
[12:34:57] <scuzzy> m325
[12:34:58] <scuzzy> Gmmm
[12:35:01] <scuzzy> ok cool
[12:35:05] <RikusW> that one is cheap at RS
[12:35:08] <scuzzy> this is all useful information
[12:35:26] <RikusW> 719-3948  ATmega169A-AU
[12:35:34] <RikusW> was < R30
[12:36:03] <Casper> scuzzy: http://www.youtube.com/watch?v=84I9ezcPDuI#t=1m05s
[12:36:41] <Casper> scuzzy: yes, they had to bypass every safety possible, but still...
[12:36:47] <Casper> it's something to think about
[12:38:23] <RikusW> scuzzy: m64a RS 7194004 R43
[12:38:29] <scuzzy> Casper: my cylinder is rated at 600Pa
[12:38:39] <scuzzy> it also has a 600Pa blow off valve
[12:38:48] <RikusW> 600kPa ?
[12:38:52] <scuzzy> yeah
[12:38:53] <scuzzy> sorry
[12:39:33] <scuzzy> I might damage the cylinder
[12:39:38] <scuzzy> but there is no way it would explode like that
[12:39:54] <scuzzy> RikusW: m64a has RTC?
[12:40:40] <RikusW> yes
[12:40:44] <scuzzy> nice
[12:40:51] <scuzzy> you can also have a boil off manifold
[12:40:51] <RikusW> seems a lot of megas do
[12:40:56] <RikusW> esp the bigger ones
[12:41:00] <scuzzy> this is why I asked a while ago
[12:41:04] <scuzzy> because I seemed to remember it
[12:41:09] <scuzzy> but couldn't recall on what devices
[12:41:30] <RikusW> m128 does too but its like R150... m128a is cheaper
[12:41:37] <chupas> I have an 2 diemnsional eprom array. Is there a way to set initial values in code to output to EEP file for a single dimension?
[12:41:55] <Casper> why not also make wood gas? :D
[12:42:34] <scuzzy> Casper: why not...
[12:43:25] <RikusW> chupas: in avr asm -> .eseg name: .db 0x12
[12:43:54] <chupas> Eh i was talking GCC, but I think i just figured it out, Need to use {} for each dimension
[12:44:05] <chupas> so for 2 need to sets of braces
[12:44:07] <RikusW> or .db 0,0,0,0,0,0
[12:44:09] <chupas> two
[12:44:09] <RikusW> for many bytes
[12:44:20] <RikusW> yes
[12:44:28] <RikusW> {{}{}{}}
[12:44:29] <chupas> Ty sir!
[12:44:35] <RikusW> with , seperation
[12:44:46] <RikusW> {{},{},{}}
[13:26:50] <RikusW> Now this LCR meter is expensive.... http://za.rs-online.com/web/p/meters-lcr/4339784/
[13:53:03] <tomatto_> i want to build equivalent for this http://www.watt24.de/shop_le/evg_wizard.php?step=0&hmnu=4_0_0&osCsid=17c24157f461af33bb3acb897beb959e, but don't know how...?
[14:00:35] <chupas> is AVR studio 5 good enough to use yet?
[14:00:55] <chupas> AKA have the fixed the issues with debugging yet?
[14:56:49] <Steffann> ryan-c ..
[15:04:25] <amstan> i'm trying to assemble some noob programs on the avr with gcc-avr, i just can't figure out how to define the PORT registers
[15:04:30] <amstan> what file do i have to .include?
[15:05:01] <amee2k> avr/io.h comes to mind
[15:06:07] <amee2k> hmm anyone got a good idea how to make a simple pulse generator? output should be TTL level, and pulse width adjustable from <10us to several milliseconds. frequency isn't important and may change with pulse width, as long as duty cycle is low (<5% or so)
[15:07:40] <specing> amee2k: turn pin on, turn pin on, repeat?
[15:07:59] <specing> *[2]off
[15:08:13] <amee2k> hmm that works reliably for delays that short?
[15:08:49] <amee2k> ooh, i've still got some 20MHz xtals left i think. thanks for the idea
[15:08:58] * amee2k dives into junk box
[15:10:48] <specing> amee2k: you wanted it simple...
[15:13:42] <amee2k> yeah :)
[15:14:09] <amee2k> not sure how to control it yet... poti on ADC sounds like a plan
[15:15:32] <amee2k> i've been thinking about a 16 bit timer, but that doesn't fit the duty cycle requirements, really
[15:18:23] <jacekowski> amee2k: 555
[15:18:41] <jacekowski> amee2k: but you can do it with avr
[15:19:39] <amee2k> 555 isn't too hot because its difficult to get it a) linear and b) with high dynamic range
[15:20:06] <amee2k> otherwise i agree. i've actually used a 555 for that before, but i used the 555 only as ramp generator with separate comparator
[15:26:54] <glguy> Is there a common reason that I would be able to write to flash (program) in one case and immediately see the changes using read_pgm_byte_near in some cases and in others the changes would only appear after a hardware reset?
[15:29:02] <amee2k> hmm cache comes to mind but on second thought i'm not even sure AVR CPUs have any
[15:29:55] <amstan> does anyone know of a nice asm tutorial for gcc? i'm just looking for an example .S file with a proper main section and stuff included properly
[15:30:20] <glguy> I wonder if GCC is perhaps optimizing the read operation out of my loop
[15:30:44] <amstan> does anyone know of a nice asm tutorial for gcc? i'm just looking for an example .S file with a proper main section and stuff included properly
[15:31:04] <amstan> i have this so far: http://paste.pocoo.org/show/511610/
[15:31:15] <amee2k> glguy: are you using the self-flashing function? or flash with a programmer and reset without power cycling?
[15:31:23] <amstan> but it doesn't seem to do much, in fact it doesn't seem to overwrite the previous program(a test i did in C)
[15:31:38] <glguy> I'm doing it via the SPM instruction and bouncing though the boot loader
[15:32:51] <amee2k> can you wrap the flashing thing in a function call?
[15:33:16] <glguy> I did
[15:33:19] <amee2k> i don't think the compiler caches values beyond function calls so when you enter and return from a function it would have to write all register cached values back
[15:33:41] <glguy> would it be optimizing away multiple calls to pgm_read_byte_near?
[15:35:14] <glguy> ooh, that seems like it is it
[15:35:46] <amee2k> chances are its a macro i'd say and the result is just a special read instruction using the other data bus
[15:36:03] <glguy> I just reviewed the .lst file and it is looping *after* the LPM
[15:36:13] <glguy> so GCC is being clever about the fact that program memory should be constant
[15:36:18] <amee2k> so if the compiler is intelligently enough it can optimize it away or around like any other read
[15:38:10] <amee2k> makes sense, read-only memory segments are a fairly old concept so i'd expect gcc to use that for optimization
[15:40:16] * amee2k idly waits for the flamewar to start
[15:41:10] <Steffann> Windows sucks
[15:41:31] * specing concurs
[15:41:34] <amee2k> agreed
[15:41:37] <Landon> boo emacs
[15:41:49] <Landon> (my flamewar is better than your flamewar) >.>
[15:41:49] * amee2k idly pets nano
[15:41:50] <Steffann> nano ftw
[15:41:53] <Landon> :|
[15:41:56] <amee2k> lol
[15:42:02] * amee2k high fives Steffann
[15:42:02] <Landon> 2 votes for nano in 1 second
[15:42:06] <Landon> impressive
[15:42:13] <Steffann> :)
[15:42:15] <Landon> what's so attractive about it? :P
[15:42:21] <amee2k> we do our best, just as always
[15:43:53] <amee2k> wtf
[15:43:59] <amee2k> i'm out of USB cables >_<
[15:44:15] <Steffann> Yay, the audio out of this macbook pro .. just as crappy as always :(
[15:45:39] <amee2k> i've got a fuckton of USB-A to mini-USB-B cables but no normal A to B ones
[15:46:11] <Steffann> China has tons for you
[15:46:16] <amee2k> erm
[15:46:22] <amee2k> *I* used to have tons of them
[15:46:45] <amee2k> why do you think i'm this confused that i can't find any
[15:47:03] <Steffann> I think you're getting old
[15:47:07] <Steffann> Bad memory etc.
[15:47:30] <amee2k> i still know where my porn stash is
[15:47:35] <amee2k> so that can't be it
[15:48:15] <Steffann> Mwah, you probably can't miss that big shortcut on you desktop ..
[15:48:27] <amee2k> you wish :P
[15:49:05] <Steffann> Anyway, you can still 'get it up'? :P
[15:49:16] <amee2k> o.O
[15:49:28] <Steffann> Otherwise that stash is useless for you :P
[15:49:29] <amee2k> my manhood is quite intact, but thank you for your concern
[15:49:38] <Steffann> ok ok
[15:49:49] <amee2k> doesn't mean i can't like a little entertainment
[15:54:27] <glguy> I convinced GCC not to lift the function out of the loop (it was looking down into a noinlined function that was wrapping the program read with an asm volatile("")
[15:55:36] <amee2k> you could try disabling optimization, if it still fits into the flash memory
[16:03:27] <amee2k> why is it impossible to switch the clock source from software without screwing with fuses? at least on all the AVRs i've used yet
[16:23:35] <glguy> What is the difference in an output-only and a write-only operand?
[16:23:39] <glguy> in inline assembly
[16:26:21] <jacekowski> there is no such thing as output-only
[16:26:42] <glguy> OK. I was looking at http://www.nongnu.org/avr-libc/user-manual/inline_asm.html
[16:26:56] <glguy> which said "& Register should be used for output only"
[16:27:16] <jacekowski> yes
[16:27:24] <jacekowski> registers should be used only as output operands
[16:27:53] <jacekowski> inline asm is painfull
[16:28:06] <glguy> Can you help me to understand when to use = and & (or both)?
[16:29:23] <jacekowski> read next sentence in there
[16:29:28] <jacekowski> Output operands must be write-only and the C expression result must be an lvalue, which means that the operands must be valid on the left side of assignments. Note, that the compiler will not check if the operands are of reasonable type for the kind of operation used in the assembler instructions.
[16:30:33] <glguy> so "=&" (result) works because result is a local variable (in my case) and thus is a legal value?
[16:30:47] <glguy> and = lets GCC know that it need not initialize result?
[16:31:42] <jacekowski> nah,
[16:32:05] <jacekowski> it's just to make sure gcc replaces register addresses and memory addresses correctly
[16:32:08] <jacekowski> inside asm code
[16:33:03] <glguy> to be specific the code I wrote with I am trying to understand is asm volatile( "lpm %0, Z\n\t" : "=&r" (result) : "z" (address));
[16:33:14] <glguy> I needed the volatile version for previously mentioned reasons
[16:33:36] <glguy> it works, I'm just making sure I know why
[16:35:38] <jacekowski> http://en.wikipedia.org/wiki/Inline_assembler
[16:35:47] <jacekowski> i think that explains it little bit better
[16:38:09] <glguy> "&" : Means that this operand is an earlyclobber operand, which is modified before the instruction is finished using the input operands. Therefore, this operand may not lie in a register that is used as an input operand or as part of any memory address. An input operand can be tied to an earlyclobber operand if its only use as an input occurs before the early result is written.
[16:38:13] <glguy> http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html#ss5.2
[16:38:20] <glguy> as linked from the wikipedia article
[16:38:44] <glguy> that makes a little more sense
[18:34:13] <Tom_itx> abcminiuser do you remember what file has the recovery clock defined?
[18:34:48] <abcminiuser> Tom_itx, as in, to turn it on, or the actual code to generate the clock?
[18:35:24] <Tom_itx> the pin definition
[18:36:24] <abcminiuser> Clock is generated in ISPTarget_ConfigureRescueClock() of Lib/ISP/ISPTarget.c
[18:36:36] <abcminiuser> But it's not a software-definable output, since it uses the hardware timer pins
[18:36:38] <abcminiuser> Can't move those
[18:36:54] <Tom_itx> i didn't mention move
[18:38:00] <Tom_itx> i wanted to verify the pin it was on
[18:38:01] <abcminiuser> Oh :P
[18:39:01] <Tom_itx> it should be PC6
[18:40:44] <abcminiuser> Unless you enable the mode to move it to XCK
[18:41:29] <Tom_itx> right
[18:41:44] <Tom_itx> normally it's continually output PC6 though right?
[18:45:20] <abcminiuser> Yup
[18:45:45] <abcminiuser> For U2 devices
[18:45:54] <abcminiuser> Or B5 for U4, U6 and U7
[18:55:49] <Tom_itx> yeah
[19:03:55] <Tom_itx> i just had some files i had been working on and needed to verify their status
[19:52:54] <inflex> lo folks
[19:53:54] <Tom_itx> hi inflex
[20:06:19] <voodoofish430> Has anyone here used the tinkerlog header boards?
[21:16:25] <inflex> all praise the PRR register
[21:16:39] * inflex deactivated all the items and went from 250uA -> 0.2uA ... huzzah
[21:25:16] <karlp> :)
[21:25:39] <karlp> you have to be pretty low power already, but when you're getting close, it can start to make a big difference
[21:27:35] <inflex> yes, was worried there'd be some protection diode leakages going on
[21:27:55] <inflex> have had that happen before and ruined an otherwise good project... or force you to have to do properly scheduled section shutdowns to avoid latchups
[21:33:37] <karlp> we're not in the 80s anymore.
[21:37:17] <inflex> still can happen :(
[21:37:35] <inflex> (not within the chips, rather as a combination of things)