#avr | Logs for 2012-01-15

Back
[00:50:42] <jadew> hey guys, any idea why I would get different logical values from fast successive readings of the pins, but if I do it slower, it works fine?
[00:50:52] <jadew> must be some electrical thing
[00:51:20] <jadew> I got a 104 cap connected between vcc and gnd
[00:51:47] <jadew> figured it might be because of the distance, so I moved it closer, nothing changed tho
[00:55:16] <ziph> What is connected to the pins?
[00:55:36] <jadew> data out from the LPT port
[00:55:42] <jadew> keept on logical high
[00:56:23] <ziph> Reading them shouldn't do anything, they'd be registered every clock cycle in the AVR.
[00:56:46] <jadew> so what could go wrong?
[00:57:10] <jadew> basically, I get the real value 60% of the time 11111111
[00:57:21] <ziph> And the other times?
[00:57:31] <jadew> but then there are glimpses when I get like 10 times in a row
[00:57:33] <jadew> random stuff
[00:57:35] <jadew> mostly 0
[00:57:50] <ziph> There's no chance you just aren't catching that normally?
[00:58:09] <jadew> no, I just set the port to 0xFF
[00:58:16] <jadew> and I'm pulsating the clock
[00:58:47] <jadew> I get the right number of values tho
[00:58:57] <jadew> this would be one of the errors: 10000000, 10100000, 00000001, 00001000, 00000000
[01:03:36] <Roklobsta> what vio is your avr?
[01:03:49] <jadew> vio?
[01:03:53] <Roklobsta> so your LPT has 0xFF set on it and it's not changing?
[01:04:03] <jadew> yep
[01:04:07] <jadew> not changing
[01:04:13] <Roklobsta> Oh what voltage is your avr running at?
[01:04:16] <jadew> 5v
[01:04:25] <Roklobsta> is the port configured as an input?
[01:04:30] <jadew> yeah
[01:04:50] <Roklobsta> what mode is the lpt in?
[01:04:53] <jadew> hold on, I can't write it atm
[01:04:58] <jadew> EPP or something like that
[01:05:09] <Roklobsta> have you looked with a cro?
[01:05:24] <jadew> what's a cro?
[01:05:44] <Roklobsta> or even a voltmeter to see what;s on the pins? (cro = cathode ray oscilloscope)
[01:06:01] <Roklobsta> though my cro has LCD.
[01:06:29] <jadew> don't have one, but yeah, I've looked with the voltmeter, I get 5v, I have a 1k2 resistor on each pin tho
[01:06:44] <Roklobsta> ah, what's the voltage on either side of the pin?
[01:06:57] <Roklobsta> either side of the resistor?
[01:07:06] <jadew> well, tbh my voltmeter reads out 5v no matter what
[01:07:19] <jadew> even trough the resistor
[01:07:48] <Roklobsta> even though the avr port is set to input have you written 1's or 0's to it to set the pullup?
[01:07:56] <jadew> yep
[01:08:06] <jadew> it has pullups enabled
[01:08:16] <jadew> brb, I think it might be because I have the programmer connected
[01:08:27] <jadew> tried to write it while it was on the board and didn't work
[01:08:32] <jadew> had to disconnect some pins
[01:08:38] <Roklobsta> if both the parallel port anf avr run at 5v you don't need 1k2 or the pullups set.
[01:08:43] <jadew> now I'm gonna disconnect the burner and try again
[01:09:14] <Roklobsta> you only need the resistors if you are going from say 5V out to 3.3V in.
[01:09:22] <Roklobsta> 3.3V can drive 5V without resistors
[01:10:01] <Roklobsta> but definitely set the pullups to 0 as a aparellel port isn't open drain or collector.
[01:10:50] <jadew> gonna try it, thank you
[01:11:24] <Roklobsta> that should set the interface correctly. if you are still having issues then something else is going on.
[01:11:53] <Roklobsta> but it's definitely ok to hook lpt pins direct to avr without resistors at 5V.
[01:12:18] <Roklobsta> and without any pullup/down resistors fitted or the AVR's pullups set.
[01:12:59] <jadew> with pullups disabled, same story
[01:13:10] <Roklobsta> i have vague memories of lpt programming you might need to set those pins as outputs too.
[01:13:28] <Roklobsta> so slow read is OK, fast read is borked.
[01:13:35] <jadew> yeah
[01:13:40] <jadew> but only from time to time
[01:14:08] <Roklobsta> you need a cro to see what's going on, maybe you are getting a glitch but it's impossible to tell without a cro.
[01:14:53] <Roklobsta> does the avr have a good power supply? is the gnd pin on the parallel port connected to a ground on the avr board?
[01:14:57] <jadew> that would mean that the LPT port is generating the glitch?
[01:15:10] <jadew> yes to both
[01:15:15] <jadew> the avr is powered from USB
[01:15:20] <jadew> so that's pretty good, right?
[01:15:22] <Roklobsta> if gnd isn't connected you will get weird crap
[01:15:32] <jadew> it's connected
[01:15:46] * Roklobsta scratches head
[01:15:58] <Roklobsta> sounds like you have the electrics set up OK
[01:16:33] <Roklobsta> meter out the ground. i have been fscked by dodgy soldering before.
[01:16:43] <jadew> just tried disconnecting the gnd (to see if anything changes) and it stopped transferring data, so it means it's working
[01:17:20] <Roklobsta> how fast is slow and how fast is fast?
[01:17:33] <jadew> slow is like 1k/s
[01:17:42] <jadew> that's 1k reads / s
[01:17:51] <jadew> and fast is about 50 - 56k
[01:18:06] <Roklobsta> so do you have an oscilloscope?
[01:18:10] <jadew> no
[01:18:13] <jadew> whish I did
[01:18:15] <Roklobsta> that would help rule out any werid crap
[01:18:21] <jadew> I suppose that one from sparkfun would help
[01:18:30] <Roklobsta> no, get a $399 rigol
[01:18:50] <Roklobsta> or similar
[01:19:10] <jadew> I really need one, isn't it?
[01:19:26] <jadew> was hoping to get by with out the expense
[01:19:30] <Roklobsta> well, no, I am an EE I just cant' get my head around doing any sort of electronics without a CRO.
[01:19:51] <Roklobsta> even avr.
[01:20:19] <Roklobsta> yeah, well, $399 is damned cheap for a 50MHz cro you can hack to 100Mhz.
[01:20:31] <Roklobsta> i'm just sayin'.
[01:21:02] <Roklobsta> anyway, i think you have the electrics ok so I don't know about the issue you have with read speed.
[01:21:11] <jadew> yeah, I would totally get one, but I hate having a lot of crap with me when moving (not that I don't have already)
[01:21:25] <Roklobsta> rigol cro is small....
[01:21:38] <Roklobsta> it's not like some old analogue tektronics beast.
[01:21:45] <jadew> http://www.tekequip.com/digital-oscilloscope/rigol-ds1052e.html
[01:21:51] <jadew> is this what you're recommending?
[01:21:58] <Roklobsta> yeah i got one
[01:22:00] <Roklobsta> recently
[01:22:13] <Roklobsta> helped me sort out some I2C BS I was having on the AVR
[01:22:33] <jadew> I bet it's great
[01:22:52] <jadew> not very expensive either
[01:22:56] <Roklobsta> go on splash the cash
[01:23:04] <jadew> heh
[01:23:08] <Roklobsta> beleive me - it's cheap
[01:23:27] <Roklobsta> you need a cro just to see what's going on 1/2 the time.
[01:23:56] <Roklobsta> many times in my career having a cro has shed light on crazy problems.
[01:24:10] <Roklobsta> even just to rule stuff out.
[01:24:29] <jadew> gonna have to do it behind my g/f's back :P
[01:24:35] <Roklobsta> ew
[01:24:38] <jadew> but sounds like a plan
[01:24:56] <Roklobsta> my missus didn't care. tool of my trade....
[01:25:19] <jadew> yeah, I'm a programmer, she doesn't care about PC parts / software either
[01:25:55] <Roklobsta> it has usb port so you can capture data with it which is nice
[01:25:55] <jadew> anyway, I'm gonnna get one, my birthday is comming soon
[01:27:04] <Roklobsta> do it!
[01:27:35] <jadew> wanted one for a while, gonna order it today
[01:27:46] <jadew> however, till it arrives, I still have to debug this
[01:27:57] <jadew> I guess I can rule LPT out by connecting the pins to the ground
[01:28:33] <jadew> if I get 1 all the time, it means the problem is not with the AVR
[01:29:20] <jadew> well, 0
[01:29:34] <jadew> ok, the problem is with the AVR
[01:29:58] <jadew> I connected one of the pins to the ground, getting 0 most of the time and when it screwes up, I get an occasional 1
[01:37:11] <jadew> would I be able to tell with the osciloscope if the AVR is running out of current?
[01:38:23] <jadew> I suppose I would
[01:39:20] <ziph> Can you paste the lines you use to set the ports up?
[01:39:24] <jadew> sure
[01:39:32] <jadew> I can paste the whole code if you wish
[01:40:03] <ziph> Do it in a pastebin
[01:41:10] <jadew> http://pastebin.com/Kz6NQ7KM
[01:41:15] <jadew> main() starts at 62
[01:41:30] <jadew> pin setup at 82
[01:42:09] <jadew> sorry about the tabbing, it doesn't look that screwed up in my editor
[01:43:40] <ziph> Tried it with another AVR?
[01:43:46] <ziph> You might've killed this one. :)
[01:43:55] <jadew> hmm, good idea
[01:44:13] <ziph> Your code looks fine though.
[01:44:28] <ziph> And if you've shorted a pin to ground and got a 1 back then something very wrong is happening.
[01:44:53] <jadew> yeah, it's strange
[01:45:13] <jadew> at first I thought it's because the .1uF cap was too far
[01:45:22] <ziph> Another thing to try would be to just set up that port and poll it (e.g. reduce it to the smallest amount of code possible) to make sure it isn't something else messing up.
[01:45:53] <ziph> A bad interrupt service routine for instance could be messing things up.
[01:46:01] <jadew> thought about that, but there isn't much I can do to shorten it
[01:46:05] <ziph> Or if you're running the stack into the globals.
[01:46:08] <jadew> if I poll it only once
[01:46:13] <jadew> I'd get very slow data
[01:46:15] <jadew> and it would work
[01:46:20] <jadew> I pretty much need that buffer
[01:46:32] <jadew> so I really need the entire code
[01:47:25] <ziph> No, I mean as in main() { DDRB = 0; while (true) { uint8_t value = PINB; if (value != expectd) { do something that you can see }
[01:47:46] <jadew> ah
[01:47:50] <jadew> yeah, that could work
[01:48:54] <jadew> let's see
[02:09:51] <jadew> looks ok
[02:31:21] <ziph> jadew: That works?
[02:31:34] <jadew> can read them just fine
[02:31:38] <jadew> I noticed something strange tho
[02:31:55] <jadew> while I removing the aligators, it sort of synced
[02:32:04] <jadew> and it started working fine
[02:32:17] <ziph> From what?
[02:32:23] <jadew> from the pins
[02:32:39] <jadew> well, basically from the resistors, cuz the resistors are connected to the pins
[02:33:43] <ziph> What USB stack is that?
[02:33:55] <jadew> not a stack, it's V-USB
[02:34:15] <jadew> I don't have hardware USB on this device
[02:35:28] <ziph> It looks to me though that the only difference between your bare pin polling code and the pastebin one is the USB side of it.
[02:37:09] <jadew> pretty strange eh?
[02:37:25] <jadew> I don't get it why it would work fine at a slower speed tho
[02:37:33] <ziph> Not really, V-USB is probably stomping on something in an interrupt. :)
[02:38:01] <ziph> Are you sure your dataBuffer isn't getting killed by the stack? Maybe V-USB is eating enough stack to corrupt it.
[02:38:27] <jadew> didn't consider that
[02:39:08] <jadew> how would that be even possible with out an overflow in v-usb?
[02:39:17] <ziph> It doesn't need an overflow.
[02:40:05] <ziph> Set the last 4 bytes of dataBuffer to 0xDE 0xAD 0xBE 0xEF or something and change the condition to dataCount < (sizeof(dataBuffer) - 4)
[02:40:24] <ziph> Then make sure those bytes stay the same.
[02:41:00] <jadew> you think the compiler is doing some crazy stuff with the stack?
[02:41:28] <ziph> The compiler doesn't control the stack, it just puts at at the end of available memory and hopes it doesn't get big enough to hit the globals.
[02:43:55] <jadew> you were right, that's what's going on
[02:44:33] <jadew> changed the buffer to 40 and it works fine
[02:44:49] <jadew> I thought the stack gets to be whatever is left
[02:46:33] <jadew> looks good with a buffer of 50
[02:48:27] <jadew> thanks a lot for all your help
[02:48:34] <jadew> to both of you
[02:52:57] <ziph> jadew: One issue you'll have with so little headroom is that even trivial changes might have you hitting it again.
[02:53:06] <ziph> abcminiuser: Cold?
[02:53:15] <abcminiuser> ziph, nei
[02:53:20] <faris448> I want my microcontroller to read a text file from an SD card and display it onto the LCD how can i do it????
[02:53:28] <abcminiuser> Norwegians like to set their indoor thermostat to a BILLION DEGREES
[02:53:32] <ziph> abcminiuser: Having a girlfriend to keep you warm is better this time? :)
[02:53:33] <abcminiuser> Which is damned odd
[02:53:39] <abcminiuser> Hehe, that too
[02:54:22] <ziph> abcminiuser: I guess it's like those monkeys that sit in a hot spring for 4 hours and then wander around the snow, steaming.
[02:54:37] <abcminiuser> Yeah, a bit like that
[02:54:54] <ziph> jadew: By the way, LUFA with an USB AVR probably uses a lot less stack. :)
[02:55:13] <jadew> yeah, but I don't have one
[02:55:28] <jadew> only t2313 and 13, 45 and 85 in my possesion
[02:55:36] <ziph> jadew: Yeap.
[02:55:51] <ziph> jadew: I have no idea how V-USB works, but I'd also guess that it allocates some fairly big buffers.
[02:56:13] <ziph> jadew: You might be able to configure it to allocate smaller buffers, perhaps with a tradeoff that the maximum USB packet size is smaller.
[02:56:24] <jadew> well, giving the fact that I can only use 50 + a few more bytes
[02:56:40] <jadew> let's say 60 total, it must be using at least 68
[02:57:05] <ziph> Oh, could be hard to go below that little. :)
[02:57:07] <jadew> yeah
[02:57:11] <ziph> Anyhow, it might be worth looking into too.
[02:57:27] <ziph> jadew: You might want to try flow control on the parallel port.
[02:57:47] <ziph> jadew: Have a pin that tells the PC when your buffer is 80% or more full for instance.
[02:58:29] <jadew> why 80%?
[02:59:00] <jadew> I use ACK for that, when the buffer it's full, I stop getting data from the paralel port
[02:59:09] <ziph> Oh, if you're acking everything then you won't need it.
[02:59:14] <jadew> yeah
[02:59:30] <ziph> Ah, I see that bit now.
[03:00:11] <jadew> would have worked a lot faster with a clock from the LPT
[03:00:16] <jadew> and an interrupt on the clock pin
[03:00:29] <jadew> but that didn't work well, since V-USB is using an interrupt too
[03:00:36] <jadew> so I was losing a lot of data
[03:01:02] <ziph> Yeah, having a controller on the IC fixes that kind of issue too.
[03:01:31] <ziph> If you like using USB you should pick up a few USB AVR's next time you're shopping, they're much nicer. ;)
[03:02:00] <jadew> yeah, I'll get some next time
[03:31:10] <OndraSter> can Dragon program those AVR USB? I somewhat missed that :)
[03:36:13] <OndraSter> btw, nasty bug with AVR Studio 5 (not sure how about 4)
[03:36:20] <OndraSter> IF there is NO code beginning at offset
[03:36:23] <OndraSter> 0
[03:36:32] <OndraSter> it will fail to launch through simulator/JTAG debugger
[03:36:44] <killit2> hello everyone... problem reading the current state of an output pin in C via if/then.. I have if (volt_avg > 12.3 & (PORTC & (1<<PC3))) {
[03:36:45] <OndraSter> with absolutely unrelated error
[03:37:08] <killit2> can anyone tell me where I am going wrong?
[03:41:55] <_abc_> Hello. Is there a pertinent discussion wrt. footprint of formatting (sprintf) functions in avr-libc?
[03:41:59] <OndraSter> how does the problem look like?
[03:42:03] <_abc_> I tried to Google but it is a jungle.
[03:53:08] <_abc_> This is the only half decent explanation I could find http://stackoverflow.com/questions/905928/using-floats-with-sprintf-in-embedded-c
[03:59:48] <ziph> killit2: You're using bitwise & instead of && in that expression.
[04:00:57] <killit2> ziph: (volt_avg < 12.2 && (PORTC & (1<<PC3))) still no work :(
[04:01:03] <killit2> fg
[04:01:12] <killit2> ehhh... wrong window :)
[04:01:49] <ziph> What's the error?
[04:03:08] <killit2> it compiles just fine.. just does not do what I expect..
[04:04:57] <grummund_> and what do you expect it to do?
[04:06:42] <killit2> I think Im going to divide and tackle this one.. first I need to figure out if I am reading from PortC correctly...
[04:06:59] <killit2> thanks for the logical / prog catch ziph
[04:14:07] <_peteris__> Hello! I was trying to program atmega16 using stk500v2 programmer, with avrdude, and this is what i got for answer "avrdude: stk500v2_command(): command failed" . is this because chip is bad or because programmer is defective?
[04:16:09] <_peteris__> ok, my question was, is that "avrdude: stk500v2_command(): command failed" caused by chip failure or programmer failure?
[04:17:36] <_abc_> 11:52 < killit2> ziph: (volt_avg < 12.2 && (PORTC & (1<<PC3))) still no work :( -> SOLUTION (ORDERS!!): ((volt_avg < 12.2) && (PORTC & (1<<PC3)))
[04:17:52] <_abc_> killit2: but you really want (PINC & (1<<PC3)) likely
[04:18:11] <_abc_> killit2: sorry, I meant
[04:18:27] <_abc_> MARINE, USE (PINC & (1<<PC3)) LIKELY
[04:18:30] <_abc_> :)
[04:24:10] <killit2> _abc_ Its an output pin.. not in input... Im not trying to read in input value - just see what the register holds for its current output value.... unless we are indeed on the same page here :)
[04:24:25] <_abc_> hehe
[04:24:30] <_abc_> okay then PORTC
[04:25:24] <killit2> I found a diffrent was of doing my solution anyways... but thanks!
[04:25:35] <killit2> fg
[04:25:51] <killit2> EHHHH!!!! keep thinking Im on my terminal window and instead Im in here still... :)
[04:28:22] <_abc_> lol
[04:28:34] <amee2k> hehe
[04:28:44] <_abc_> killit2: you are using fp in embedded. That is probably not such a good idea.
[04:28:45] <amee2k> thats called "wrong window oops" :)
[04:29:01] <_abc_> killit2: you can use fixed point or something else
[04:31:24] <_abc_> Hm the channel gurus are out, I'll try later
[04:48:49] <OndraSter> hwo to build nuclear bomb:
[04:48:55] <OndraSter> http://clip2net.com/s/1ufTa
[04:54:09] <dunz0r> OndraSter: Not really.
[04:54:17] <OndraSter> :(
[05:00:44] <dunz0r> OndraSter: It tells me service is unavaliable
[05:01:00] <OndraSter> refresh, clip2net is borked
[05:02:42] <OndraSter> http://img.ondraster.cz/all_brd.png
[05:02:43] <OndraSter> better
[05:05:48] <OndraSter> how do I move some unconnected net?
[05:05:58] <OndraSter> it wants me to build it from the pin's middle
[05:06:03] <OndraSter> but I want it draw from absolutely somewhere else
[05:06:35] <amee2k> < OndraSter> hwo to build nuclear bomb: << i don't think i'd need an internetz for that. we already learned it in school :P
[05:06:40] <OndraSter> :))
[05:07:18] <amee2k> i picked physics and math for my abitur (german a-level equivalent)
[05:07:42] <OndraSter> <OndraSter> how do I move some unconnected net?
[05:07:43] <OndraSter> <OndraSter> it wants me to build it from the pin's middle
[05:07:43] <OndraSter> <OndraSter> but I want it draw from absolutely somewhere else
[05:09:21] <OndraSter> oh I found cool way
[05:19:04] <Roklobsta> jadew: so you're still gonna get that Rigol? :)
[05:19:21] <jadew> yeah, I'm searching for it right now
[05:19:26] <jadew> found other alternatives too
[05:19:33] <jadew> same price range
[05:19:38] <jadew> but I'm not sure about the quality
[05:19:49] <jadew> read some good reviews about the rigol one tho
[05:20:00] <Roklobsta> there are others. i wish i spent another $200 and got a hantek with 800x600 screen and stuff like i2c and spi analyser
[05:20:16] <amee2k> you could get the rigol variant with the logic analyser module
[05:20:45] <amee2k> last time i checked that one costs now what i paid for mine without three years ago >:>
[05:20:45] <Roklobsta> but the rigol is fine. i am very happy with it for the money, especially the free 100MHz upgrade when I get around to it.
[05:21:05] <OndraSter> yap, the rigol is great
[05:21:16] <jadew> I wouldn't need 100Mhz anytime soon
[05:21:23] <jadew> at least I don't think I would
[05:21:33] <OndraSter> but why not put it there if it is available? :P
[05:21:34] <OndraSter> for free!
[05:21:38] <amee2k> but back then the LA module was like 600EUR on top so i said screw it
[05:21:58] <amee2k> i rarely if ever work on parallel busses so only having 2 channels isn't much of a limitation
[05:22:14] <Roklobsta> get a cheapie fpga or cypress usb chip based one
[05:22:28] <amee2k> jadew: if you fed 100MHz into a 100MHz rated DSO you wouldn't see much anyway
[05:23:11] <amee2k> the scope is 1GS/s, which you're supposed to read as "500MS/s per channel, times two channels"
[05:23:13] <Roklobsta> no 2 channles is fine. i saw a nice python script for controlling a rigol the other day over usb so it wouldn't be hard to make an spi or i2c analyser once you got a waveform out.
[05:23:38] <amee2k> that means at 100MHz you get 5 points per cycle and the stretch inbetween is interpolated
[05:23:48] <ziph> Doesn't it do 1GS/s when you've got a single channel on?
[05:24:05] <amee2k> not from what i've seen
[05:24:26] <Roklobsta> apparently the rigol uses overclocked Analgo ADcs
[05:24:32] <OndraSter> overclocked o_O O_o
[05:24:33] <OndraSter> cool D:
[05:24:35] <OndraSter> :D
[05:24:44] <amee2k> equivalent time sampling is 25GS/s sure but that only helps if your waveform is repeating very precisely, otherwise the trace gets all fuzy and you see nothing
[05:24:51] <Roklobsta> but it works and for $399 i ain;t complainging
[05:25:10] <amee2k> overclocking isn't much of a problem. you want a scope because you need fast measurements
[05:25:17] <Roklobsta> the rigol is plenty plenty fast enough for avr work
[05:25:19] <OndraSter> yap
[05:25:26] <amee2k> not a precision reading
[05:25:32] <OndraSter> if it is 10bit ADC and you are fine with 8bit, you can push it
[05:26:12] <amee2k> Roklobsta: not saying it isn't worth the money. my buying one when it was still twice the price as today says quite the opposite i think
[05:26:40] <amee2k> just saying that it has its weaknesses too that you should consider in time
[05:29:34] <amee2k> when i worked on that random number generator project last summer i tried overclocking an avr adc to 1MHz and it still worked
[05:30:01] <OndraSter> wow
[05:30:11] <amee2k> the distribution got a bit screwed if i went faster than 300-400 kHz or so
[05:30:54] <amee2k> hard to tell if the input is noise anyway but i'd say i still got some 5 bits from it
[05:42:40] <theBear> interesting
[05:46:39] <amee2k> mmh?
[05:49:14] <jadew> Roklobsta, just to be clear, we're talking about this one, right? http://www.tekequip.com/rigol-ds1052e.html
[05:49:18] <jadew> hey theBear
[05:49:29] <OndraSter> yes
[05:49:49] <jadew> well, if they can ship trough anything else other than regular post, I'll get it
[05:50:21] <jadew> couldn't find in my preffered shops
[05:52:42] <theBear> hi jade
[05:54:28] <jadew> pff, they say they would ship to romania but when I try to check out it says there are no postage methods available
[06:22:58] <jadew> I ordered one of those
[06:23:09] <jadew> found a dealer in my country
[07:16:10] <Roklobsta> jadew: yes that's it. where are you anyway?
[07:45:06] <jadew> Roklobsta, romania
[14:22:14] <nofxx> avr-gcc is on topic here?
[14:22:43] <Steffanx> Most of the time it is ontopic here nofxx
[14:25:09] <nofxx> Trying to set a makefile to avoid the arduino ide, but I would like some libs from it....but can't manage to link another library outside cores... http://pastebin.com/MBC7g5Ts
[14:25:50] <nofxx> My code is only C and don't need arduino code , but this GPRS modem is a bit** to test, so I wrote a simple test code that uses SoftwareSerial
[14:31:18] <_peteris__> hello! is there anyone familiar with that "avrdude: stk500v2_command(): command failed" problem. avrstudio cannot set in programming mode, avrdude also fails
[14:33:52] <_peteris__> can someone troubleshoot me please?
[14:36:22] <_peteris__> seems that avrdude can talk to programmer, get hardware&firmware version, programmer model & type, but when it comes to "avrdude: Send: . [1b] . [06] . [00] . [0c] . [0e] . [10] . [c8] d [64] . [19] [20] . [00] S [53] . [03] . [ac] S [53] . [00] . [00] 5 [35] ", then it fails
[14:37:42] <jadew> nofxx, you need to specify the path to the library and the library to link to, or just the direct link to the library with -l
[14:38:10] <jadew> from the command line, it doesn't look like you're doing that
[14:39:11] <jadew> you should have something like softwareserial.a somewhere in there (not familiar with arduino or their namings)
[15:17:55] <mitsakos> hello i have a general question. If i design and build an electronic circuit can i produce it and sell it without having a company?
[15:29:23] <rue_house> depends where you want to sell it
[15:29:37] <rue_house> many companies require certifications to electronic goods sold
[15:29:43] <rue_house> also depends what it is
[15:30:12] <rue_house> :( I cant program the 89C55 I have over serial
[15:43:10] <Roklobsta> misakos: maybe as a hobby kit but commercial, in the first world, no.
[15:44:22] <OndraSter> DAMNIT how do you write > on german keyboard?
[15:44:28] <Roklobsta> whups. i meant to sell it commercially without approvals like CE/FCC.
[15:45:08] <Roklobsta> but as an individual you can sell it under any legal business structure you like.
[16:00:26] <_peteris__> how easy it is to fry a programmer?
[16:00:49] <karlp> depends on the programmer :)
[16:01:18] <Kevin`> _peteris__: depends on the programmer. a lot of the simpler ones wouldn't like 12v or -something being connected to their io
[16:05:22] <_peteris__> can wrong ISP cable wiring fry programmer? no external current source
[16:09:45] <Kevin`> that's unlikely for most devices, the most you could do is short the outputs together, which is normally not fatal
[16:09:56] <Kevin`> feel free to look at the schematic
[16:13:52] <rue_house> applying power backwards will fry it tho
[16:14:18] <OndraSter> it will fry the IC
[16:14:19] <Kevin`> that would require a power source
[16:14:32] <OndraSter> Kevin`, withotu external PSU he needs power from the programmer anyway
[16:15:13] <Kevin`> shorting the power output of the programmer shouldn't cause damage.. probably won't, even on the simple ones, more likely to damage an out of spec usb port or a fuse
[16:24:51] <ben1066> How can I best get a clean ground for analogue stuff
[16:29:40] <Roklobsta> ben1066: keep your power current loops small and use a big fat ground plane and try to use star topology power distribution.
[16:30:04] <Roklobsta> ferrite beads can be helpful too.
[16:30:28] <Roklobsta> what analogue things are you trying to do? ADC stuff?
[16:31:59] <Roklobsta> ben1066: and maybe use a linear power supply.
[16:37:22] <ben1066> I already am
[16:37:30] <ben1066> 2 in fact, one for my digital stuff, one for analogue
[16:42:32] <karlp> bleh, sparkfun wants to charge me 33.97 for shipping on a 100.40 order.
[16:42:40] <karlp> so much for free day
[16:43:09] <karlp> if it goes under 100, it's only 11.60
[16:44:25] <karlp> I'd forgotten how much of a pain this was.
[16:49:37] <Steffanx> :P
[16:49:47] <Steffanx> Don't forget the hobby tax karlp
[16:53:09] <karlp> I had forgotten that the tax was on shipping as well as the parts themselves.
[17:03:07] <karlp> well, some of the parts I can get elsewhere, piggy backed on work order, but not all of it.
[17:04:59] <karlp> more curious whether customs here will try and charge me tax on the $100 + shipping, or only the shipping.
[17:05:53] <Steffanx> Probably both
[17:05:59] <Steffanx> As you paid for both
[17:06:57] <Steffanx> At least FedEx only charged me 9$ a while ago :)
[17:07:43] <karlp> no, free day remember :)
[17:07:48] <karlp> I won
[17:07:56] <karlp> this is pure toys
[17:08:03] <Steffanx> You still paid for it, with a gift card-ish thing
[17:08:23] <karlp> perhaps, but did I pay for it in a way that should attract vat?
[17:08:58] <Steffanx> I had to pay for it .. back in 2010
[17:09:08] <Steffanx> FedEx charged me 9$ :)
[17:09:38] <Steffanx> They used the economical invoice… which has lower prices
[17:09:48] <karlp> eh, even if they do, still a decent enough deal.
[17:10:13] <Steffanx> It still sucks you have to pay taxes over the shipping too
[17:10:54] <karlp> well, I removed an rfid tag, so i'm only ordering 99.40,
[17:11:08] <mrfrenzy> karlp: even if it's completely free, you need to pay vat and toll on the estimated product value+shipping cost
[17:11:10] <karlp> and shipping is now allowed to be regular usps, down from 34 to 9.
[17:11:28] <karlp> mrfrenzy: that really would be a national law,
[17:11:50] <mrfrenzy> well it's about the sam in most of eu
[17:11:56] <karlp> I'm not in the EU
[17:12:03] <karlp> I'm just in europe :)
[17:13:31] <mrfrenzy> regardless, I would be very surprised to see a country that doesn't have this, as it then would be very easy to cheat customs
[17:19:46] <grummund> yep they add tax on shipping
[17:20:02] <grummund> and often a handling fee for collecting the tax
[17:20:08] <grummund> and tax on the handling fee
[17:20:42] <grummund> much cheaper to pay the tax up front, like with Mouser.
[17:20:45] <OndraSter> what about tax on tax
[17:20:48] <OndraSter> something quite common here
[17:22:26] <Steffanx> At least it's not common here
[17:24:27] <grummund> sure Steffanx ?
[17:24:27] <grummund> :P
[17:24:41] <Steffanx> Yes
[17:24:49] <grummund> fuel has tax on tax here
[17:25:21] <Steffanx> Nah, i mean when order things from countries far far away
[17:25:31] <Steffanx> Fuel is a little expensive here..
[17:26:43] <grummund> yep i see Netherlands have tax on fuel tax too.
[17:29:35] <rue_house> our government has started creating 'service fees' which can also be taxed
[18:28:37] <nofxx> jadew, sorry , had to leave, thanks for the avr-gcc help, trying it here
[18:36:20] <jadew> heh, np, I actually had a nap since then
[19:46:13] <inflex> lo folks
[21:41:06] <rue_house> anyone interested in a library to do parallel io with intel perphial chips?
[22:02:16] <rue_house> nobody?
[22:15:07] <ziph> Intel peripheral chips?
[22:20:03] <rue_house> 8255 or anything that operates on an 8 bit parallel bus
[22:37:39] <rue_house> huh, if I made a ihex library, I could make a program that allowed you to write bios eeprom chips via serial upload to an avr
[22:43:40] <rue_house> has anyone ever even heard of automatic baud rate detection for avrs?
[22:43:53] <rue_house> I already wrote an ihex library...
[22:44:58] <theBear> yeah, years ago, i think we were discussing it
[22:45:06] <theBear> also i think there's an appnote
[22:45:16] <inflex> You know things are getting a bit tight when you become excited about finding a bag of old assemblies containing a part you can reclaim
[22:45:20] <inflex> (that is only 50c)
[22:45:56] * inflex was about 20 units short on the buzzers he uses... and lo behold, found a bag of 25 old assemblies that have been returned from customers....
[22:50:20] <rue_house> hhe
[22:50:47] <rue_house> 'customer complains that buzzer on new device looks like it was removed from older, defective product'
[22:50:53] <rue_house> :)
[22:51:40] <rue_house> hmm this ihex library is not suitable for a microcontroller
[22:52:32] <rue_house> however, I might be abel to root what I need out from under it
[22:53:08] <ziph> inflex: I'm disappointed, don't you restock when you get below 10,000 buzzers? :)
[22:54:06] <rue_house> #define NibToBin(A) (((A)>'9')?((A)-'7'):((A)-'0')) <- its really ascii to nibble I usppse
[22:55:13] <rue_house> / convert X,Y to integer offset, I is XMAX J is YMAX
[22:55:13] <rue_house> #define xy2i(X,Y,I,J) (((I)*(Y))+(X))
[22:55:23] <rue_house> ^^ anyone want to come up with a reverse of that fn for me?
[22:55:38] <ziph> Which one?
[22:55:47] <rue_house> #define i2xy(X,Y,I,J)
[22:56:20] <ziph> What's J? There's no inverse for a non 1-1 function.
[22:56:26] <rue_house> wait... hmm
[22:56:34] <rue_house> convert X,Y to integer offset, I is XMAX J is YMAX
[22:56:34] <rue_house> #define xy2i(X,Y,I,J) (((I)*(Y))+(X))
[22:56:46] <rue_house> irc killed the // comment, sorry :)
[22:57:16] <ziph> There's no inverse for that either.
[22:57:33] <ziph> (Ignoring J)
[22:57:36] <rue_house> maybe if the results of the define is two comma seperated values
[22:57:44] <rue_house> it can be done
[22:57:54] <ziph> Oh, you have xy2i and xy2j?
[22:58:14] <ziph> Paste both and there might be an inverse.
[22:58:39] <rue_house> #define i2xy(I,J) (---),(---)
[22:58:56] <rue_house> xy2i is the forward
[22:59:12] <rue_house> the revrse would be i2xy
[22:59:30] <rue_house> where I and J are the max of the grid
[22:59:31] <ziph> You can't in general invert a linear function that takes two inputs and only gives you one output.
[22:59:43] <ziph> Where's xy2j?
[23:00:05] <rue_house> i is the returned value in xy2i
[23:00:11] <rue_house> i != I
[23:00:23] <rue_house> convert X,Y to integer offset, I is XMAX J is YMAX
[23:00:23] <rue_house> #define xy2i(X,Y,I,J) (((I)*(Y))+(X))
[23:00:27] <rue_house> so
[23:00:58] <rue_house> convert offset I to X,Y using I is XMAX and J is YMAX
[23:01:11] <rue_house> #define i2xy(I,J) (---),(---)
[23:02:03] <inflex> ziph: would be nice if I could always have restocked below ~500 buzzers
[23:02:12] <inflex> ziph: of course, I've got thousands of the -wrong- sort of buzzers :(
[23:02:21] <ziph> inflex: Yeah, this game sucks like that. :)
[23:02:40] <inflex> ziph: should eBay them or something, in 100 unit lots
[23:02:44] <ziph> inflex: I have a friend with about $100,000 of electronics stock and barely a pot to piss in. :)
[23:03:04] <rue_house> sell them to hobby sotres around the world for little more than what you paid for them
[23:03:06] <ziph> rue_house: So I and J are constants.
[23:03:19] <ziph> rue_house: That still means you've got x and y coming out to i
[23:03:19] <rue_house> all of them are
[23:03:28] <rue_house> oops again
[23:03:33] <rue_house> see I'm working on somnething else
[23:03:40] <rue_house> #define i2xy(i,I,J) (---),(---)
[23:04:44] <ziph> The answer is #define i2xy(i, I, J) i-I * y, (i-x)/I
[23:04:59] <rue_house> (((()())))
[23:05:33] <ziph> Which is my sarcastic way of saying that you've got a non-invertable function. :)
[23:05:46] <rue_house> (((i)-(I)*(y)),(((i)-(x))/(I)))
[23:06:10] <rue_house> which one is your modulus?
[23:06:24] <ziph> rue_house: Let me put it another way.
[23:06:44] <ziph> z = f(x, y) = 2 * x + y
[23:06:57] <ziph> If I tell you z is 3, can you tell me what x and y are?
[23:07:21] <rue_house> if I know the limits ont he field, yes
[23:07:37] <ziph> Assuming the field is all reals.
[23:07:50] <rue_house> in thiscase its all integets
[23:08:09] <ziph> So what's the answer?
[23:09:48] <rue_house> #define BinToASCNib(B) (B<9?B+'0':B+'7')
[23:09:53] <ziph> (And by the way, most of linear algebra works for any field)
[23:09:59] <rue_house> if I were working on it I wouldn't be asking for help
[23:10:29] <ziph> Hmm? :)
[23:10:50] <rue_house> I think that converts 0-F to its ascii character
[23:11:38] <rue_house> #define BinToASCNib(B) (((B)&0x0F)<9?((B)&0x0F)+'0':((B)&0x0F)+'7')
[23:11:42] <rue_house> that would be the safe version
[23:11:54] <rue_house> / ascii nibble to binary
[23:11:55] <rue_house> #define ASCNibToBin(A) (((A)>'9')?((A)-'7'):((A)-'0'))
[23:11:55] <rue_house> / low binary nibble to ascii
[23:11:55] <rue_house> #define BinToASCNib(B) (((B)&0x0F)<9?((B)&0x0F)+'0':((B)&0x0F)+'7')
[23:12:32] <rue_house> I kinda learned that from an apple IIe rom
[23:12:54] <ziph> Those would be nicer in a static inline function. :)
[23:13:26] <rue_house> its a macro, it is inline
[23:14:06] <rue_house> my library is getting quite a collection
[23:14:38] <rue_house> things that its stupid aren't standard
[23:15:17] <rue_house> http://ideone.com/q94X7
[23:17:12] * rue_house whispers
[23:17:33] <rue_house> I'm playing with 8051 stuff, and its just so amazing primitive not to have proper libraries to do stuff
[23:17:53] <ziph> A-'A'+10 will compile to exactly the same code as A-'7' and is far less cryptic.
[23:40:09] <rue_house> Cryp+1C m4ke5 m3 l00k l33+
[23:42:55] <ziph> Chicks dig readable well thought out code, though.
[23:43:10] <rue_house> show me one chick that digs any code
[23:43:12] <rue_house> PLS
[23:43:43] <rue_house> preferably one in western canada
[23:44:58] <ziph> I went out with one for a while.
[23:45:24] <rue_house> in north america?
[23:45:32] <ziph> In Australia.
[23:45:55] <rue_house> AAHA! I CALL DIBBS ON THE ONE IN NORTH AMERICA!
[23:46:20] <rue_house> there are prolly 10 chicks like that in aus
[23:46:21] <ziph> Why?
[23:46:27] <ziph> We never talked about computers.
[23:46:37] <rue_house> OOOOoooo...
[23:47:27] <ziph> As long as the girl is interested and passionate about something, it doesn't really matter what it is. :)
[23:47:41] <rue_house> at SOME point I was trying to reduce an ihex library to run on an avr
[23:48:14] <ziph> You need a library for that?
[23:53:17] <rue_house> ah, you dont understand the benifits of having a library foundation?
[23:53:30] <rue_house> thats the only difference between the 8041 and the arduino
[23:53:49] <rue_house> just libraries
[23:54:20] <ziph> I've only been doing it professionally for about 20 years, so I guess not. ;)
[23:54:52] <rue_house> and how many times do you do it over and over cuase there is no library to just include?
[23:55:08] <rue_house> always searching thru old projects for code to copy and paste in
[23:55:39] <rue_house> ' I did a really good debounced matrix keyboard implementation in.... that program...'
[23:55:59] <rue_house> ' oh what was it called...'
[23:56:06] <rue_house> ' where is that source file....'
[23:56:18] <ziph> I was talking specifically about trying to port some presumably huge ihex library to work on a microcontroller instead of just targeting something specifically to the microcontroller.
[23:56:27] <rue_house> I'm not trying to harp on the way you might do things, its just not how I do them
[23:56:43] <rue_house> no, its an ihex library I wrote, its not that bad
[23:56:52] <rue_house> its much much better than the one I didn't use