#avr | Logs for 2012-06-09

Back
[00:05:25] <Kevin`> totesmgee: maybe, you should get specific numbers on what you need. since you only need to detect the impact event, sticking a little bit of analog circuitry between the accellerometer and avr to turn the signal into a digital pulse may be more appropriate
[00:07:15] <SuperMiguel> tom u here?
[00:07:46] <Kevin`> totesmgee: avrs go up to either 1 or 2 msps (I forget which) for the internal analog inputs
[00:08:35] <SuperMiguel> Tom_itx: u there?
[00:08:43] <totesmgee> well the speed of sound through steel is like 6100 meters per second
[00:08:54] <totesmgee> and the largest diameter of an object to shoot is 24
[00:09:05] <totesmgee> common is 12 and 18 inch as well
[01:59:23] <IndianaRonaldo> Under SEH Team
[02:00:13] <IndianaRonaldo> Under SEH Team
[02:26:24] <OndraSter> where can one get a 5kV/0.7A fuse?
[02:27:14] <theBear> err, you might try farnells
[02:27:19] <OndraSter> hmm
[02:27:24] <OndraSter> $1 fuse $6 shipping
[02:28:07] <OndraSter> also, how is the HV side of the transformer connected?
[02:28:16] <OndraSter> there are 3 wires
[02:32:27] <theBear> what are you talking about ?
[02:32:35] <OndraSter> farnell
[02:32:51] <theBear> 3 wires on the hv side of a fuse ?
[02:32:55] <theBear> what ? no
[02:32:58] <theBear> what transformer
[02:33:04] <OndraSter> oh wait
[02:33:06] <OndraSter> transofmer, yes
[02:33:07] <OndraSter> MOT
[02:33:30] <theBear> just as i suspected... i thought they only had a single hv wire/antenna out and 2 in
[02:34:30] <theBear> damn they are smart.... its' kinda like a little radio/electron hurricane in there, and when they are fast enough or whatever they do they get caught by the antenna and taken out
[02:35:28] <OndraSter> hmm I found it on local something like ebay
[02:35:30] <theBear> http://en.wikipedia.org/wiki/Cavity_magnetron
[02:35:43] <OndraSter> 3.4€
[02:35:47] <OndraSter> incl shipping
[02:36:05] <theBear> my theory was a little off, but i didn't understand that stuff back the last time i read it
[02:37:08] <OndraSter> hah, 1.5€ and I can pick it up in Prague
[02:37:11] <CapnKernel> Isn't there one at the heart of any microwave oven?
[02:37:13] <OndraSter> I think I will take two, just to be safe
[02:37:20] <OndraSter> CapnKernel, ye
[02:37:21] <OndraSter> magnetron
[03:05:06] <theBear> while we're at it, i assume you know the caps in microwaves regularly kill experienced techs AND normal people right ?
[03:05:23] <theBear> hehe, they don't discriminate those caps
[03:11:05] <OndraSter> sure I do :)
[03:11:32] <OndraSter> the microwave was unplugged for few years now and even then I shorted the cap
[03:11:34] <OndraSter> no bang..
[03:23:43] <OndraSter> arrgh, atmelstudio processes froze after disconnecting yesterday Dragon while still having program running and in debug mode and putting computer to sleep
[03:23:47] <OndraSter> now after waking up it gets stuck
[03:23:50] <OndraSter> can't kill it even
[03:51:57] <CapnKernel> OndraSter: Do you know the dangers of beryllium oxide?
[03:53:11] <OndraSter> say what?
[03:55:35] <iR0b0t1> Anyone have a Cypress dev board? I'm looking for someone with a CY8CKIT-001.
[03:57:00] <CapnKernel> OndraSter: http://en.wikipedia.org/wiki/Magnetron#Health_hazards
[03:57:07] <OndraSter> oh magnetron
[03:57:18] <OndraSter> i am familiar with magnetrons, yes
[03:57:54] <CapnKernel> And from http://en.wikipedia.org/wiki/Klystron, "Hansen died of beryllium disease in 1949 as a result of exposure to beryllium oxide (BeO)."
[04:01:26] <CapnKernel> Sintered form is safe, avoid dust from broken insulators
[04:32:01] <OndraSter> btw, those flyback transformers in TVs have small capacitor in them :))
[04:32:03] <OndraSter> so watch out :D
[04:32:36] <OndraSter> last time I "played" with one, primary = few mV (since I don't have any powerful AC power source, I just quickly tapped on my DC PSU)
[04:32:39] <OndraSter> secondary = a lot :D
[04:37:36] <OndraSter> hmm what do the old ISA cards use as their refresh frequency?!
[04:37:42] <OndraSter> appearantly more than 60Hz
[04:37:50] <OndraSter> and I don't have any CRT screen anymore
[04:37:53] <OndraSter> I already took them apart :(
[06:31:11] <electronics-cat> hello everyone
[06:36:13] <Steffanx> Hi Someone
[06:37:35] <electronics-cat> so
[06:37:40] <electronics-cat> like hows your AVR
[06:39:07] <RikusW> Hi Steffanx
[06:56:42] <Steffanx> lo mr RikusW
[06:58:09] * RikusW is messing around with a win98 install in qemu ;)
[06:58:45] <electronics-cat> install it on atmega32
[06:58:46] <electronics-cat> :D
[06:59:56] <RikusW> that would be SLOW
[07:00:50] <electronics-cat> sure would
[07:31:35] <electronics-cat> AH FUCK
[07:36:53] <CapnKernel> There goes the G rating
[07:37:22] <electronics-cat> hi
[07:47:43] <theBear> it's ok, i think we still got both a b-boy AND a fly-girl rating, forget the G's, they're so 90s anyway :)
[07:48:18] <OndraSter> heh
[09:48:12] <rue_mohr> yea, dont try to look at a log of #electronics at an airport
[09:48:18] <rue_mohr> automatic site blocker
[10:07:08] <OndraSter> so who was the one who said that there will be issues with NFS server on windows? =)
[10:07:30] <OndraSter> I just want to say that when it is trying to get the files from linux server it shows "remote error: -1" after minute of trying (another linux computer connects there fine
[10:07:44] <OndraSter> and when Windows Server is the NFS server it downloads the file just fine and boots it :D
[10:15:04] <xata> hello all
[10:15:24] <Steffanx> Hello one
[10:16:04] <xata> chosen one?
[10:16:05] <Tom_itx> hello two
[11:16:00] <xata> guys, how do i send 16-bit value via spi? as far as i know sending two 8-bit values != one 16-bit value
[11:16:57] <OndraSter> it equals
[11:17:09] <OndraSter> but you must NOT toggle the chip select of the device up & down again
[11:17:44] <OndraSter> When I was born, I was genius. No idea where it disappeared to :/
[11:19:44] <specing> OndraSter: school
[11:19:54] <CapnKernel> I was a genius to get married. Since then, my wife's taken over the role
[11:20:10] <CapnKernel> Or so she says
[11:20:11] <drgreenthumb> haha
[11:20:31] <specing> CapnKernel: Is your wife a haxx0r too?
[11:20:54] <CapnKernel> No
[11:21:15] <CapnKernel> Pre-kids she was a software engineer like me, but never a gee3k
[11:21:22] <CapnKernel> geek even
[11:21:24] <drgreenthumb> women have a way of making even the most uber-l337 technogeek feel incredibly stupid.
[11:21:34] <drgreenthumb> I don't know how they do that.
[11:22:45] <drgreenthumb> like you spend ten weeks building something awesome that makes hackaday.com in 1/18 second, and she'll be like "yeah, so what is it good for?" :P
[11:22:53] <xata> OndraSter: thanks. but isn'y cs toggled automaticly.... somehow. somebody has to read datasheet again
[11:23:12] <OndraSter> no
[11:23:17] <OndraSter> if you are master you maintain the CS line
[11:23:33] <drgreenthumb> are you in slave mode?
[11:23:33] <CapnKernel> "Very good, now how about the lawn?"
[11:23:38] <drgreenthumb> haha
[11:23:45] <OndraSter> :D
[11:24:49] <drgreenthumb> if xata is in master mode and expecting SS to do something magic, he's in for a shock :P
[11:25:10] <drgreenthumb> infact, connecting anything to that damned pin is dangerous in master mode. bleh.
[11:25:44] <xata> i need to connect mcp 41010 digipot to amega32. that's all.
[11:26:22] <OndraSter> drgreenthumb, as long as it is output it is fine
[11:26:25] <xata> and send a sinewave so that digipot make my lp-filter WUBWUBWUBWUBWUB
[11:26:36] <OndraSter> I made once the mistake that I set it as output AFTER I started first SPI transmission
[11:26:38] <OndraSter> and the pin was floating
[11:26:59] <OndraSter> so what do you know
[11:27:18] <OndraSter> when JTAG was connected, some stray capacitance/inductance/moon-tance made it high
[11:27:22] <OndraSter> so it didn't fall into slave mode
[11:27:33] <OndraSter> but when I disconnected JTAG it started randomly not boot etc :))
[11:27:36] <OndraSter> try debugging that!
[11:30:15] <xata> maybe dumb question - where do i get CS for digipot from my atmega?
[11:30:23] <CapnKernel> OndraSter: Heisenbug
[11:30:35] <OndraSter> xata, anywhere
[11:30:57] <OndraSter> CapnKernel, :)
[11:31:34] <xata> OndraSter: any _where_?
[11:32:04] <drgreenthumb> yeah. any pin. bring it high at startup
[11:32:10] <drgreenthumb> and toggle low to select
[11:32:12] <OndraSter> yep
[11:32:27] <CapnKernel> Get a header block to fit the JTAG header, write on it "authenticator dongle", and put enough resistance in it so it seems as if it's a JTAG unit.
[11:33:18] <drgreenthumb> OndraSter, I've found that making sure SS is a high-z input is the safest btw
[11:34:01] <OndraSter> I've found that making sure SS never reached our house during WWII was the safest btw
[11:34:03] <OndraSter> -.-
[11:34:18] <OndraSter> I've found that making sure SS is a output with internal pullup works the best
[11:34:20] <drgreenthumb> hey, I didn't name it :P
[11:34:30] <drgreenthumb> yeah a pullup is nice
[11:34:40] <drgreenthumb> since then it doesn't have to be the same vdd as the AVR
[11:35:08] <drgreenthumb> I have a board wired like that in front of me now :)
[11:35:27] <drgreenthumb> I try to do it on all active low inputs when I can
[11:35:43] <xata> OndraSter: but then why would i use some spi methods and special things if i can make it fully in code with random pins, and several spi devices on one avr
[11:36:02] <OndraSter> what?
[11:36:46] <drgreenthumb> MOSI, MISO and SCK are *NOT* random pins
[11:36:50] <xata> i mean not just that portb pins, but others too, made on software
[11:36:57] <drgreenthumb> you can
[11:36:58] <OndraSter> sure you can realize software SPI
[11:37:01] <drgreenthumb> but it's slower
[11:37:04] <OndraSter> yep
[11:37:18] <OndraSter> hell I have got here (had, already flashed something else on it) Atmega32 with 1MB RAM
[11:37:25] <OndraSter> and it uses software to access it
[11:37:33] <OndraSter> so it is slow as hell, but damn you have plenty of space
[11:37:44] <drgreenthumb> xata, remember SPI is a *bus* you can connect many ICs to it. so you need to be able to select any of them.
[11:37:57] <drgreenthumb> hence, the AVR lets you do the selecting part
[11:37:58] <xata> better slower than one atmega for one digipot
[11:38:01] <drgreenthumb> and then it handles the shifting part
[11:38:19] <OndraSter> xata, by using multiple pins to drive different chip selects you can use plenty
[11:38:36] <OndraSter> using one SPI
[11:38:38] <xata> drgreenthumb: mcp41010 does not have miso =\
[11:38:41] <OndraSter> + one random pin per chip
[11:38:46] <OndraSter> so dont use it
[11:38:58] <drgreenthumb> xata, slaves sometimes call them "SDO" "SDI"
[11:39:00] <drgreenthumb> or similar
[11:39:01] <xata> stooop.... i start getting it
[11:39:02] <drgreenthumb> SO, SI
[11:39:04] <OndraSter> drgreenthumb, there is none
[11:39:06] <OndraSter> simple as that
[11:39:10] <OndraSter> it is rx only
[11:39:12] <OndraSter> device
[11:39:13] <drgreenthumb> oh
[11:39:16] <OndraSter> .. I bet
[11:39:22] <OndraSter> just as any digipot, DDS, ...
[11:39:41] <xata> yes it is read-only if in single-pot version
[11:40:34] <xata> OndraSter: so i start get this. i can connect all the pots to one miso and then just select it by toggling pin connected to CS
[11:40:43] <OndraSter> ye
[11:40:53] <OndraSter> one MISO and SCK
[11:41:31] * Sgt_Lemming sighs and people being elitist about microcontrollers and dev boards
[11:41:34] <Sgt_Lemming> at*
[11:41:55] <xata> that's beautiful, obvious and all that stuff i start to love electronics more and more each day.
[11:42:19] <drgreenthumb> heh I have this one digital pot that actually says both SDO and SDI are on the same pin. wtf do I do about that?! :)
[11:42:22] <xata> *each day for
[11:42:57] <xata> drgreenthumb: maybe cs=1 than sdi, cs=0 than sdo
[11:43:01] <drgreenthumb> maybe it's actually just TWI and the documentation is dumb
[11:43:53] <drgreenthumb> heh xata that would be very nonstandard SPI
[11:44:09] <drgreenthumb> tying them together in the first place is pretty nonstandard though :P
[11:44:25] <xata> call it _artistic_
[11:44:40] <drgreenthumb> heh I call them garbage since I can't drive them ;p
[11:44:59] <drgreenthumb> I'll get an easier one
[11:45:41] <OndraSter> what's wrong on I2C?
[11:45:57] <xata> i heard there are some awesome analog devices digipots
[11:46:00] <drgreenthumb> maybe it is actually I2C OndraSter I donno. the docs are very unclear
[11:46:18] <drgreenthumb> I could probably just bitbang from the timing diagram but .. meh.
[11:46:32] <drgreenthumb> there's more exiciting code to write than that!
[11:46:39] <OndraSter> xata, I like ADI, but Y U NO ON MOUSER!
[11:46:40] <xata> but they are costy enough not to try to weld soic to breakout board with 40w soviet welding iron
[11:46:44] <OndraSter> no ADI parts on Mouser :(
[11:47:12] <xata> what i did with mcp's
[11:47:32] <SuperMiguel> Tom_itx: u there?
[11:47:35] <xata> OndraSter: i have a local dealer :3
[11:47:48] <OndraSter> :)
[11:47:53] <OndraSter> for 100+ one can order from ADI
[11:48:30] <xata> but 4 bucks for digipot? k, n thnx
[11:48:38] <OndraSter> duh
[11:48:42] <OndraSter> 16bit or what?
[11:48:54] <xata> just analog devices
[11:49:11] <OndraSter> digipots start from like a buck
[11:49:14] <OndraSter> or less than that even
[11:49:14] <OndraSter> I think
[11:49:16] <OndraSter> @ ADI
[11:49:50] <xata> my microchip 8-bit pot costs 1-1.2$ depending on ohm nominal
[11:50:42] <xata> including some profit for the wet and the hairy hands of "dealer"
[11:51:00] <xata> it is not more like dealer, but like smuggler
[11:51:27] <drgreenthumb> heh even a buck sounded expensive http://www.digikey.com/product-detail/en/MCP4018T-502E%2FLT/MCP4018T-502E%2FLTCT-ND/2081909
[11:52:46] <xata> yes, i have something like this.
[11:53:11] <drgreenthumb> well that one is i2c not SPI. it was the cheapest one I found though :)
[11:53:44] <xata> look at this - i hope i didn't overheated them http://cs301406.userapi.com/v301406136/20a5/YG7u2fN6qJg.jpg
[11:54:13] <xata> it is easy to overheat with $5 welding iron
[11:54:40] <drgreenthumb> it's probably fine
[11:55:08] <drgreenthumb> would be nice if the breakout board had plated thru holes :/
[11:55:16] <drgreenthumb> did you make it or buy it?
[11:55:53] <xata> i bought it - have no reactives to make one, while this cost <0.5$
[11:56:16] <drgreenthumb> heh is it hard to attach wires to those little squares?
[11:56:27] <drgreenthumb> I have no idea how big that coin is BTW :P
[11:57:04] <drgreenthumb> heh actually I can judge it bette from the size of the TSSOP chip
[11:57:06] <xata> drgreenthumb: ~1.7cm
[11:58:31] <xata> drgreenthumb: i am still on breadboarding phase, so i do not care about how tough will be wires welded
[11:58:53] <drgreenthumb> I don't mean the strength of the join. I mean is it difficult to work with
[11:59:01] <drgreenthumb> they look very small!
[11:59:11] <xata> after all i have a special drill made from one of soviets spacecraft electric engines
[11:59:15] <drgreenthumb> need some fine iptch wire
[11:59:19] <drgreenthumb> ah :D
[12:01:29] <OndraSter> FYI, NFS server on gentoo works just fine, the device boots. NFS Server on Debian doesn't work, the device doesn't boot (but other linux machines can mount the NFS share)
[12:01:30] <OndraSter> who knows
[12:02:52] <xata> who knows who knows...
[12:03:24] <xata> never had a chance to use NFS, so i have no advice here.
[12:07:27] <OndraSter> more like "never had a reason to use NFS, lucky me!"
[12:07:27] <OndraSter> :D
[12:10:05] <drgreenthumb> works better than samba for me
[12:10:16] <drgreenthumb> samba messes up the permissions of everything :/
[12:10:22] <OndraSter> if you use linux - most likely
[12:10:44] <OndraSter> but for us, Microsoft-ers...
[12:10:46] <drgreenthumb> heh well yeah. closet server runs it and my XBMC TV too :) desktop is Winders though.
[12:11:18] <drgreenthumb> so I actually run both
[12:11:28] <drgreenthumb> it's on some old CentOS box though
[12:15:36] <Landon> I use samba for my xbmc, never had any problems :P
[12:15:51] <Landon> except for last night, when I copied some files over that didn't have any Other rights :\
[12:16:26] <xata> OndraSter: yes, lucy me. have no chance to practice to become a usefull paid sysadm - lucky me =\
[12:16:29] <antto> can an atmega "not have" a bootloader?
[12:16:44] <antto> ..and still run it's firmware
[12:16:52] <Sgt_Lemming> antto, yes
[12:17:04] <Sgt_Lemming> the bootloader just facillitates reprogramming
[12:17:08] <antto> how will it boot the firmware?
[12:17:15] <OndraSter> xata, heh, well you can always install two VMs...
[12:17:16] <OndraSter> or three :)
[12:17:30] <Sgt_Lemming> you can program one using ICSP with firmware
[12:17:38] <Sgt_Lemming> without the bootloader
[12:17:44] <Sgt_Lemming> it saves a whopping 2k of space or so
[12:17:48] <xata> OndraSter: or got biten by spider and fire web
[12:19:17] <antto> Sgt_Lemming: the thing is, we have this device which is produced by different people around the world, it's a synthesizer and it has a way to "flash firmware via usb/serial"
[12:19:28] <OndraSter> xata, that's your choice
[12:19:38] <Sgt_Lemming> antto, that's got a bootloader on it then
[12:19:55] <antto> but some of the guys who sell it don't put the "bootloader" on it, and users report they can't reflash the firmware
[12:20:09] <Sgt_Lemming> yeah
[12:20:28] <antto> because the bootloader has to be specific, since it uses the value of a rotary encoder to determine whether to boot the firmware or to stay in bootload mode
[12:20:52] <Sgt_Lemming> is the bootloader available somewhere?
[12:21:07] <xata> i saw there is an OS for avr
[12:21:16] <Sgt_Lemming> yeah
[12:21:18] <Sgt_Lemming> bertos
[12:21:18] <xata> i don't get what for but there is
[12:21:23] <antto> so i'm wondering, for those who say that their device has no bootloader - does this mean it actually has some "stock" atmel bootloader which just always jumps to the firmware?
[12:21:41] <OndraSter> there is no need for that
[12:21:42] <Tom_itx> execution starts at 0x0000
[12:21:46] <Sgt_Lemming> antto, you don't need a bootloader on a microcontroller
[12:22:03] <antto> ahum
[12:22:08] <Sgt_Lemming> the bootloader is for convenience sake and nothing else
[12:22:45] <antto> but then, this means that if the user sets the rotary encoder to the "special" position and restarts the device - it won't make any differece - it will just start the firmware as always
[12:22:46] <antto> right?
[12:22:57] <Sgt_Lemming> correct
[12:23:14] <Tom_itx> silly concept but true
[12:23:21] <xata> but there is eeprom to save this
[12:23:52] <Tom_itx> eeprom without a program in place to read it is as good as blank
[12:24:31] <xata> Tom_itx: i implied there is a program to read|write that "special" postion of anything
[12:25:13] <Sgt_Lemming> afaik, you would need a bootloader in the flash to jump to the eeprom anywa
[12:26:02] <xata> Sgt_Lemming: that c programms i make in avr studio are bootloaders? if so - than yes.
[12:26:42] <OndraSter> not nescesarily
[12:26:47] <OndraSter> if you'd be making bootloader - you'd know it :)
[12:27:35] <CapnKernel> Most programs start at offset 0. There's a fuse you can set which makes the AVR start much higher up. That's an area you can put some bootloader software
[12:28:00] <Sgt_Lemming> whether you call it a bootloader or not, I don't think you can get the AVR to boot straight from EEPROM
[12:28:02] <antto> CapnKernel: aha!
[12:28:08] <CapnKernel> It's customary, but not necessary, to write that bootloader so it can read new software from somewhere, and reprogram it into address 0
[12:28:10] <xata> OndraSter: but why would i? i don't get this. why should i make some programm to load other static programms in my flash if i can read it directly on start?
[12:28:22] <antto> thanks guys, i think i have a better picture now ;]
[12:28:25] <xata> oh, that's what for.
[12:28:31] <drgreenthumb> Sgt_Lemming, heh or indeed execute anything from an EEPROM at all. at least, unless it's interpreted.
[12:28:37] <OndraSter> xata, because the one later in flash can update the main one
[12:28:39] <OndraSter> the application
[12:28:41] <OndraSter> -.-
[12:28:44] <drgreenthumb> AVRs just don't do that. the 8bit ones anyway
[12:29:04] <CapnKernel> The idea is that you write the bootloader once. The main program can be overwritten many times (via the bootloader)
[12:29:15] <Sgt_Lemming> ^
[12:29:39] <drgreenthumb> is the flash programmable from inside though?
[12:29:40] <drgreenthumb> no
[12:29:42] <Sgt_Lemming> yes
[12:29:45] <CapnKernel> Usually, the first few instructions of the bootloader check for some special condition (for example, the setting of a rotary encoder), and if it's one way, it jumps to address 0 (thus starting the main program), or going into bootloader mode.
[12:29:46] <drgreenthumb> it is?
[12:29:52] <Sgt_Lemming> that is one of the cool things about avr's drgreenthumb
[12:30:04] <xata> Sgt_Lemming: i think too. i thought that antto asks if someone can store some data somewhere without bootloader. disregard that.
[12:30:05] <Sgt_Lemming> they can reprogram the flash memory themselves
[12:30:10] <CapnKernel> You can be running the bootloader in flash, and be simultaneously writing to the flash at another position
[12:30:46] <Sgt_Lemming> you can even sort of use it as very slow RAM with a bit of trickery
[12:30:49] <drgreenthumb> huh I swear I read that it could not do that. was that attiny or something? huh what the heck was I reading x_x
[12:30:56] <OndraSter> Sgt_Lemming, I dare you to do that =)
[12:31:00] <OndraSter> with >month runtime :D
[12:31:11] <Sgt_Lemming> OndraSter, never said it was easy or fast :-P
[12:31:21] <OndraSter> not easy or fast
[12:31:25] <OndraSter> but limited overwrites :D
[12:31:31] <OndraSter> how much are they rated for? 100k?
[12:31:33] <CapnKernel> For example, here's a project I did where the bootloader can load a new main program over USB: http://capnstech.blogspot.com/2011/02/usb-doodad-6-bootloader.html
[12:31:41] <Sgt_Lemming> but to shift data out of ram to free up ram for processing it can be done
[12:32:06] <Sgt_Lemming> CapnKernel, I have a Freetronics Leostick now, tis awesome
[12:32:10] <CapnKernel> Note: EEPROM is not the same as flash
[12:32:24] <Sgt_Lemming> jah
[12:33:24] <CapnKernel> In general, flash is for your program, EEPROM is for data you want saved when the power goes off, for example, configuration and calibration
[12:33:26] <Tom_itx> drgreenthumb, you can write over your bootloader as well
[12:33:41] * Tom_itx gives drgreenthumb a loaded gun to seee what would happen
[12:33:57] <drgreenthumb> heh :)
[12:34:08] <drgreenthumb> I do have an SD card with 2GB sitting right here ....... ;)
[12:34:16] <CapnKernel> And?
[12:34:22] <Sgt_Lemming> we use the EEPROM for storing RFID codes on our security system
[12:34:42] <Sgt_Lemming> the code on the board caches the codes in the EEPROM whenever they are updated
[12:34:56] <drgreenthumb> and ... CapnKernel maybe I should see if I can write huge AVR programs :P
[12:34:58] <OndraSter> I wish Atmel would do chips with more SRAM and without EEPROM...
[12:34:58] <xata> as i get it - flash is not modifiable program body, eeprom is something like mc's hdd and ram is ram (lalaaa-la-la-la)
[12:35:03] <OndraSter> it is easier to expand EEPROM than SRAM :)
[12:35:06] <OndraSter> than RAM*
[12:35:14] <Sgt_Lemming> yeah
[12:35:18] <CapnKernel> no
[12:35:21] <Sgt_Lemming> SRAM is quite expensive silicon wise
[12:35:31] <OndraSter> EEPROMs can be on SPI just fine
[12:35:47] <OndraSter> SRAM on SPI can't be used for direct storage, one has to write some handlers etc...
[12:35:50] <CapnKernel> xata: flash can be modified from a program. It's customary (but not necessary) to do it from a bootloader.
[12:35:50] <Sgt_Lemming> yeah, but having a bit of EEPROM on the chip is not a bad thing
[12:35:51] <OndraSter> with EEPROM you have those handlers anyway
[12:36:26] <CapnKernel> You could have a system which rewrites flash on the fly to run programs bigger than can fit into flash. (Once this technique was called "overlays")
[12:37:18] <CapnKernel> EEPROM is a memory area you can read directly (and write, with some fiddling).
[12:37:23] <xata> CapnKernel: but it is power-independent too. than what eeprom for? more read cycles? or flash can not be edited after bootloader starts what you want?
[12:37:46] <CapnKernel> When drgreenthumb says "I do have an SD card with 2GB sitting right here .......", then *that* is more like a hard disk
[12:37:58] <OndraSter> CapnKernel, only on xmegas you can use them directly
[12:38:20] <CapnKernel> OndraSter: Let's not confuse them with a different processor family, no?
[12:38:23] <drgreenthumb> yeah CapnKernel but with about 10k of code or so I can read from FAT FS
[12:38:29] <OndraSter> CapnKernel, still AVR8 :D
[12:38:42] <drgreenthumb> infact I'm doing that already.
[12:38:50] <drgreenthumb> I should see if I can load up some small programs
[12:39:04] <CapnKernel> xata: In general, EEPROM is a place to put data.
[12:39:13] <drgreenthumb> hmm though, if the AVR is swapping programs often wouldn't the flash actually die pretty fast? or what's the normal thing to do, swap programs only after some human intervention? multitasking kills flash :P
[12:39:19] <xata> the glorious xmegas, that i can not have before i get a welding station... oh that internal dac's and all the other nice stuff.
[12:39:32] <CapnKernel> Flash is a place to put programs (although your program can have data intermixed with it at compile time)
[12:40:17] <CapnKernel> It's possible to reprogram flash on the fly (that's what the bootloader does), but in practice, it's only done using the bootloader pattern
[12:40:54] <CapnKernel> drgreenthumb: If one were to do overlays, one wouldn't want to do it very often. overlays is not swapping
[12:41:35] <CapnKernel> For example, let's say your program had a configuration and calibration mode, and the combination of that program and the main program was too big to fit.
[12:41:52] <xata> have to reboot to windows to start avr-studio. will be back
[12:42:02] <CapnKernel> You could rewrite flash with one image or the other to handle the task at hand
[12:43:16] <drgreenthumb> is there random access to writing the flash? or do I have to e.g. start at zero and write contiguous memory?
[12:43:45] * drgreenthumb figures out what ASM instructions can actually do this and reads up
[12:44:38] <CapnKernel> It's page-based
[12:44:55] <CapnKernel> Because of the way flash is constructed
[12:45:12] <CapnKernel> Basically, you have to erase a page, which sets every bit to 1.
[12:45:24] <CapnKernel> You can then write to it, turning bits to 0.
[12:45:31] <CapnKernel> I believe the page size is 128 bytes
[12:45:38] <OndraSter> CapnKernel, depends on device
[12:45:50] <CapnKernel> In the AVR?
[12:45:55] <OndraSter> yes
[12:46:06] <CapnKernel> Interesting, tell me more
[12:46:06] <OndraSter> some use 64 bytes, some 128 bytes, some 256 bytes
[12:46:18] <OndraSter> look at eg mega128 and mega32
[12:46:21] <OndraSter> they will differ :)
[12:46:22] <OndraSter> I bet
[12:46:50] <CapnKernel> Hmm
[12:47:10] <OndraSter> m32:
[12:47:10] <OndraSter> .equ PAGESIZE = 64
[12:47:23] <OndraSter> m128a:
[12:47:23] <OndraSter> .equ PAGESIZE = 128
[12:47:31] <OndraSter> (that is in WORDS, not in bytes)
[12:49:09] <OndraSter> tn85
[12:49:10] <OndraSter> .equ PAGESIZE = 32
[12:50:48] <CapnKernel> I see, thanks.
[12:50:49] <CapnKernel> http://en.wikipedia.org/wiki/Overlay_%28programming%29
[12:52:27] <drgreenthumb> ah I see. software doing the updating needs to be in the bootloader area for this to work. so it's limited in size.
[12:52:45] <drgreenthumb> so I can't just stick a 10k DOS FS lib in there :P
[12:53:03] <OndraSter> actually
[12:53:04] <OndraSter> you can
[12:53:09] <OndraSter> the SPM instruction has to be in bootloader area
[12:53:20] <OndraSter> you can have the FAT lib somewhere before bootloader
[12:53:34] <OndraSter> jump on it, fetch one block to RAM and cache it, jump back to the BL area, flash it
[12:53:37] <OndraSter> jump back to lib etc
[12:53:42] <drgreenthumb> oh heh just jump in and out of the "NRWW" area I see
[12:53:45] <OndraSter> btw 10k is a lot
[12:53:46] <OndraSter> ye
[12:54:13] <drgreenthumb> it's probably not that big I really don't know for sure. only ever built it with bunches of other things.
[12:54:17] <drgreenthumb> it's a guestimate.
[12:54:20] <CapnKernel> You can put your overlay management routines in the bootloader, and jump back to them at any time, like a BIOS
[12:54:27] <OndraSter> yep
[12:54:42] <OndraSter> I wish only that AVR could have interrupt addresses in RAM rather in flash :)
[12:54:53] <OndraSter> not in default for backward compatibility for example
[12:54:55] <CapnKernel> Vector them
[12:55:00] <OndraSter> I thought about that as well
[12:55:18] <CapnKernel> Vectoring is pretty fast on AVR
[12:55:22] <OndraSter> but all the projects I would ever do that for are far more than AVR can handle :)
[12:56:15] <OndraSter> still thinking about my pocket x86/NES/SNES emulator
[12:56:59] <Landon> well, SNES is its own problem on anything :P
[12:57:22] <Landon> http://arstechnica.com/gaming/2011/08/accuracy-takes-power-one-mans-3ghz-quest-to-build-a-perfect-snes-emulator/
[12:59:35] <OndraSter> Landon, okay, that was just example ;D
[12:59:41] <OndraSter> I was targetting some 450MHz ARM
[12:59:54] <OndraSter> with no OS running on it
[12:59:56] <OndraSter> just the firmware
[13:00:11] <OndraSter> and external CPLD as display driver
[13:00:19] <OndraSter> that would take care of the refreshing etc
[13:00:25] <OndraSter> or small FPGA
[13:00:51] <OndraSter> ARMs with external display driver and external memories are BGA only
[13:00:53] <OndraSter> and BGA sucks
[13:02:07] <CapnKernel> Re that NES emulator guy...
[13:02:15] <CapnKernel> ... I wonder if he's ever kissed a girl
[13:02:16] <specing> A great deal of a lot!
[13:02:17] <SuperMiguel> any one having a problem with winavr and avrstudio? mine is not being recognized and i have to go manually on each project and change it :S
[13:02:51] <specing> CapnKernel: girl? what kind of a mythical creature is that?
[13:03:15] <OndraSter> specing, I heard that they are the ones who make us food
[13:03:16] <OndraSter> :o
[13:03:41] <specing> Really?
[13:03:49] <OndraSter> at least here - yes
[13:04:10] <OndraSter> plus they are supposedly required for future generations of people
[13:04:13] <specing> :O
[13:04:17] <OndraSter> but I am still trying that out, can't be sure for sure!
[13:04:21] <specing> Nah, we can use cellular division
[13:04:24] <OndraSter> yet
[13:04:26] <OndraSter> :D
[13:04:39] <OndraSter> stil haven't managed to start a new generation
[13:04:58] <CapnKernel> My wife said that if I didn't do exactly what she says, she's be doing some cellular subtraction
[13:05:26] <CapnKernel> (sprry. crap grammar, just too late and too hot)
[13:06:52] <rhumbot> hi all. i think in my program _delay_ms is being skipped. http://pastebin.com/S2VEktcC what happens here is that PB1= high, PB0=low immediatly
[13:55:50] <rhumbot> could someone help me with the delay_ms problem? i believe i make a mistake when compiling my c code... avr-gcc test.c -o test.hex -mmcu=atmega8 -DF_CPU=10000000UL -g -Os -Wl,--oformat=ihex <- is there something wrong with this line?
[13:56:20] <specing> yeah, wtf is that commandline, I haven't seen anything like it
[13:56:35] <rhumbot> what is the problem?
[13:56:52] <specing> you make an elf
[13:57:06] <specing> you use objcopy to get the .hex
[13:59:34] <rhumbot> hm i am completely new to this. how should the command line look like?
[14:00:17] <rhumbot> since i can set the boards to high and low directly using this line i assumed it workes?
[14:00:59] <specing> avr-objcopy -O ihex -j .data -j .text $SOURCE $TARGET
[14:02:38] <CapnKernel> rhumbot: You've tried to do with one program what needs to be done with two
[14:03:59] <rhumbot> ok. how do i start? when usding the line above i get an error: avr-objcopy:test.c: File format not recognized
[14:04:29] <CapnKernel> Now you're trying to do with the other program, what needs to be done with two! :-(
[14:04:39] <rhumbot> :D
[14:05:03] <CapnKernel> You need to invoke two commands. The first is avr-gcc, the second is avr-objcopy
[14:05:24] <rhumbot> the first one is the avr-gcc line i posted above?
[14:05:34] <CapnKernel> Yes, but not as you wrote it
[14:06:03] <CapnKernel> What you're trying to achieve is for avr-gcc to take test.c, and produce an "ELF" file.
[14:06:16] <CapnKernel> Then avr-objcopy will take the ELF file, and create a .hex file
[14:06:23] <rhumbot> i see
[14:07:34] <specing> A couple of days here and rhumbot will become clarvoyant ;D
[14:08:58] <CapnKernel> rhumbot: I kind of get the idea you might be copying something wrong from somewhere, or having trouble messing around with a Makefile
[14:09:05] <CapnKernel> Can you tell us a little more about what you're doing?
[14:09:18] <CapnKernel> If you're using a web page as a guide, please show us the web page
[14:10:37] <rhumbot> im not using a makefile :/... i tried to follow this tutorial: http://www.mikrocontroller.net/articles/AVR-GCC-Tutorial
[14:10:42] <rhumbot> a) its in german
[14:11:07] <rhumbot> b) i could not find a tutorial to complie the code manualle on linux
[14:11:53] <rhumbot> to be honest i dont remember where i got the avr-gcc line from.
[14:11:55] <Landon> http://www.sax.de/~joerg/mfile/ this is what I use for my AVR compiling needs
[14:13:14] <specing> rhumbot: Don't use Makefiles, they are evil archaic crap
[14:14:03] <Landon> specing: what do you suggest instead of makefiles?
[14:14:18] <CapnKernel> rhumbot: Do use makefiles, they are a well-tested method of constructing software
[14:14:32] <specing> Landon: SConstruct/Scons
[14:16:30] <Landon> is there an avr scons file generator? that's why I use mfile, so I don't have to dinker with Makefiles
[14:16:52] <CapnKernel> Scons is academically better than makefiles (same could be said for cmake), but out there in the real world, people use makefiles
[14:17:11] <CapnKernel> rhumbot: Here's a blog article I wrote which is quite similar to what you're trying to do: http://capnstech.blogspot.com/2010/11/usb-doodad-4-blinkenleds.html
[14:17:56] <rhumbot> thank you CapnKernel i will look into it
[14:18:03] <CapnKernel> With a little alteration (my processor and speed is different to yours), you could cut and paste the command lines
[14:24:14] <rhumbot> CapnKernel it works now. thanks a lot. i guess now its time to find out WHY it works :)
[14:24:50] <CapnKernel> You're welcome. I'm happy to hear the first, glad to hear the second!
[14:25:10] <CapnKernel> I have done a lot of work with makefiles
[14:25:39] <specing> ...
[14:26:13] <CapnKernel> They do take some time to learn, so if you're not up to that yet, best if you can find a working example, and edit it to suit your needs
[14:28:47] <specing> rhumbot: http://www.pastie.org/private/prl8jt7rwlu5l5ahknkz7q
[14:28:56] <specing> My SConstruct for AVRs
[14:29:31] <specing> It will build both C and C++
[14:29:42] <specing> and I think mixing is posible
[14:30:37] <CapnKernel> Does it avoid rebuilding stuff if it's not necessary?
[14:31:38] <specing> Yes
[14:31:57] <specing> By SHA1 hash
[14:32:33] <CapnKernel> If test.c #includes foo.h which #includes bar.h, and bar.h gets changed, does that trigger a rebuild of test.c?
[14:32:49] <specing> yes, it tracks deps too
[14:32:54] <CapnKernel> In other words, is it aware of dependencies ?
[14:33:09] <CapnKernel> If the flags used for compiling change, does this trigger a rebuild?
[14:33:10] <specing> In a SQLITE database
[14:33:27] <specing> Dunno, I guess
[14:33:41] <CapnKernel> Can it be parallelized across CPUs?
[14:33:57] <specing> It probably does that automaticaly
[14:34:23] <specing> yes, it has -j option
[14:34:30] <CapnKernel> curious
[14:34:41] <CapnKernel> Especially attractive because I like Python
[14:34:43] <OndraSter> CapnKernel, about this dep trigger rebuilding -- this is bug in atmel studio 6 :)
[14:34:47] <OndraSter> reported it week ago
[14:34:55] <CapnKernel> It's a Hard Problem
[14:34:57] <OndraSter> but ONLY for mixing ASM and C files
[14:37:26] <specing> Ok, it is not an sqlite3 db
[14:37:30] <specing> Not sure what it is
[14:37:48] <specing> But it works, so...
[14:40:13] <CapnKernel> One of the nice things about makefiles is that you don't have to think about the sequencing needed to build things. Given enough rules, it's make's job to take care of sequencing.
[14:40:33] <CapnKernel> From the example you gave, it seemed that sequencing isn't done for you.
[14:40:42] <specing> ?
[14:41:51] <CapnKernel> Is it a python program, or something that just looks very convincingly like a python program?
[14:43:58] <specing> python.
[14:44:07] <specing> you can do whatever you want in it
[14:44:42] <CapnKernel> Then like every python program, sequencing is inherent in the order you write things in the program
[14:45:08] <CapnKernel> Whereas in a makefile, you don't specify sequencing
[14:45:17] <CapnKernel> Or I should say, you don't need to
[14:45:33] <specing> No
[14:45:54] <specing> You first populate the build info, then it decides how to proceed
[14:46:10] <specing> the whole SConstruct executes _BEFORE_ any building is done
[15:37:14] <Xata> so here i am.
[15:37:26] <Xata> guys - what am i doing wrong? http://pastebin.com/D5UGN48B
[15:38:48] <Xata> that spi is not as easy as i thought it will be. portb0 is supposed to be CS.
[15:48:56] <Xata> anybody?
[15:49:05] <OndraSter> what's the issue?
[15:49:57] <OndraSter> what's it supposed to be doing?
[15:50:34] <OndraSter> this sets PB0 low, sends 0000 1000 ____ _____ (sine wave data) PB1 high
[16:09:37] <Xata> OndraSter: first it has to send 0001 0000 and then the value of sine generator
[16:09:48] <Xata> but it does not, yep?
[16:09:51] <OndraSter> hmm
[16:10:22] <Xata> so that should be 16-bit data 0001 0000 nnnn nnnn
[16:10:23] <OndraSter> try it in simulator
[16:10:36] <OndraSter> yes, my fault, it is 0001 0000
[16:10:36] <drgreenthumb> Xata, tried it outside of the ISR? one less variable to go wrong.
[16:11:39] <drgreenthumb> Xata, oh. or I guess check if the CS output is actually toggling.
[16:12:38] <drgreenthumb> Xata, and nothing is driving the SS pin low, correct? because that will put it in slave mode.
[16:13:53] <Xata> drgreenthumb: cs output has to be low when i am sending data and high when i sent, pinc0 is supposed to act as cs for digipot. i did not touch ss
[16:14:16] <drgreenthumb> yes I know what CS is *supposed* to do Xata. I'm asking you to confirm that it's happening.
[16:14:32] <drgreenthumb> also just making sure that nothing is connected to the SS pin
[16:14:53] <Xata> it is not connected, now i go and simulate that guy
[16:15:58] <drgreenthumb> i have had this line: while(!(SPSR&(1<<SPIF))); lock up before
[16:16:24] <drgreenthumb> it happens with something is wrong with the slave settings I believe.
[16:16:48] <drgreenthumb> so if CS is stuck low
[16:17:00] <drgreenthumb> then that loop is frozen up
[16:17:14] <drgreenthumb> which is why I asked you to check
[16:31:02] <Xata> drgreenthumb: you know what? look like something happends around generate_sine. it sends data, and cs works ok, but it _always_ sends 0001 0000 and 1000 0000 in one 8-bit word. maybe some conversion error? also avr studio's debugger halted on second while(!(SPSR&(1<<SPIF))); which comes right after generate_sine
[16:31:21] <Xata> *in one 16-bit word
[16:31:53] <drgreenthumb> just try hard coding some value for a test
[16:32:25] <Xata> yeah.
[16:32:35] <drgreenthumb> make sure your communications are working before getting fancy with what you send ;)
[16:36:31] <Xata> drgreenthumb: i am testin in proteus isis. also yes - hardcoded values work ok. than what's wrong with my sine generator? i use this function to generate sine in other application and it works 100%ok
[16:37:05] <drgreenthumb> it's borken! heh I have no idea
[16:37:20] <drgreenthumb> read it and it looked okay to me
[16:38:33] <drgreenthumb> oh heh
[16:38:38] <drgreenthumb> are you actually advancing position?
[16:38:53] <drgreenthumb> oh nm I see it.
[16:39:31] <Xata> drgreenthumb: daaamn, i found a mistake :D
[16:39:55] <Xata> I send a _pointer_ to set the wave position, not just int
[16:40:18] <Xata> so &wave_pos1 instead of just wave_pos1
[16:40:54] <drgreenthumb> oh haha oops yeah generate_sine wants pointer
[16:40:55] <Xata> no it works at least in emulator. yaaaay
[16:41:12] <Xata> *now
[16:41:14] <drgreenthumb> always read compiler warnings ;)
[16:41:31] <Xata> got to programm and test, afk for 5 minutes
[16:48:42] <Xata> drgreenthumb: Vss and Vdd - what is gnd and +5v
[16:48:45] <Xata> ?
[16:51:58] <drgreenthumb> vss = gnd, vdd = power. I think vss means "voltage source sink" but don't quote me :)
[16:52:54] <OndraSter> YESS
[16:52:54] <drgreenthumb> that's what I always think when I read it anyways.
[16:52:56] <OndraSter> init is booting
[16:52:59] <OndraSter> OpenRC 0.9.8 =)
[16:53:04] <OndraSter> I AM MASTER
[16:55:05] <specing> You are?
[16:55:25] <OndraSter> yes!
[16:55:30] <OndraSter> now I can do emerge -avuDN world :D
[16:57:38] <specing> Cool
[16:57:53] * specing is updating his ARMv5tel AT91 Gentoo tree atm
[16:58:11] <OndraSter> :D
[17:06:37] <Xata> so that dumb question once again - how do i set and unset first bit of port without touching others?
[17:08:30] <OndraSter> SBI/CBI
[17:08:39] <OndraSter> but if you mean C...
[17:08:54] <OndraSter> PORTC |= 1;
[17:09:03] <OndraSter> PORTC &= 0xFE;
[17:09:41] <drgreenthumb> or write it nicely :P PORTC |= (1 << PIN0); PORTC &= ~(1 << PIN0);
[17:09:47] <OndraSter> :)
[17:10:36] <drgreenthumb> I do that even if the shifting is unnecessary. compiler will fix that. and it's easier to change later.
[17:10:55] <drgreenthumb> truth be told it should actually be a configurable macro :P
[17:11:01] <drgreenthumb> both pin and port
[17:12:35] <Xata> strange thing - it does not damn work.
[17:12:55] <drgreenthumb> that's what I do in makefile :) http://pastebin.com/Ks7DLS8H
[17:13:09] <drgreenthumb> what doesn't work exactly?
[17:13:25] <OndraSter> drgreenthumb, on Xmegas it is built in
[17:13:27] <OndraSter> register
[17:13:30] <OndraSter> bits you want to clear or set :)
[17:15:09] <Xata> drgreenthumb: i have this output from mega http://img560.imageshack.us/img560/5826/65853446.png
[17:15:20] <drgreenthumb> OndraSter, how does xmega know where I connected wake and reset of my MRF24J40MA. that's pretty magical :P
[17:15:46] <OndraSter> what? :D
[17:15:46] <drgreenthumb> waveform looks fine
[17:15:52] <Xata> so i works as i understand. maybe you _please_ have a look at MCP41010 datasheet and tell me how am i supposed to connect it?
[17:15:56] <drgreenthumb> is that simulated or measured Xata ?
[17:16:07] <Xata> drgreenthumb: simulated
[17:16:10] <drgreenthumb> heh
[17:18:47] <drgreenthumb> Xata, pin1 chip select; pin 2 clock; pin 3 data in; pin 4 ground; pin 7, 6, 5 are the potentiometer; 8 5v+
[17:19:18] <drgreenthumb> and looks like 6 is the pot wiper
[17:19:48] <drgreenthumb> so maybe 7 = +5v and 5 = gnd? or ... are you using as a rheostat? how are you measuring it?
[17:19:52] <Xata> drgreenthumb: hm... i've connected led to pinb0 and it just lights up really bright once and nothing than happends
[17:20:13] <drgreenthumb> you do know how to use a potentiometer right?
[17:20:19] <Xata> yup...
[17:20:37] <drgreenthumb> what's on pa0?
[17:20:44] <Xata> i need this stuff to replace the resistance in filter
[17:21:04] <drgreenthumb> and what's on pw0? are they floating?
[17:21:17] <Xata> and i've connected one of pot pins and wiper to in and other one to out
[17:21:32] <Xata> pa0 is cs
[17:21:37] <Xata> pw0?
[17:21:43] <drgreenthumb> whoa what?
[17:21:53] <drgreenthumb> pa0 cs?
[17:21:57] <drgreenthumb> why?
[17:22:00] <Xata> oh now
[17:22:02] <drgreenthumb> just ground it
[17:22:03] <Xata> pb0
[17:22:11] <drgreenthumb> nonono
[17:22:14] <drgreenthumb> not on the AVR
[17:22:14] <Xata> pa0 is adc to set osc ration
[17:22:25] <drgreenthumb> on this datasheet you *just* asked me to read
[17:22:31] <drgreenthumb> is pins PB0 and PA0
[17:22:38] <drgreenthumb> they are NOT AVR pins
[17:22:48] <Xata> oh, about this
[17:23:14] <Xata> i've connected wiper to pa0 and analog input to resistance
[17:23:27] <Xata> pb0 is output back to op-amp
[17:24:13] <Xata> i mean analog input -> (wiper+pa0) -> ic -> pb0
[17:24:57] <Xata> also it has some very strange resistance of ~half it should have
[17:25:25] <Xata> and instead of moving it just beeing static. maybe i burned it out?
[17:25:50] <OndraSter> so call me maybe!
[17:26:06] <Xata> OndraSter: wat
[17:26:31] <drgreenthumb> so it's wired as a rheostat then ok. here's how I would test this: just make a program to set it to some easy to test value like 3/4 or 1/8 resistance, and do not change the value. then just use a cheap multimeter to test resistance. this will verify your communications.
[17:27:39] <drgreenthumb> oh hrm will that work? bleh multimeter ohmmeters are powered aren't they?
[17:28:22] <drgreenthumb> Xata, "lights up really bright once" ... and then what? goes dark?
[17:28:56] <drgreenthumb> oh and you were talking about your chip select?
[17:29:02] <drgreenthumb> heh well clearly that is not right
[17:29:21] <drgreenthumb> Xata, #include <util/delay.h> and then _delay_ms(250); put a few of those in to slow it down
[17:30:02] <drgreenthumb> if you're going to verify by LED it needs to be slow enough :P
[17:36:07] <mimcpher> Should I reti(); or return; from an ISR if it ISN'T declared as ISR_NAKED
[17:36:53] <Steffanx> No
[17:37:23] <Xata> drgreenthumb: should digipot show resistance when it is fully turned off?
[17:37:43] <Xata> i mean when it is not in circuit at all, no even power
[17:37:55] <drgreenthumb> heh no idea.
[17:38:33] <Xata> it shows 8kohms as reostat when i just hold it in hands
[17:39:23] <drgreenthumb> perhaps the potentiometer circuit is independent from the digital part and it's the last value that was set.
[17:40:18] <Xata> drgreenthumb: i tried another one. it is in middle value too
[17:40:54] <Xata> i start to hate this spi stuff, argh
[17:41:40] <Xata> drgreenthumb: maybe something with compiler? i had such trouble before
[17:41:41] <drgreenthumb> heh just slow down and check everything one pin at a time. make sure the outputs look like those pretty simulation waveforms.
[17:42:09] <drgreenthumb> if you have a logic analyzer it would help, but you can check everything with LEDs. I do that ;p
[17:42:38] <drgreenthumb> or some AVR boards come with serial comms, they can help for debugging too. you can read the state of the pins and send em back.
[17:42:40] <Xata> how do slow i down? wit _delay&
[17:42:51] <drgreenthumb> _delay_ms(num_milliseconds)
[17:42:59] <drgreenthumb> #include<util/delay.h>
[17:43:29] <drgreenthumb> oh and #define F_CPU 1000000 <- you probably need that too
[17:43:43] <drgreenthumb> tell it what speed you're running at
[17:43:48] <Xata> i heard there are some limitations and ms depend on quartz speed, i have 16mhz
[17:43:57] <drgreenthumb> ah
[17:44:04] <drgreenthumb> did you set the fuse for clock 1x?
[17:44:17] <drgreenthumb> if not, it's divided by four
[17:44:23] <Xata> fuses are set to use external quartz
[17:44:34] <drgreenthumb> yes but there is also a clock divider
[17:44:48] <Xata> yes? what fuse? how called?
[17:45:04] <Xata> will be bac in 15 minutes
[17:45:59] <drgreenthumb> oh. divided by 8 not 4. I forgot =)
[17:50:18] <drgreenthumb> oh heh maybe not all AVRs have that? heh I'm too used to the USB ones.
[17:50:29] <drgreenthumb> which avr is it Xata ?
[17:52:42] <Xata> drgreenthumb: atmega32a
[17:52:50] <drgreenthumb> here you can see CKDIV8 http://www.ladyada.net/learn/avr/fuses.html
[17:53:14] <drgreenthumb> yeah hmm I just looked at the mega32 datasheet and I don't see one. perhaps it doesn't have one.
[17:53:31] <Xata> i have it O_O
[17:54:44] <drgreenthumb> heh well anyway, _delay_ms() will be off if F_CPU is not set right
[17:54:55] <drgreenthumb> try it at 16 million and see what happens
[17:55:41] <drgreenthumb> heh just try to get an LED blinking on your AVR first before trying SPI. word to the wise ;p
[17:59:57] <Tom_itx> how wise are noobs?
[18:01:03] <OndraSter> specing, how much are you gentoo geek? :D
[18:01:29] <OndraSter> I need to edit configure a configure.in files in one package after it gets unpacked
[18:01:45] <OndraSter> something like applying custom patch? :D
[18:02:49] <specing> /etc/portage/patches/
[18:03:20] <OndraSter> well I need to create one..
[18:03:27] <OndraSter> I need to get rid of RUSER in shadow
[18:03:52] <Landon> are you dorking around with LDAP?
[18:04:03] <OndraSter> no
[18:04:11] <OndraSter> I am just trying to setup small system
[18:04:18] <OndraSter> and there is some error about ruser
[18:05:03] <OndraSter> ../libmisc/libmisc.a(rlogin.o): In function `do_rlogin':
[18:05:03] <OndraSter> rlogin.c:(.text+0x16b): undefined reference to `ruserok'
[18:06:51] <drgreenthumb> Xata, and seriously dude, turn off interrupts and put the SPI output routing inside the while() in main for testing. once you're sure everything's working, convert it to ISR/timer based.
[18:07:22] <drgreenthumb> s/routing/routine/g
[18:08:02] <Xata> drgreenthumb: this is not the main problem anymore. what if i set all cksel fuses to zero?
[18:08:40] <drgreenthumb> that's fine if you actually have a crystal oscillator
[18:09:39] <drgreenthumb> "External Clock 0000" from ATmega32 sheet. so that's fine. set F_CPU to 16 mil.
[18:10:01] <Xata> drgreenthumb: but it does not responde anymore
[18:10:09] <drgreenthumb> even to programmer?
[18:10:15] <Xata> yup
[18:10:20] <drgreenthumb> what have you done?! DX
[18:10:35] <drgreenthumb> heh got another to test with?
[18:10:46] <drgreenthumb> you might have bricked it
[18:10:55] <Xata> yes. i have 100% working another crystall
[18:11:42] <drgreenthumb> I think fuses can only be reset with high voltage programming under certain circumstances. you seem to have discovered what they are.
[18:12:51] <Xata> "External Clock means that a square wave is being input into the CLOCK-IN pin. This is pretty rare unless you have a clock generating chip. Don't use this unless you're sure you mean to"
[18:13:31] <Xata> Maybe i generate square on one atmega to start another?
[18:15:44] <Xata> maybe i will. another day. for today this is enough for me.
[18:16:56] <drgreenthumb> oh right heh oops
[18:17:11] <drgreenthumb> you wanted 1111 - 1010
[18:17:19] <OndraSter> YESSS
[18:17:24] <OndraSter> appearantly one has to add "rpc" to uclibc...
[18:17:34] <drgreenthumb> if you have another AVR perhaps you could make it into a clock generator?
[18:17:50] <drgreenthumb> just to rescue the first one
[18:19:11] <Xata> yes i will do this. not tomorrow, but next week. i had enough sex with avr for 3-5 days today
[18:19:22] <OndraSter> sex with AVR
[18:19:22] <OndraSter> mmmm
[18:19:24] <OndraSter> nassty
[18:19:26] <OndraSter> kinky!
[18:19:47] <Xata> and the only ones can afford
[18:49:44] <Xata> gtg, bye
[18:56:10] <OndraSter> woah
[18:56:17] <OndraSter> I HAVE SUCCESFFULY CREATED EBUILD
[18:56:18] <OndraSter> and PATCH
[18:56:22] <OndraSter> I am k3wl
[18:57:27] <OndraSter> aaaand PAM compiled just fine
[18:57:31] <OndraSter> with my INNETGR PATCH
[18:57:32] <OndraSter> woot
[18:57:35] <OndraSter> where can I submit those?