#avr | Logs for 2015-01-22

Back
[01:54:23] <DO9XE> Hey ho :) can someone tell me how i can force my avr to write the fuses? i got a 8mhz crystal, clock divide is still active, the hex is compiled for 8MHz, this is the avrdude code i use:
[01:54:25] <DO9XE> avrdude -p at90usb1287 -P usb -c avrispmkii -U lfuse:w:0xff:m -U hfuse:w:0x99:m -U efuse:w:0xff:m -v
[01:54:56] <DO9XE> this was the verbose output: avrdude: safemode: Wrote lfuse to ff, read as 5e. 9 attempts left
[03:56:47] <aep> so does the avr dragon not work with atmelstudio 6 at all? can't see it in the Tool select box
[03:57:29] <STS_Patrik> works for me
[03:57:49] <aep> STS_Patrik: do you use the drivers that come with the studio installer?
[03:58:10] <STS_Patrik> however the standard windows way of handling USB causes issues from time to time
[03:58:49] <STS_Patrik> can't remember which driver
[04:00:07] <aep> yeah couldnt get a jtagice3 working, but the dragon seems to be regonized by windows at least
[04:00:57] <STS_Patrik> sometimes AS6 won't find the dragon if i plug it in after it was launched. Restarting AS6 usually solves the issue
[04:01:39] <aep> good hint, let me redo that a couple more times
[04:04:11] <STS_Patrik> i have an SPI issue. I'm interfacing a ADC-chip and I'm making 4 different channel readings in a row, however the first reading only works the very first time, and then it returns 0
[04:05:02] <STS_Patrik> temporary fix is reading the first channel twice, discarding the first sample but i can't find the source of the problem
[04:05:21] <STS_Patrik> every now and then a proper reading does go through first time
[04:17:24] <STS_Patrik> is the SPI clock always running when SPI enabled?
[04:17:50] <LeoNerd> No
[04:18:43] <STS_Patrik> writing 0x00 to data register and then waiting for TXOK before initiating the real traffic made it work
[04:19:45] <STS_Patrik> and ADC-IC is waiting for start bit so i believe its idling during that first byte
[04:23:59] <jacekowski> STS_Patrik: having logic analyser would seriously help here
[04:24:33] <jacekowski> STS_Patrik: but double check that you are waiting correct amount of time for sampling to finish and you are not doing anything funny there
[04:25:03] <LeoNerd> Also don't forget to wiggle the SS line appropriately
[04:25:33] <LeoNerd> Most SPI devices will need to see a "start" by the falling edge of SS, for each transaction
[04:33:18] <STS_Patrik> this is how i do: set CS. Send one control byte. Send 0x00 twice to clock out 16-bit response from circuit. clear CS
[04:33:31] <STS_Patrik> first bit of control byte is a high startbit
[04:34:05] <STS_Patrik> and if i added a transmit of 0x00 between set CS and control byte it works
[04:36:22] <STS_Patrik> this is my function http://pastebin.com/YtP0XJFX
[04:39:01] <STS_Patrik> tl:dr problem is that running this function four times in a row returns faulty value on the first iteration
[04:56:58] <LeoNerd> Might be timing related?
[04:57:58] <STS_Patrik> ye think ive solved it now
[04:58:30] <STS_Patrik> moved CS out of the functions, manually setting it before the burst of samples and adding a delay between the CS set and first sample
[05:20:31] <STS_Patrik> i get corrupt AD readings if the delay is shorter than _delay_us(50) but datasheet says minimum 50ns between CS & first clock cycle
[05:23:00] <STS_Patrik> oh well, device manages to sample at 4 channels @ 500Hz which is way more than i need anyway
[05:23:28] <twnqx> ...
[05:23:47] <twnqx> do you know the difference between nanoseconds and microseconds? :S
[05:24:12] <STS_Patrik> yes that was my point?
[05:24:28] <twnqx> oh, misread your text, sorry
[05:24:33] <STS_Patrik> np
[05:24:37] <twnqx> yes, that is weird then...
[05:24:47] <twnqx> maybe THEY don't know the difference :P
[05:25:49] <STS_Patrik> who knows :) it's TI though
[06:29:06] <DO9XE> Does anyone have an Idea, why an at90usb1287 might not accept its fuses over ISP? I want to disable clckdiv8 bit, but it allways changes back during programming, even if i tell avrdude to rewrite it :/
[06:32:17] <jacekowski> DO9XE: you are doing something wrong
[06:32:42] <DO9XE> i know :P but i totally have no Idea what :P
[06:33:04] <DO9XE> If i set it into the bootloader modus, the bootloader works perfekt :P
[06:33:23] <jacekowski> what fuses are you setting exactly
[06:33:28] <jacekowski> as in, values
[06:34:32] <DO9XE> -U lfuse:w:0xfd:m -U hfuse:w:0x99:m -U efuse:w:0xf7:m
[06:36:22] <jacekowski> looks ok
[06:37:49] <DO9XE> yes. I have the same setup as on the USBKEY board. 8MHz external crystal.
[06:39:56] <jacekowski> try full wipe and then program
[06:41:04] <DO9XE> of the fuses?
[06:41:16] <jacekowski> full chip wipe
[06:41:38] <DO9XE> okay :)
[06:41:47] <jacekowski> -e
[06:41:50] <jacekowski> iirc
[06:46:01] <DO9XE> i used -t and then just erase :)
[06:46:06] <DO9XE> worked fine :)))
[06:46:26] <DO9XE> let me guess: my bootloader got killed, to? :D
[06:55:07] <jacekowski> DO9XE: yep
[06:55:41] <DO9XE> aand found the hex, flashed it back and ill walk over to the other room with the windows PC to test it :)
[06:56:06] <Haohmaru> is tcp/ethernet doable on an 8bit avr?
[06:56:17] <Haohmaru> ..and are there any libs for tcp
[06:57:34] <LeoNerd> I'd stick to UDP if at all possible
[06:57:43] <LeoNerd> Except maybe on one of the larger megas, or an Xmega
[06:57:55] <LeoNerd> Alternatively, get an ESP8266 to talk the TCP parts for you
[06:58:54] <Haohmaru> i'm having in mind something like a tcp client.. it should be able to connect to some tcp server and communicate with it
[06:59:30] <DO9XE> jacekowski, it worked, flashed the USB HID LUFA example and im back at the part were LUFA doesnt work :D
[06:59:44] <LeoNerd> Yes; I understand the question. That's my answer to it
[07:00:03] <Haohmaru> ah, k
[07:00:24] <LeoNerd> Those ESP modules really are quite nice :)
[07:00:30] <Haohmaru> larger megas <- do you mean with larger RAM?
[07:00:41] <LeoNerd> Allows you to offload 802.11, WPA2, DHCP, TCP state, .. The whole lot
[07:04:35] <jacekowski> DO9XE: i presume that's a good thing
[07:04:57] <DO9XE> it is :) flashed LUFA without the bootloader, works fine :)
[07:17:12] <DO9XE> Thanks a lot :)
[08:00:53] <STS_Patrik> microsoft delivering as usual! office 365 now requires an additional mouseclick for app navigation by going from a tab menu to dropdown
[08:02:08] <Thrashbarg> they charge you per click
[08:03:52] <Thrashbarg> can't wait for Microsoft to make Windows subscription based. That'll completely break my volunteer work's business model!
[08:03:55] <Thrashbarg> along with the rest
[08:22:35] <Shavik|Work> Hey Malinus, Jartza. You two around?
[08:22:46] <Shavik|Work> Saw your messages from yesterday and had a question or two
[11:43:35] <hypermagic> hello my friends
[12:20:09] <Shavik|Work> Pretty dead around here today
[12:20:46] <neionz> so you use AVR to interact with electronics. But how complicated is all the electronics surrounding the chip?
[12:20:59] <LeoNerd> Depends entirely on the board and what it's doing
[12:21:46] <LeoNerd> but usually not very, for me anyway. E.g. I have a board that's nRF24L01 -- ATtiny84 -- I2C temp/pressure sensor + custom wire protocol humidity sensor
[12:22:17] <LeoNerd> In addition there's .. hmm... decoupling caps, a couple of diodes to make a wire-OR arrangement on the interrupt line, 3V3 regulator... that's about it
[12:22:31] <neionz> LeoNerd: do you have to be an electrical engineer (are you?) o come up with such a configuration?
[12:22:44] <LeoNerd> Am I? How would I tell?
[12:22:53] <LeoNerd> I've been doing electronics as a hobby the past ~20 years or so
[12:22:59] <Shavik|Work> Can anyone thing of stuff to check for no interrupts firing on my avr? I've checked the CKOUT, it's good at 20Mhz stable, my F_CPU is set to 20000000UL. No ADC nor USART interrupts are firing even though I've called sei.
[12:23:02] <Shavik|Work> Not sure what else to check
[12:23:04] <LeoNerd> I don't have a piece of paper that someone else wrote telling me that I'm an electrical engineer.
[12:24:38] <Bright> me neither :(
[12:24:38] <Bright> i have a piece of paper saying i'm an electrical engineering student though! but i don't think it's impossible to be both an engineer and a student
[12:25:04] <LeoNerd> .oO( I just have very little patience with little pieces of paper saying that a person can do some job or other )
[12:25:36] <LeoNerd> Anyway; speaking personally, I used my ~20 years of personal experience, advice from people I talked to online, information I read from datasheets, and so on to design it
[12:26:15] <neionz> I see, thanks. So what odes it do LeoNerd?
[12:26:51] <LeoNerd> It reads metreological sensors and announces it to my base station
[12:27:04] <LeoNerd> Just for idle fun really :)
[12:27:26] <LeoNerd> I'm currently working on an IoT-style adapter for my dishwasher and washing machine, based on similar tech.
[12:27:33] <LeoNerd> The trick there is making a matrix scanner for the LEDs on the applianeces
[12:47:53] <Shavik|Work> I think I may be onto something
[12:48:03] <Shavik|Work> this millis library I use on the 328 may not like the 324 at all
[12:53:02] <Shavik|Work> I'm pissed / relieved at the same time lol
[15:20:02] <iJaggz> I'm going to be starting with avr's.. my experience is in c though.. I've only some experience in electronics.. can someone offer me guidance on an appropriate programmer?
[15:37:08] <jaggz> oops.. got disconnected.. using desktop now
[15:39:27] <aandrew> hm, does anyone know of an i2c bootloader for attiny25?
[15:39:59] <aandrew> this thing is going to be epoxied into a 1/2 pipe end cap, gonna be difficult to reprogram it otherwise
[15:51:19] <vsync_> xmega and usb, xmega has to be powered with 3v3 min?
[15:57:28] <hypermagic> no
[15:57:38] <hypermagic> that is an optimal power
[15:57:38] <neionz> how do you play sound clips? Do you have short intervals of distinct frequencies or is it something else?
[15:57:53] <hypermagic> but usb requres 3v3
[15:58:02] <hypermagic> in theory, it may work downto 2v7
[15:58:35] <hypermagic> neionz, a simple sound is a series of samples played at a sampling rate
[15:59:05] <hypermagic> either by pwm or dac and a speaker
[15:59:34] <vsync_> well, i'm powering an xmega off 3v, i have a choice to either switch to usb power through a reg on vbus detect or then run it straight off 3v and hope for the best
[15:59:48] <neionz> hypermagic: do you just take samples of the current through a microphone and replay that current to a speaker?
[16:00:11] <hypermagic> usb gives 500mA to you :P you can grab an LD1117 and make 3v3 from it
[16:00:24] <vsync_> hypermagic: that's not what i asked
[16:00:31] <vsync_> i know i can, but i'd rather not
[16:00:41] <vsync_> i'm trying to figure out the viability of 3v operation
[16:00:44] <hypermagic> well i use usb power if it is available.
[16:00:49] <hypermagic> it may even charge the battery :P
[16:01:02] <vsync_> that's not what i asked really, either
[16:01:15] <hypermagic> write your question then
[16:01:24] <vsync_> viability of 3v operation
[16:01:30] <vsync_> will it work
[16:01:37] <vsync_> simple as that
[16:01:43] <hypermagic> i remember xxmega can work from 1.8V
[16:01:52] <vsync_> yeah, but to run the usb
[16:01:53] <hypermagic> but usb will not.
[16:02:33] <hypermagic> usb is 3v3 logic level
[16:02:39] <hypermagic> with some tolerance
[16:02:43] <vsync_> yeah, exactly
[16:02:47] <vsync_> so what are the triggers
[16:02:53] <hypermagic> 2v7 i think
[16:02:56] <vsync_> again, will it work off 3v or will it not?
[16:03:02] <vsync_> okay. so then it will.
[16:03:20] <hypermagic> it is possible it will even work at 2v, but ofc it will be instable.
[16:03:29] <hypermagic> 2v7*
[16:03:47] <vsync_> somehow when asked a question, everyone proposes a solution which is completely irrelevant to the equation
[16:03:48] <hypermagic> neionz, i think you will have votlage, but something like that
[16:04:20] <hypermagic> vsync_, you asked the wrong question maybe
[16:04:21] <vsync_> what the hell?
[16:04:45] <vsync_> "you will have voltage", what?
[16:04:57] <vsync_> i know it's not related to my question
[16:05:02] <vsync_> but that's kind of funny
[16:05:03] <hypermagic> voltage in microphone
[16:05:16] <hypermagic> well you measure voltage with your adc
[16:05:30] <vsync_> yeah, you do. the levels are very very very low
[16:05:40] <hypermagic> and you will probably output voltage in your dac
[16:05:49] <hypermagic> ofc ccurrent drive isbetter
[16:05:58] <vsync_> what are we talking about?
[16:06:08] <hypermagic> you can always use an operational amplifier
[16:06:23] <vsync_> yeah, you run it through an op-amp
[16:06:34] <hypermagic> <neionz> hypermagic: do you just take samples of the current through a microphone and replay that current to a speaker?
[16:06:36] <vsync_> except in a cap mic
[16:06:41] <hypermagic> i think he wants a sound repeater
[16:06:57] <vsync_> i think he doesn't even grasp the concept
[16:07:01] <vsync_> grasps
[16:08:51] <vsync_> because that's so fucking far-fetched i don't even...
[16:09:23] <neionz> vsync_: say waht?
[16:09:28] <vsync_> if you want a god damn sound repeater, you take the signal off of the mic, through op-amp, feed to speaker
[16:09:39] <vsync_> voila, not that hard
[16:10:15] <neionz> vsync_: I want to record it digitally, and replay it
[16:11:01] <vsync_> well
[16:11:23] <vsync_> then you first do adc to record it, dac to play it
[16:12:51] <neionz> that's the part I don't get, those two.
[16:13:03] <hypermagic> that is thte only thing you must get..
[16:13:05] <vsync_> might wanna google pcm to get started
[16:13:12] <vsync_> googloid
[16:13:36] <hypermagic> interrupt at 22050 Hz and repeat samples
[16:13:41] <neionz> I record the voltage over the microphone, and I replay the same voltage (over the same time) over a microphone. Is that it?
[16:13:48] <hypermagic> 2 routines needed
[16:13:56] <hypermagic> and a place to store samples
[16:14:03] <neionz> hypermagic: ^
[16:14:09] <hypermagic> 11025Hz will work for speech too
[16:14:30] <hypermagic> no
[16:14:37] <hypermagic> the microphone records about 1-10mV
[16:14:49] <vsync_> depends
[16:14:52] <hypermagic> you must amplify it to your desired output level to be able to hear it
[16:15:01] <hypermagic> (and record it)
[16:15:42] <vsync_> you don't really get it do you
[16:15:45] <hypermagic> i think you would need about 100-1000 x amplification
[16:16:21] <hypermagic> btw you can use the speaker as microphone
[16:19:03] <neionz> yeah yeah... but still, what am I sampling? Is it just an array of voltage over the microphone over time which is played back (amplified) or is it something else?
[16:19:38] <hypermagic> until you compress it to for example mp3 you only have a series of sample values
[16:20:05] <neionz> hypermagic: sample values = voltage?
[16:20:22] <hypermagic> they are related yes
[16:22:17] <neionz> hypermagic: what do you mean 'related'?
[16:22:37] <hypermagic> read a datasheet and search for adc
[16:25:10] <neionz> hypermagic: I know what they do, I've used adcs before to make a digital volt meter.
[16:30:43] <jaggzt> who do you buy avr's from without paying an arm and a leg for shipping?
[16:31:04] <jaggzt> neionz, did you hook up a wheatstone bridge to an avr?
[16:32:04] <vsync_> i don't think you should read any datasheets or search for adcs
[16:32:24] <vsync_> i think the first thing for you to search for is audio signals 101
[16:32:33] <neionz> jaggzt: no
[16:32:37] <vsync_> it seems to me that the concept eludes you
[16:33:13] <neionz> vsync_: you sample the wave.. but that's the part I don't get when it comes to electronics
[16:33:48] <jaggzt> you're sampling the current value of the input..
[16:34:18] <neionz> jaggzt: yeah, exactly that.. "value of the input". What is that if your input is a cheap microphone?
[16:34:22] <neionz> analog
[16:34:29] <jaggzt> then it goes up and down with the wave
[16:34:46] <neionz> yeah. The voltage through the microphone, or what?
[16:34:49] <jaggzt> and whatever other noise
[16:35:21] <jaggzt> do you supply voltage to your cheap mic?
[16:35:26] <jaggzt> or does it generate its own?
[16:35:59] <vsync_> jaggzt: cap mics aren't cheap
[16:36:05] <neionz> it's just one of those http://www.cui.com/products/image/getproductimage/178?typecode=m
[16:36:18] <neionz> wire-membrane-wire or whatever it's made of
[16:36:23] <vsync_> so think he's using a cheapo one - name escapes me atm - he has to amplify it before running it to any adc
[16:36:45] <neionz> vsync_: "should", don't necessarily have to?
[16:36:57] <vsync_> huh?
[16:37:04] <jaggzt> in the olden days they'd have carbon in the mic.. and the resistance would vary.
[16:37:07] <vsync_> does the datasheet specify the output level?
[16:37:31] <jaggzt> so if you tried to run current through it, the voltage across the mic would change
[16:37:46] <jaggzt> http://en.wikipedia.org/wiki/Carbon_microphone
[16:37:48] <neionz> jaggzt: so I measure its resistance over time, and store that in a file?
[16:38:24] <vsync_> wowzers carbon
[16:39:07] <vsync_> anyway, gotta focus on my own problem... Umm, the support for xmegas is really
[16:39:15] <vsync_> really fucking non-existant
[16:39:21] <jaggzt> vsync_, points out an important issue.. perhaps you need external circuitry to get a high enough signal out of the mic.. (and maybe you can clean up noise if necessary too)
[16:39:33] <jaggzt> s/,//
[16:39:36] <vsync_> jaggzt: most likely he does
[16:39:46] <jaggzt> neionz, try ##electronics too
[16:39:48] <vsync_> op-amp will do
[16:39:54] <vsync_> i suggest not trying electronics
[16:40:03] <jaggzt> they're jerks there?
[16:40:17] <jaggzt> ;)
[16:40:25] * jaggzt glares at theBear
[16:40:25] <vsync_> they are clueless software people, well, which is totally the same as in here
[16:40:34] <jaggzt> lol
[16:40:39] <jaggzt> try #physics
[16:40:42] <jaggzt> ;)
[16:40:51] <jaggzt> okay.. what are your current issues, vsync_ ?
[16:40:54] <neionz> so none of you have recorded sound with an avr? :/
[16:41:09] <jaggzt> neionz, probably some really good tutorials online on it.. I'm brand spankin' new... and not even that.. to AVR.
[16:41:17] <jaggzt> looking for somewhere to buy my first ones
[16:41:23] <vsync_> china
[16:42:40] <neionz> jaggzt: they're cheap anyway, the 8 bit ones
[16:42:43] <jaggzt> url?
[16:42:58] <jaggzt> neionz, yeah but this site says $10 shipping :)
[16:43:40] <jaggzt> I'm going to make some external buttons for a computer..
[16:44:01] <jaggzt> using v-usb to be a mouse and keyboard input to the computer
[16:44:24] <jaggzt> I'll need probably 5 switches handled by the avr
[16:45:24] <jaggzt> will I need more than the tiny 85 then? for more inputs?
[16:45:44] <vsync_> neionz: okay so what is it that you are struggling with now?
[16:46:26] <neionz> jaggzt: http://www.dx.com/p/bonatech-attiny13a-ssu-8-bit-chip-microcontroller-black-5-pcs-303575 free shipping, pirated attiny. 0.5$ piece. Can't recommend though, lol.
[16:47:14] <neionz> not even sure they have anything to do with attiny
[16:47:27] <jaggzt> my one experience with DX upset me. they sent me the wrong pci diagnostic card.. not what I ordered
[16:47:32] <jaggzt> had to wait a month for it too
[16:48:04] <jaggzt> anyway.. probably can buy from them.. they can't get this one so wrong..
[16:48:17] <vsync_> jaggzt: kinda depends where you want it delivered i guess
[16:48:32] <neionz> jaggzt, I would recommend atmels attiny
[16:49:13] <neionz> some chinese products stamp "batman" on toy bread toasters just to sell.
[16:51:51] <vsync_> jaggzt: why do you need an mcu to do that?
[16:52:32] <jaggzt> vsync_, I'm open to advice.
[16:52:41] <jaggzt> I need to convert some specific movements into scrollwheel movements too
[16:53:03] <vsync_> oh. well in that case
[16:53:11] <vsync_> misunderstood
[16:53:27] <jaggzt> for example, the person can't do the movements of a wheel, so I'm planning on using a button which, when pressed, will send a constant-rate scroll-down, and if pressed halfway will do scroll-up
[16:54:42] <vsync_> sure
[16:54:53] <jaggzt> I might map buttons to do different things.. I'm not yet sure about v-usb's capabilities.. if I use windows drivers I'd have to do it in the device (mcu).. otherwise I'd have to customize a driver (obviously it's easier to configure on the computer then)
[16:55:03] <jaggzt> I might do some chorded things..
[16:55:41] <vsync_> chorded?
[16:55:42] <neionz> So if I store the voltage over the mic every 1/X second on a flash disk, and then replay those voltages to a speaker (amplified) in the same rate, I'll hear my sample? :O
[16:56:12] <vsync_> neionz: what part don't you understand?
[16:56:33] <vsync_> you pick a sampling frequency, and a sampling bit depth
[16:57:21] <vsync_> and also, the level of your mic will be very low, so feed it through an op-amp to your adc
[16:57:39] <vsync_> and then sample x bits every y seconds, yes
[17:00:05] <vsync_> capishe?
[17:00:07] <neionz> vsync_: I'm asking whether the sampling part is something more abstract or if it's simply recording the voltage over the microphone
[17:00:25] <neionz> I get the sampling as an abstract concept, but not the electronic implementation of it
[17:00:42] <neionz> why not use a transistor instead of an op-amp?
[17:00:44] <vsync_> it is exactly that
[17:00:49] <neionz> k:)
[17:00:51] <neionz> thanks
[17:01:01] <vsync_> you can use transistors
[17:01:46] <vsync_> usual configuration is that you use op-amp in the first stage and feed that into an output stage with transistors
[17:02:24] <vsync_> also, remember
[17:02:41] <vsync_> how in the hell i can't remember it
[17:03:00] <vsync_> nyquist's theorem
[17:03:25] <vsync_> sampling rate should be 2x the highest frequency you expect to record
[17:04:06] <vsync_> otherwise you can produce funny results
[17:07:20] <vsync_> oh and of course you need to consider how to bias your op-amp for the adc input
[17:08:20] <vsync_> in any case atmel fucking sucks
[17:08:24] <neionz> thanks :)
[17:08:45] <jaggzt> re
[17:08:55] <jaggzt> vsync_, meaning, pressing two buttons at a time to perform a different operation
[17:09:18] <vsync_> sure
[17:11:17] <jaggzt> says here a debugger is an essential piece of hardware
[17:12:53] <jaggzt> I have an arduino.. for another device someone's not using..
[17:12:57] <jaggzt> I can use that as my programmer
[17:13:34] <jaggzt> I should have something dedicated though
[17:13:43] <jaggzt> someone recommended I get tom's..
[17:16:37] <jaggzt> what tutorial/explanation would I read to understand just what TPI, PDI, and ISP are?
[17:20:47] <jaggzt> oh.. they're protocols.. sheesh
[17:28:46] <ColdKeyboard> Can someone recommend really small library for interfacing with SD cards? Preferably smaller than FATFS?
[17:33:15] <LeoNerd> An SD card itself is basically just SPI. Talking to the card is easy
[17:33:25] <LeoNerd> Did you need to interpret an existing (FAT?) filesystem on it?
[17:33:35] <LeoNerd> That's the part that consumes most of the code space
[17:35:57] <ColdKeyboard> I would like to be able to read/write from the fat16 filesystem. FATFS is great but it takes too much ram :(
[17:39:49] <vsync_> reading from it is super easy
[17:39:56] <vsync_> you don't need much code to do that
[17:40:02] <vsync_> writing is a bit trickier
[17:40:12] <vsync_> that said, you're welcome for my 0 contribution
[17:46:05] <jacekowski> ColdKeyboard: you need to keep a lot of structures in ram to write to fat
[17:46:15] <jacekowski> ColdKeyboard: or it will be extremly slow
[17:47:02] <ColdKeyboard> Well since I'm very limited with code space I'm not picky about the speed :)
[17:47:17] <ColdKeyboard> vsync_: Any contribution is much appreciated :)
[17:57:30] <jaggzt> can you add memory to the avr?
[17:57:46] <jaggzt> ColdKeyboard, 0 contribution is no contribution!
[17:58:06] <jaggzt> that being said, almost any energy put out is likely considered contribution
[17:58:13] <jaggzt> in some way
[17:58:26] <jaggzt> vsync_ is humble and wrong!
[17:58:32] <jaggzt> about it being 0
[17:58:37] <jaggzt> anyway.. </babble>
[17:59:58] <jaggzt> so... what avr would I need if I want to sense about 4 or 5 switches.. maybe 3 switches and a variable pot?
[18:00:21] <LeoNerd> Any of them would be fine
[18:00:37] <LeoNerd> 3 GPIOs and one ADC
[18:05:58] <hypermagic> vsync_, i think the problem is he is not ready to create anything
[18:06:11] <hypermagic> i want a circuit i start making it.
[18:13:35] <vsync_> ColdKeyboard: the speed is mostly governed by the limitation of the spi mode in the sd, you are forced to use the free version
[18:13:46] <vsync_> as the high speed mode requires a commercial license
[18:14:41] <ColdKeyboard> Well, like I said I'm not too much concerned about the speed as I am about the footprint of the library :\
[18:17:25] <jaggzt> LeoNerd, thanks.. :)
[18:18:03] <jaggzt> and is a debugger really that useful for an experienced c coder, but kinda lame in electronics, person?
[18:19:09] <jaggzt> oh.. those things are cheap..
[18:19:16] <jaggzt> $10 at dx
[18:19:18] <Tom_itx> debugger?
[18:19:26] <Tom_itx> debooger
[18:19:48] <vsync_> "experienced c coder, but kinda lame in electronics, person". Whoa. Who'd have guessed that
[18:20:03] <vsync_> Tom_itx: played with xmegas?
[18:22:21] <jaggzt> how's the ATtiny28L have a max of 11 io pins, but it has only 6 pins?
[18:22:54] <Tom_itx> no
[18:23:15] <vsync_> whoa
[18:23:43] <vsync_> read the datasheet again, i think
[18:24:07] <hypermagic> "experienced C coders" do not use debuggers
[18:24:18] <jaggzt> Tom_itx, what's the difference between your mkii's and the usb tiny's?
[18:24:33] <Tom_itx> usbtiny?
[18:24:40] <Tom_itx> i think those are software usb
[18:24:53] <Tom_itx> mine is hardware and is alot faster
[18:25:05] <jaggzt> USBTiny MkII Programmer vs. Mini USB Programmer
[18:25:21] <Tom_itx> can't say about the mini usb
[18:25:26] <Tom_itx> not familiar with it
[18:25:40] <jaggzt> this isn't your page? http://tom-itx.no-ip.biz:81
[18:25:46] <Tom_itx> yup
[18:25:51] <Tom_itx> itis
[18:26:03] <jaggzt> :/
[18:26:17] <jaggzt> but you're not familiar with the items listed there?
[18:26:20] <Tom_itx> you mean the other programmer on that page?
[18:26:22] <jaggzt> yeah :)
[18:26:24] <Tom_itx> that's old
[18:26:28] <Tom_itx> software usb
[18:26:35] <jaggzt> so mkii is new, and hardware based?
[18:26:44] <Tom_itx> just left there because it's something i did
[18:26:57] <Tom_itx> mkii is the way to go
[18:26:57] <jaggzt> (software usb means.. you handle the usb with programming on the chip?)
[18:27:06] <Tom_itx> uh huh
[18:27:08] <jaggzt> k
[18:27:10] <Tom_itx> = slow
[18:27:32] <Tom_itx> the mkii works just about anywhere
[18:27:37] <Tom_itx> windows linux osx
[18:27:42] <Tom_itx> studio avrdude
[18:28:47] <jaggzt> yeah I'll be in linux probably.. maybe sometimes using w7.. we'll see
[18:29:16] <jaggzt> so if I get this boxed programmer, am I missing any cables or anything useful or important?
[18:29:24] <Tom_itx> if you switch back and forth, use studio in w7
[18:29:52] <Tom_itx> there is an issue with the usb driver in windows that if you decide to use avrdude in windows you need to swap out the firmware
[18:29:58] <jaggzt> I can just pick one and stick with it.. no biggie
[18:30:19] <Tom_itx> it works in windows studio and linux avrdude by default
[18:30:35] <Tom_itx> the only quirk is the avrdude windows combination
[18:30:42] <jaggzt> what is this fuse-reset recovery board useful for?
[18:30:55] <Tom_itx> attiny 4 5 9 10 20
[18:31:03] <Tom_itx> maybe a couple more
[18:31:10] <Tom_itx> the TPI protocol
[18:31:27] <jaggzt> to do what with them?
[18:31:33] <Tom_itx> reset the reset fuse
[18:31:35] <jaggzt> I don't know when "recovery" is useful
[18:31:40] <Tom_itx> so you can use it for gpio
[18:32:05] <Tom_itx> it takes hv to recover that fuse
[18:33:08] <jaggzt> so.. changing the pin so it's usable as gpio instead of a reset pin?
[18:33:20] <Tom_itx> uh huh
[18:33:24] <jaggzt> (never heard of a "reset fuse" is the issue.. )
[18:33:33] <jaggzt> okay.. so I don't need that thing at the moment.. thanks :)
[18:33:42] <Tom_itx> some of those chips ^^ only have 4io
[18:34:19] <jaggzt> do you have the latest revision mkii in the box?
[18:34:25] <Tom_itx> uh huh
[18:34:54] <jaggzt> okay.. 'cause on the boxed one it says "New USBTinyMkII Rev 2.0c boards now available. "
[18:35:05] <jaggzt> but the bare board above says 2.1c is available
[18:35:05] <Tom_itx> the 'c' is the key
[18:35:22] <Tom_itx> because i modded those boards at different times
[18:35:28] <jaggzt> ok..
[18:35:28] <Tom_itx> they are both the same
[18:35:31] <Tom_itx> one is in a box
[18:35:50] <vsync_> usb standard, data lines low <.8v, high 2-3.6v?
[18:36:31] <Tom_itx> jaggzt where are you located?
[18:36:56] <jaggzt> los angeles
[18:37:09] <Tom_itx> np
[18:37:16] <jaggzt> north korea
[18:37:20] <Tom_itx> np
[18:37:22] <jaggzt> heh
[18:37:29] <Tom_itx> you can't have one
[18:38:01] <jaggzt> debugging is a separate device yeah?
[18:38:18] <Tom_itx> it doesn't do jtag if that's what you're asking
[18:38:25] <Tom_itx> there are many ways to debug code
[18:39:14] <jaggzt> something which lets me monitor the pins, step through code, etc.
[18:39:26] <Tom_itx> dragon
[18:39:36] <Tom_itx> i doubt you really need that
[18:39:36] <jaggzt> right.. k
[18:39:58] <jaggzt> hopefully not.. but my only mcu experience is making a device using an arduino
[18:40:00] <Tom_itx> i have a debugger and a dragon and never use either one
[18:40:21] <Tom_itx> sorry you got off to a bad start
[18:40:30] <jaggzt> and with my limited electronics experience I can foresee stupid things like, "oh.. wrong pin. oops."
[18:40:47] <Tom_itx> go thru my tutorial
[18:40:56] <Tom_itx> it's brain dead simple
[18:41:05] <jaggzt> k :)
[18:41:32] <Tom_itx> the main thing noobs do is fuck up the fuses
[18:48:02] <jaggzt> the dragon debugger is $50 ... :/
[18:48:38] <Tom_itx> yup
[18:50:36] <Tom_itx> http://www.digikey.com/product-detail/en/ATATMEL-ICE/ATATMEL-ICE-ND/4753379
[18:50:41] <Tom_itx> i think that's their new fancy one
[18:51:04] <Tom_itx> http://www.digikey.com/product-detail/en/ATATMEL-ICE-PCBA/ATATMEL-ICE-PCBA-ND/4753383
[18:51:09] <Tom_itx> same thing all stripped down
[18:54:27] <aandrew> wtf?
[18:54:49] <aandrew> seems like a lot of hardware for a debugger
[18:54:52] <aandrew> is it really an ICE?
[18:55:07] <Tom_itx> says it is
[18:55:17] <aandrew> looks like a jtag/isp
[18:55:32] <aandrew> can't be an ICE
[18:55:38] <aandrew> it isn't replacing the CPU
[18:55:40] <Tom_itx> it covers avr & arm
[18:55:42] <aandrew> augmenting it maybe
[18:55:46] <aandrew> but it's not an ICE
[18:56:42] <Tom_itx> they use the term loosely
[18:56:48] <aandrew> indeed :-/
[18:56:59] <aandrew> I have a MPLAB-ICE2000 and an older RICE16
[19:25:04] <Tom_itx> jaggzt, i'll toss in a breadboard adapter too
[19:25:12] <Tom_itx> they're kinda handy
[19:33:14] <vsync_> i doub't he's going to need a debugger for his simple project
[20:07:34] <tpw_rules> is there a way to measure stack usage of avr-gcc?
[20:13:43] <tpw_rules> oh, i found it.
[20:16:48] <tpw_rules> how about running code upon boot before the C environment starts up?
[20:18:06] <tpw_rules> oh, i found that too. i should stop asking questions
[20:46:08] <jaggz> tommylommykins: oh cool, thanks :)
[20:46:29] <jaggz> vsync_: hopefully not.. I have various projects in line though.. mostly simple
[20:47:03] <jaggz> another to measure someone's temperature while they sleep so the family can be alerted if they're overheating and can help them
[20:47:26] <jaggz> s/ tommylommykins / Tom_itx
[20:48:34] <jaggz> tpw_rules: what are you going to do before the c env starts?
[20:48:55] <tpw_rules> jaggz: fill the memory with a pattern so i can dump it out later and see the stack usage
[20:50:39] <jaggz> otherwise, monitoring a stack pointer won't work because you don't know what happened prior to that (nor during execution)? so you want to see peak stack usage?
[20:50:47] <tpw_rules> yeah
[20:50:49] <jaggz> (and areas of usage, I guess)
[20:51:09] <tpw_rules> i ran out of memory so i successfully reduced it, but i want to see how much leeway i have
[20:51:54] <jaggz> runtime or code+libs?
[20:52:03] <tpw_rules> ram
[20:52:16] <jaggz> oh.. right.. of course
[20:52:22] <tpw_rules> i have no .data, 800/2K bss, and no heap
[20:52:30] <tpw_rules> but i'm doing deep calls with large structs
[20:53:14] * tpw_rules misses segfaulting
[20:54:27] <jaggz> I wonder if there are compiler optimizations to minimize stack usage
[20:54:46] <tpw_rules> nah, it's just me needing a lot of it
[20:54:48] <jaggz> e.g. if you were passing structs as function arguments
[20:55:05] <tpw_rules> nothing that heinous, just a lot of them locally
[20:55:24] <jaggz> k.. thanks for sharing
[20:55:43] <tpw_rules> is sharing a problem
[20:57:47] <jaggz> :)
[20:59:15] <tpw_rules> i think it's completely shitty that it has to copy .data to ram though
[20:59:41] <hackvana> Don't put things in .data then.
[21:00:09] <tpw_rules> well duh, but how many people actually know that
[21:00:31] <hackvana> So there is no "has to". The computer does what you tell it
[21:03:13] <tpw_rules> and it's not possible for the computer to have strcmp_R and strcmp instead of strcmp and strcmp_P?
[21:04:57] <hackvana> It's possible
[21:05:46] <tpw_rules> well i think it's a bit "dangerous" for it to not be that way
[21:05:55] <hackvana> (I'm taking a very literal view here)
[21:06:05] <hackvana> What is "that way"?
[21:06:20] <tpw_rules> using up ram on string constants
[22:04:38] <tpw_rules> actual sram starts in an atmega328p at 0x0100?
[22:08:42] <tpw_rules> yeah
[23:25:17] <anonnumberanon> question, are the anolog pins of atmega328p analog outputs or analog inputs? Can I input a sin wave with them?
[23:25:26] <LoRez> inputs
[23:25:46] <LoRez> up to nyquist, sure.
[23:40:10] <Mr_Sheesh> For best results stay well below nyquist tho