#avr | Logs for 2014-02-06

Back
[02:04:08] <RazLaptop> What is the minimum memory requirement / chip I should consider if I intend to program my AVR in C?
[02:04:28] <RazLaptop> The 512B chips are nice and cheap, but I doubt a C program will fit..
[02:04:40] <RazLaptop> Looking at an attiny85 atm
[02:10:31] <johnwalkr> attiny85 is really useful
[02:10:39] <johnwalkr> and good for support/examples
[02:11:07] <RazLaptop> johnwalkr, can I use C for it, or should I be using assembler with that size chip?
[02:11:19] <RazLaptop> I'm new to this so I"m trying to set up my learning path
[02:11:54] <johnwalkr> you can use c
[02:13:37] <johnwalkr> even the smaller ones you can use c but obviuously there’s limited space
[02:15:35] <RazLaptop> johnwalkr, ahh ok ty :)
[02:48:41] <hjohnson> of course, project i'm workign on right now is an xmega128a1u
[02:48:47] <hjohnson> with 128KB of external RAM
[04:07:01] <khorght> hi,guys. can somebody send me dumps mentioned here http://www.ruemohr.org/docs/debugwire.html
[04:57:05] <Knaldgas> Hmm, error in ATMEGA168p datasheet. Can anybody confirm the following?: XCK is driven by USART SPI as soon as UMSEL0 and UMSEL1 is set. Datasheet page 202 (21.3) claims that this will happen (only) when TXENn and RXENn is set to one.
[08:03:52] <tomatto> hi
[08:07:22] <tomatto> when my power supply gave 7V to AVR and even with 5V supply doesn't respond to spi communication, it means avr is dead?
[08:44:37] <Roter> Well, its me again, i have a problem with my Atmega88, the code: http://pastebin.com/sV2xzzjW , is that the led blinks every 2 seconds. It should blink every second. What do i do? I have set the speed to 8Mhz, and the fuses are here: http://imgur.com/1ocVBoZ .
[08:46:36] <tomatto> Roter: try use this #define F_CPU 8000000UL
[08:47:43] <Roter> still 2 seconds
[08:52:57] <tomatto> so you wants set high for 100ms and then 900ms turned off
[08:53:05] <Roter> yeah
[08:53:40] <Roter> i have set the isp clock to 200khz
[08:53:49] <Roter> that might be the problem
[08:54:23] <Roter> also there is a setting in atmel studio, to change the clock generator, its now at 3.686 MHZ
[08:56:40] <tomatto> set it to 8MHz then
[08:57:00] <tomatto> i am not really familiar with atmel studio
[08:57:45] <Roter> i cant set the clock generator that high, the max is 3.686 Mhz
[08:58:01] <Roter> and i dont see a way to lower the internal clock speed
[09:00:08] <tomatto> isn't it spi freq?
[09:03:29] <Roter> well i dont realy know what spi is, so i googled it, and it seems it would need SS to be used, while i only have MOSI, MISO, SCK, GND, VDD,RESET(not used)
[09:04:56] <tomatto> spi is for uploading/downloading your code/fw to/from avr
[09:05:19] <twnqx> or for communication with other spi devices.
[09:05:24] <tomatto> yes
[09:05:44] <tomatto> of course
[09:06:14] <tomatto> reset is needed there
[09:07:11] <Roter> clock generator settigs: http://imgur.com/2ROtOTd
[09:07:47] <Roter> so what does reset do exactly? it came unset in the fuses
[09:08:09] <Roter> oh no wait
[09:08:14] <Roter> its actualy enabled
[09:08:44] <tomatto> i mean device reset pin and spi is needed for programing
[09:10:39] <tomatto> try fuse low set to D2
[09:10:47] <Roter> i might have done something wrong, i tryed to set reset to disabled....
[09:10:57] <Roter> and now it says:
[09:11:12] <Roter> unable to enter programming mode
[09:11:39] <tomatto> Reset Disabled (Enable PC6 as i/o pin); is not good option
[09:12:10] <tomatto> when you uploading fw via spi
[09:12:15] <tomatto> and reset pin
[09:12:17] <Roter> yeah, im trying to make it like it was before, but its not letting me
[09:14:03] <tomatto> because you set reset pin to be regular i/o pin...nobody told you that
[09:14:45] <Roter> so i am screwed?
[09:14:53] <Roter> yeah i know, i was just interested
[09:15:23] <tomatto> you need HVSP or parallel programer
[09:16:12] <tomatto> for setting correct fuses now, i suppose
[09:16:50] <tomatto> when you disabled reset pin...
[09:17:11] <Roter> well, you live you learn..
[09:17:22] <Roter> so what is a popular mcu?
[09:17:32] <Roter> that might not have this problem
[09:17:43] <Roter> i mean the problem with the clock
[09:17:43] <tomatto> ?
[09:18:35] <tomatto> as i said try set low fuse to D2...running out ideas
[09:20:36] <Roter> and how would i be able to do that? Also, i have set the reset pin to disabled, so i cant change the fuses
[09:23:20] <tomatto> Roter: as i said you will need high voltage serial programmer or parallel programmer to set that reset pin back or use next mcu
[09:23:59] <Roter> yeah, i dont have neither of them, so any reccomendations for a mcu?
[09:25:01] <tomatto> my favorite is atmega8, but atmega328 is way more cool
[09:25:25] <Roter> cool for its features? or the speed or what?
[09:26:13] <tomatto> more flash
[09:26:42] <tomatto> it is used in arduino
[09:28:54] <Roter> lol
[09:29:03] <Roter> it cost less then my mcu
[09:29:22] <Roter> anyway, what is the difrence: ATMEGA328P-AU TQFP32 RoHS and ATMEGA328P-PU
[09:29:40] <Roter> cant realy see any extra space or anything
[09:29:50] <tomatto> smd or dip
[09:30:05] <Roter> lol
[09:30:10] <Roter> didnt notice the picture
[09:30:32] <Roter> ok, will return here tommorow, and hope, it will be a better day
[09:31:52] <tomatto> my power supply gave avr 7V and it doesn't response anymore...
[09:36:26] <twnqx> kind of expected
[09:40:40] <tomatto> twnqx: so dead, right?
[09:40:54] <tomatto> i thought that 7V isn't too much
[09:41:55] <twnqx> yes, it is
[09:42:01] <twnqx> 5V is the normal upper limit
[13:49:32] <awozniak> Is anyone familiar with the Xeltek superpro 5000 programmer?
[13:55:03] <myself> nope. I've got a tl866cs which is the darling of the eevblog forums, and haven't looked back
[13:59:31] <hjohnson> I'm still debating whether I should delete the JTAG interface from my project
[13:59:34] <hjohnson> and just go with PDI
[14:12:03] <PoppaVic> myself: yougot a link that explains that tl866cs thing? my surfing is like 300bps lately
[14:12:57] <myself> PoppaVic: this is abzman's writeup, it's as good a starting point as any: http://abzman2k.wordpress.com/2013/06/12/upgrading-the-tl866cs-or-misadventures-with-pics/
[14:15:33] <PoppaVic> OK, cool - been reading that as it slowly loads pics. So, this is a ZIF-based eeprom/pic/avr/whatever programmer?
[14:48:05] <myself> PoppaVic: yup. and you can get it with adapters for all sorts of sockets, including one with shift-registers or some god-awful thing so it can work with TSSOP-48 flash chips
[14:50:38] <PoppaVic> weirdness
[14:55:52] * hjohnson is looking forward to playing with his xmega
[14:56:00] <hjohnson> once I actually get the hardware built
[14:58:49] <PoppaVic> something was weird with xmega.. volts? I forget
[15:21:04] <hjohnson> heh
[15:21:27] <hjohnson> https://www.dropbox.com/s/c6d3khc3z6aj2m4/Screenshot%202014-02-06%2003.37.52.png that's the board layout for my project
[15:25:56] <synic> welp that looks like it was a pain in the ass to lay out
[15:26:32] <synic> how do you make something like that without having like 10 throwaway boards?
[15:26:53] <braincracker> piece of cake
[15:27:09] <braincracker> bake it
[15:27:45] <amee2k> looks like the "big stuff" there is mainly a bunch of moderately small parallel busses
[15:29:46] <PoppaVic> synic: you use someones software, autorouting, libraries of devices, and scream a lot
[15:30:35] <amee2k> the birdseeds usually associate closely with one functional group... what tends to be annoying on one or two layers is routing power and ground
[15:31:18] <amee2k> because these tend to branch out from one or a few spots to almost everywhere, creating a lot of routing hazards with signal connections
[15:31:33] <synic> PoppaVic: I have all of that stuff, but even for a much simpler board, I made a bunch of non-functional ones
[15:32:07] <PoppaVic> I dunno "birdseed" but the more ugly one layer gets, the more you end up wishing for layers and via - and it's fairly tough to visualize well, if the software won't play
[15:32:52] <amee2k> it tends to get a lot easier if you can dedicate one layer to just routing ground and power
[15:33:07] <synic> granted, it was my first attempt, but it seems really easy to make simple mistakes
[15:33:11] <PoppaVic> synic: I ain't an EE - and never made a PCB at home. That said, I've photoplotted and laminated boards at the shop between a buck and $5000 each. It can be a lot of fun, if yer income will cover it ;-)
[15:33:54] <PoppaVic> I can see where you really, really needd to get the design done on breadboard and protoboard first.
[15:34:07] <amee2k> an easy way is to use the "X-Y trick"... route everything in only horizontal and vertical directions, then put all vertical segments on one layer and all horizontal segments on another (and place vias appropriately where directions change)
[15:34:18] <PoppaVic> yeah, I've seen that
[15:35:28] <synic> does anyone ever actually use an autorouter? I've only done one PCB and that autorouter seemed like a bad idea
[15:35:59] <synic> IE, it connected things in places I didn't expect at all
[15:36:32] <amee2k> autorouters can be effective, but finding the right settings is tricky.
[15:37:16] <amee2k> on some autorouters i heard it is also important to properly tag ground, power and signal connections
[15:37:53] <synic> It was probably my own fault, but the autorouter seemed to want to skip my filter caps, even though they were correct in the schematic
[15:38:40] <amee2k> o.o
[15:39:26] <amee2k> yeah, that sounds like something that only looked correctly (but the schematic editor didn't recognize as connected electrically)
[15:39:44] <synic> instead of battery--->Filter Cap--->Load, it would wire it battery---->Load--->Filter Cap
[15:39:53] <amee2k> oh
[15:40:08] <amee2k> well, schematics have no concept of ordering connections
[15:40:28] <hetii> Hi :)
[15:40:29] <amee2k> everything on the same "net" needs to be connected together... somehow.
[15:40:40] <synic> seems like that sort of thing could throw the autorouter off every time, no?
[15:40:52] <amee2k> i usually route the most critical signals manually, then let the autorouter sort out the rest
[15:41:13] <synic> ah, yeah, that's what I ended up doing
[15:41:32] <amee2k> although, if you nicely place the bypass caps next to the intended components, the autorouter *tends* to get it right
[15:42:11] <hetii> Is it possible to build on atmega128 and enc28j60 server that will play sound streamed from PC or is it to weak hardware ?
[16:06:54] <hjohnson> synic: by being very careful, doing a full schematic->layout capture
[16:07:02] <hjohnson> and relying on the DRC/ERCs to produce something that's sane
[16:07:06] <hjohnson> and then triple-checking every single IC
[16:08:58] <amee2k> hetii: i'd say it'll handle 44.1/16/2 PCM audio just barely... you'll do yourself a favour if you go up a notch and get a bealgeboard or something that can run a regular network audio transport
[16:11:27] <hetii> even when i use dac like tda1541 ??
[16:12:39] <amee2k> well, you can kinda forget about decoding MP3 or OGG or something like that
[16:12:53] <amee2k> at least not without adding some external decoder chip
[16:13:09] <hetii> yep I know that :>
[16:13:24] <PoppaVic> I'd certainly think an mp3 module would make all the diff.
[16:14:04] <amee2k> i'd say it should barely manage decoding a UDP stream and feeding it into the DAC, but thats about it
[16:14:09] <hetii> Well in this days there is no problem to buy a cheap board that can do a lot of nice thing, but i just wondering if its possible to implement such device on simple avr :-)
[16:16:37] <PoppaVic> I suspect there is an awful lot of dick-around in converting an mp3 or whatever to lousy tones. So, it'd be specialized
[16:18:18] <hetii> General my idea was to build on pc client that will get all streams from pulseaudio and trancode it to raw PCM and then push via UDP to my board...
[16:18:23] <amee2k> i only disected OGG in detail (and not MP3) but you need to uncompress an entropy coder compression, and then do an inverse cosine transform with appropriate window overlap
[16:18:58] <amee2k> some parts of it need 64 bit fixed-point arithmetic with multiplications... thats painfully slow on an 8-bit CPU
[16:19:41] <PoppaVic> ..and the math sounded depressing.
[16:20:44] <hetii> amee2k: but you talk about handling decoding on pure avr and i know its to weak to do this task. Thats why i consider to use it just like a bridge between enc28j60 and DAC/decoder
[16:21:38] <amee2k> as i said, just pushing PCM throug could work... its going to be fiddly though, and probably the most you can get out of it
[16:22:14] <hetii> hmm
[16:23:32] <hetii> ok then, if i get some DAC then will try prepare some test to see if and how it works :)
[16:24:54] <hjohnson> tbh, for something like that, why not just use an ARM of some sort?
[16:27:40] <hetii> other similar topic is that i will plan build lamp amplifier, that will be powered directly from electricity. Of course i cannot connect such device through wire to PC (to risky) Thats why i plan to use SPDIF optical fiber. Did some of you know some good DAC + additional chip that will handle this signal?
[16:28:50] <hetii> hjohnson: As i said there are many board in market but with enc28j60 was just and experiment :)
[16:28:58] <PoppaVic> well, at least it ain'tsteam-powered.What a relief.
[16:30:07] <hetii> hehe, yep :)
[16:34:54] <hetii> here is something interesting: http://community.fortunecity.ws/rivendell/xentar/1179/projects/adagio/Adagio.html
[17:16:02] <PoppaVic> Fortunately, I am not a whacko, closet-dwelling sonar-man with a collection of whale-song and lobster-talk.
[17:26:37] <learath> Why not?
[18:43:47] <hjohnson> man this is a huge coding project
[18:43:49] <hjohnson> fun but huge
[20:02:54] <hjohnson> hah this works
[20:06:09] <hjohnson> well it does at least based on reading the asm :P
[20:32:38] <hjohnson> damn this doesn't work
[20:32:48] <hjohnson> optimizations are optimizing out the stuff I need :P
[20:32:54] * PoppaVic chuckles
[20:33:29] <hjohnson> it's doing stuff in registers rather than in the memory location
[20:34:32] <PoppaVic> higher-level languages and optimizations are like that: fix it.
[20:34:46] <hjohnson> yep
[20:36:52] <hjohnson> so the question is how to fix it. :P
[20:53:11] <hjohnson> duh, make the register struct contents volatile
[20:53:17] <hjohnson> that forces the ocmpiler ot read/write from memory
[20:53:27] <hjohnson> and this shit is volatile anyhow :P
[20:54:16] <tomatto> when i have 8MHz clock and set 16bit timer with prescaler 8, it means that i have resolution 1us?
[20:55:29] <hjohnson> yep
[20:57:04] <tomatto> so when i set to OCR1A = TCNT1 + 4000; it means compare interrupt will come by 4000us ?
[20:58:31] <tomatto> 4ms
[21:02:21] <tomatto> hjohnson: is that right?
[21:05:05] <hjohnson> tomatto: yeah
[21:05:56] <hjohnson> man the xmega has so many mor eknobs and toys than the regular atmegas
[21:06:35] <tomatto> great, so something else is wrong then :(
[21:06:58] <PoppaVic> I can't recall yet seeing an arduinos-sized or even shield-capable xmega, though.
[21:08:47] <hjohnson> PoppaVic: yeah, but I don't really care about htat. :P
[21:08:50] <tomatto> i need to measure positive and negative halfs of sine wave and then make average...i am using timer capture pin interrupt
[21:08:52] <hjohnson> tomatto: are you starting the timer?
[21:09:59] <PoppaVic> hjohnson: I do. En-gi-neers care about docs and availability and capability. I watch prices and usability: when teetering on BROKE you can quickly fall over.
[21:12:29] <tomatto> hjohnson: yes, i am starting it in inicialization in main by setting CS11 of TCCR1B to 1 (atmega8)
[21:13:25] <hjohnson> I'm looking forward to get this built: https://www.dropbox.com/s/c6d3khc3z6aj2m4/Screenshot%202014-02-06%2003.37.52.png
[21:13:59] <hjohnson> though it's a $300 BOM, not including the satellite modem. :P
[21:22:03] <JFK911> hjohnson: did you fab the board yet
[21:22:09] <hjohnson> JFK911: not yet
[21:22:25] <hjohnson> still double checking and refining the design a little... want to get it right the first time
[21:22:38] <JFK911> yea? you changed much in the past two weeks?
[21:23:15] <hackvana> hjohnson: Nice design
[21:23:31] <hjohnson> JFK911: not much... I'm strongly considering deleting the JTAG connector though
[21:23:44] <hackvana> You can see what it will look like by uploading your gerber files here: http://gerblook.org/
[21:23:45] <hjohnson> JFK911: changed the way the chipselects work for the memory
[21:24:06] <hjohnson> hackvana: 4 layers
[21:24:22] <hjohnson> two signal, internal layers are +3V3 and GND
[21:24:27] <hjohnson> there are 3 total power rails
[21:24:37] <hjohnson> 3V3, 5V, and 4.1V
[21:25:39] <hjohnson> mixed signal too :P analog, RF, and digital
[21:26:11] <hackvana> You're gonna need those pours/ground planes :-)
[21:26:23] <hjohnson> hackvana: they're just hidden right now
[21:26:56] <hjohnson> JFK911: I'm probably going to do a two layer tank level sensor first as a test drive of my process
[21:26:59] <hjohnson> and skills
[21:27:18] <hjohnson> 2"x2" PCB with only a handful of components is much cheaper to fabricate than the monster
[21:27:46] <JFK911> make at home or send out to fab?
[21:27:54] <hjohnson> uh fab
[21:27:59] <JFK911> oh good
[21:28:04] <JFK911> you scared me heheh
[21:28:05] <hjohnson> part of the test involves doing some fine pitch QFNs
[21:28:13] <JFK911> good idea
[21:28:17] <hjohnson> want to test my soldering processes
[21:40:59] <hjohnson> going to use a AD7745 to do capacitive sensing of the tanks on my boat
[21:41:02] <hjohnson> (and tankage in general)
[21:41:23] <hjohnson> hurray for non-contact fluid sensing :)
[21:42:31] <hjohnson> i'm starting to write code though, which is a fun distraction...
[21:42:59] <hjohnson> i think i'm setting up the EBI right so fort