#avr | Logs for 2013-09-06

Back
[00:00:16] <ctin> yes, i did it all. Sorry for my english :)
[00:00:17] <N1njaneer> Also make sure OCDEN is disabled as well
[00:00:34] <ctin> that is my topic on AvrFreaks.net
[00:00:35] <ctin> http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=135899
[00:02:42] <N1njaneer> www.atmel.com/Images/doc8267.pdf‎ has some good information. This is technically for XMEGA but pretty much all the techniques apply to AVR.
[00:03:16] <N1njaneer> I had to do similar fiddling around to get some of the Atmel Zigbit modules to go down to their lowest rated power consumption, but it worked.
[00:04:09] <ctin> thank you very much!
[00:04:54] <N1njaneer> (but OMG if you need to do Zigbee'ish stuff right now do NOT use Atmel unless you are a masochist. Look at Digi's offerings on their XBee modules - a billion times easier to use and program. I've done both routes and wanted to shoot myself after working with the Atmel/Meshtel stuff. The XBee stuff got up and going right away and deployed perfectly without a single problem.) /SOAPBOX
[00:06:23] <ctin> okay. It's important for me.
[00:06:55] <ctin> I am currently using ATZB-900-B0 for Contiki in IPv6 project
[00:07:24] <N1njaneer> Atmel will be bringing out some far better 802.15.4 products in the future, but they are a little ways off right now.
[00:08:39] <N1njaneer> ATZB-900's.... Uggghhhhh. *shiver*
[00:09:00] <N1njaneer> Post-traumatic stress disorder just looking at them again :)
[00:09:20] <N1njaneer> But to stay on top, yes, make sure OCDEN and JTAG are disabled and you should see a huge drop in power consumption.
[00:11:03] <N1njaneer> ctin: If you get stuck with those modules, please check out http://www.digi.com/xbee/ as they have a fantastic product offering, and everything is already implemented in the on-board module. Programming is via AT-based commands or the binary API and they are super-easy to use, especially since you can plug the modules in to a little adapter board and hit them with any terminal software to query
[00:11:03] <N1njaneer> and debug. Digi's documentation is extremely clear and robust.
[00:11:41] <ctin> i programming ATZB through JTAG, so i can not turn off JTAGEN fuse :(
[00:12:08] <N1njaneer> Try disabling OCDEN if it's enabled.
[00:12:18] <ctin> okay, i will look at them)
[00:12:27] <ctin> OCDEN is disabled
[00:12:54] <ctin> i posted all fuses in my topic on forum
[00:13:20] <ctin> N1njaneer: there: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=1096723#1096723
[00:14:10] <ctin> it seems to be bad, because i can not turn of JTAG... okay, time to read datasheets :)
[00:14:34] <N1njaneer> Hmm, looking at my schematics for that project it was a ZDM-1281-B0 that I was using, but should be very similar.
[00:14:44] <N1njaneer> I used JTAG to program those as well.
[00:16:38] <N1njaneer> Anyhow, I know it's certainly possible. Just review over the items on that Atmel whitepaper I'd sent over and see if it helps.
[00:16:44] <N1njaneer> Back to soldering!
[00:18:16] <ctin> Ok! Thank you again!
[00:19:17] <ctin> <DEVIL\> i will turn off JTAG and put ATZB to death. AHAHAHAHAHA!!! Anyway i have more thanfive of them...
[03:09:46] <ctin> Ninjaneer: RF chip through SPI still responding. I'm trying to put RF212 into sleep mode;
[03:10:11] <ctin> so i think i found porble msource
[05:44:05] <ctin> eeee!
[05:44:12] <ctin> problem solved
[05:44:50] <ctin> it goes to sleep if I atfirst read state by SPI
[05:45:00] <ctin> so i get 100uA
[05:45:20] <ctin> if i can help - c.lyashkevich@gmail.com
[11:40:48] <ctin> hi all!
[11:41:15] <tdraket> Hi!
[11:41:34] <ctin> i am Qt programmer and i can help someone with Desctop programm, which works with MCU throuth MODBUS or other protocol
[11:50:00] <OndraSter_> hi all!
[11:50:36] <OndraSter_> I am Ondra and I am an alcoholic.
[11:53:06] <ctin> same problem)))
[12:08:46] <Steffanx> Isn't everyone in czech OndraSter_?
[12:10:50] <OndraSter_> well
[12:10:50] <OndraSter_> we are.. #1 in beer consumption per capita
[12:12:11] <ctin> i am Ctin and i am an programmerholic
[12:13:40] <crib> you mean programmoholic
[12:14:30] <ctin> yap.... ammmmm..... that was bad idea anyway
[12:14:39] <ctin> sorry for my English :)
[12:16:41] <ctin> today i did a big work - ipv6 battery modules
[12:17:21] <ctin> which works over year from one battery and contains ipv6 web-server
[12:32:07] <DrLuke> oh cool
[12:39:33] <ctin> yeah. Atmega was created by geniuses
[12:52:39] <braincracker> hmm ok
[12:53:00] <N1njaneer> ctin: AVR is certainly a fantastic architecture!
[12:53:40] <braincracker> let's say PIC was created by technicians then ;)
[12:53:54] <braincracker> PIC is fantastic too! it is fantastic that it actually works!
[12:55:58] <abcminiuser> braincracker, out
[12:56:00] <abcminiuser> Get out
[12:56:41] * abcminiuser lights a torch, grabs pitchfork
[12:57:49] <RikusW> abcminiuser: since when do you support to competition ? :-P
[12:57:50] <braincracker> ;>
[12:58:02] <RikusW> you'll get fired
[12:58:15] <abcminiuser> "><braincracker> PIC is fantastic too! it is fantastic that it actually works!"
[12:58:21] <braincracker> abcminiuser <= you don't say yous like PIC
[12:58:37] <abcminiuser> Oh wait
[12:58:44] <abcminiuser> Nevermind, too much rum and coke...
[12:58:53] <RikusW> lol
[12:58:57] <ctin> N1njaneer: yap! Hardware timers, hardware registers, asynchronys timers and interrupts.... it's amazing!
[12:58:58] <braincracker> i meant microchip's PIC MCU
[12:59:00] <braincracker> lol
[12:59:03] <braincracker> :)
[12:59:03] * abcminiuser is celebrating the weekend early at home with said grog
[12:59:35] <abcminiuser> Germany on Monday :S
[12:59:47] <abcminiuser> I'm not a big business trip person :P
[12:59:50] * braincracker eating rum-menthol-filled chocolates
[12:59:53] <RikusW> abcminiuser: seems like you're in need of Struh rum then :-D
[13:00:07] <abcminiuser> Speaking of Germany, is ehajo here?
[13:00:27] <abcminiuser> Well, I'm emptying the last of the rum I have in prep for the impending duty-free...
[13:00:27] <RikusW> 80%....
[13:00:59] <RikusW> any stronger and you can run a car of it :-P
[13:01:08] * braincracker saved a ddr memory today
[13:01:15] <abcminiuser> Hannes Jochreim, you here?
[13:01:26] <braincracker> it was covered in dust and giving memory errors
[13:01:28] <abcminiuser> I'm running on Captain Morgan spiced rum here...
[13:02:00] <N1njaneer> I heard that if you try to upload PIC code in to an AVR, the chip actually spontaneously ejects itself out of the socket (or desolders itself if SMT) and hovers over the board, rotating slowly, until the danger has passed. Just another feature that makes Atmel brilliant.
[13:02:04] <braincracker> gave it IPA bath
[13:02:30] <abcminiuser> Actually, it boots Windows ME
[13:02:35] <abcminiuser> Little known fact
[13:03:24] <RikusW> it seems that propanol is more potent than ethanol, iso-propanol is poisonous however....
[13:05:01] <N1njaneer> Only if you drink it.
[13:05:34] <braincracker> IPA metabolizes into acetone in your lungs...
[13:06:09] <braincracker> this is why IPA smells like acetone
[13:06:31] <RikusW> a ketogenic diet also cause acetone to be formed...
[13:06:55] <RikusW> its actually useful for some forms of epilepsy
[13:06:58] <braincracker> N1njaneer<= IPA is absorbed fast through skin too :) and you can breath it in too
[13:07:35] <braincracker> IPA ORAL (LD50): Acute: 5045 mg/kg
[13:08:17] <RikusW> 400g for 80kg person, thats a lot...
[13:08:19] <N1njaneer> We order 99.9% IPA here by the gallon. Good stuff. :)
[13:08:23] <RikusW> 2 cups ?!
[13:08:31] <abcminiuser> Indian Pale Ale?
[13:08:44] <abcminiuser> Can confirm, Norwegians drink it through their skin
[13:08:45] <RikusW> iso propyl alcohol
[13:08:49] <abcminiuser> Or at least, seems like it...
[13:09:21] <braincracker> i think you'd have problems after drinking 50ml 99.9% IPA
[13:09:45] <N1njaneer> It's a lot less dangerous than methanol, which we have gas-chromatagraph reagent grade stuff here for optics cleaning :)
[13:09:55] <ctin> N1njaneer: i programming MCU for Russian Power Plants... And all of them from Atmel :) So i hope they will not desolder from plate or burn ::))
[13:09:57] <braincracker> possible, that causes blindness
[13:10:19] <braincracker> but IPA metabolizes into acetone, that is not a cool stuff to drink either
[13:10:46] <diametric> Indian Pale Ale?
[13:11:07] <N1njaneer> The worst we probably have on hand here is full concentration nitric and sulphuric acid - great for making flash paper or gun-cotton. :)
[13:11:12] <ctin> N1njaneer: but i'v seen problem when two different MODBUS plates has protocol conflict, because they both was connected to Master. Alarm, guard with AK-74...
[13:11:23] <braincracker> Insanely Pure Alcohol :) IPA
[13:13:32] <N1njaneer> The best thing to do with IPA is to pour a little bit of it in to empty liquor bottles, shake it to get the vapor concentrated, then light the bottle. You get all sorts of interesting flames and noises depending on the shape ofthe bottle. Disaronno and Parrot Bay bottles work extremely well being square and boxy. They kind of do a cool "flub flub flub flub" effect.
[13:14:04] <braincracker> glass may explode
[13:14:06] <N1njaneer> Have shot that before with the high-speed camera here - you can watch the explosion happen, it nearly go out, contraction to draw in more air, and then reignition.
[13:14:09] <braincracker> not that fun
[13:14:20] <N1njaneer> Glass won't nearly explode from that.
[13:14:51] <braincracker> uneven heating creates internal stress in glass
[13:14:58] <N1njaneer> You don't do it with the top on. If the top isn't on you can't light it
[13:15:11] <braincracker> and it can build-up pressure
[13:15:33] <N1njaneer> Not in that short of a duration.
[13:15:52] <braincracker> i have tried this with a tiny capacitor case, filled it with IPA, Acetone, and lit it
[13:15:58] <N1njaneer> I blew glass for two years :)
[13:16:00] <braincracker> works like a little rocket-engine ^^
[13:16:17] <braincracker> 10-20 in flames
[13:19:05] <N1njaneer> brain: Self-destruct mode!
[13:44:18] <mark4_> does anyone have a direct download link for avr studio 6?
[13:47:02] <mark4_> nvm found one http://www.jayconsystems.com/tutorial/atmerpt1/
[13:49:26] <ctin> there very simple registration
[13:49:28] <ctin> do
[14:11:07] <mark4_> not interested in signing up for spam or giving atemel my email address so they can sell it to spammers
[14:11:17] <mark4_> and you will NEVER convince me neither of those happen
[14:11:29] <mark4_> i think its moronic to think it doesnt
[14:11:34] <mark4_> im not signing up for that crap
[14:16:59] <ctin> you can use 10-minutes mail
[14:17:38] <ctin> https://temp-mail.ru/ in russiab
[14:17:42] <ctin> *tussian
[14:17:44] <mark4_> !
[14:17:44] <ctin> fuck
[14:17:47] <ctin> russian
[14:17:59] <mark4_> lol never heared of that before. very useful but... russian... lol yea i trust them :P
[14:18:04] <mark4_> but its moot i found a link
[14:18:11] <mark4_> only it wont install under wine
[14:18:18] <ctin> okay
[14:18:32] <ctin> i thing in USA aviable too
[14:19:06] <ctin> i am using russian google and it shows me russian sites :)
[14:19:11] <ctin> just link "temp mail"
[14:19:13] <ctin> in google
[14:19:54] <ctin> very important that is temp mail is not "axcvgl;asdfl;hg"
[14:20:08] <ctin> its always aviable URLs
[21:40:46] <sarin> is http://asf.atmel.com down for everyone or just me?
[21:41:08] <LoRez> you know there's a website named nearly that, right?
[21:44:39] <sarin> I do, but since the documentation for ASF is pretty freaking important, maybe someone here knows of a mirror..
[21:49:39] <Hexorg> Hey all.. I haven't done anything with AVRs in a while... And I'm stuck... if I do int main(){DDRD |= _BV(PD2); PORTD |= _BV(PD2); do {} while(1); } it should output PD2 as HIGH, right?
[21:53:17] <seldon> Yes.
[21:53:42] <Hexorg> :-( it no work
[21:54:01] <seldon> What is attached to PD2?
[21:54:09] <Hexorg> A voltmeter
[21:54:37] <Hexorg> *I poke PD2 with a positive probe, while negative is connected to ground
[21:56:13] <N1njaneer> Which device?
[21:57:09] <Hexorg> ATmega48 in a TQFP package
[21:58:22] <N1njaneer> Is this bring-up on a new board?
[22:00:06] <N1njaneer> I'd check to make sure your toolchain settings are correct, then look at hardware. I assume you are using ISP?
[22:01:33] <Hexorg> N1njaneer, Yeah, new home made board. Using ISP. avrdude sees it and talks to it with no problems, but pin won't toggle.. Downloading a simulator now. I suspect toolchain problems.
[22:01:50] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/how_to/atmega168/mega168_howto_main_index.php
[22:01:58] <Tom_itx> try one of the files there
[22:02:08] <Tom_itx> compile it for the 48 and it should work
[22:03:01] <Tom_itx> i'm not using the _BV macros
[22:03:06] <N1njaneer> If the ISP is working then your clock should be running, as the ISP won't communicate without it. Worst case select internal clock to eliminate some external possibilities and test again.
[22:03:23] <N1njaneer> PD2 is just 0b00000100
[22:03:30] <Tom_itx> default is the lowest internal clock rate
[22:03:36] <Tom_itx> usually 1Mhz or so
[22:03:43] <N1njaneer> Yes provided he didn't change it.
[22:03:56] <seldon> PD2 is 2. _BV(PD2) is 1 << 2. Anyway, I'd check for solder bridges first; that would be my most likely error.
[22:04:20] <N1njaneer> PD2 is 4
[22:04:22] <N1njaneer> PD1 is 2
[22:04:26] <N1njaneer> PD0 is 1
[22:04:31] <seldon> Nope.
[22:04:35] <seldon> Check the header.
[22:05:41] <N1njaneer> No I mean as in the binary value you need to write
[22:05:51] <seldon> Ah. Yes.
[22:05:56] <N1njaneer> To PORTx to set the pin :)
[22:06:10] <seldon> I thought you meant the macros.
[22:06:15] <N1njaneer> Nope
[22:06:56] <N1njaneer> I never use the macros, but maybe that's just me. Easier for me to just do 0b00000100 since you can see the bits exactly as they will lay
[22:07:33] <Hexorg> Yeah, I tried different fuse settings for clock divby8, nothing changed. Circuit is actually made to run on the internal clock anyway.
[22:09:04] <seldon> I tend to #define my own macro names on top of the Pfoo macros. So I can shuffle pins around without (that is to say, with less) hassle later.
[22:10:27] <N1njaneer> Hexorg: http://pastebin.com/NngekATG if that helps :)
[22:13:05] <Hexorg> N1njaneer, dammit! Your hex works, your c doesn't
[22:13:36] <Hexorg> at least now I know it's not the chip's fault
[22:13:39] <Hexorg> thank you!
[22:13:47] <N1njaneer> seldon: I have a nice little port macros file I created that lets you set and unset pins on a port in a single clock cycle, which convenient since doing a PORTx &= or |= takes quite a few :)
[22:14:21] <N1njaneer> Hexorg: The C code works fine, and compiles to the .hex. Check your toolchain. Glad it's not your hardware! Toolchains are easier to fix!
[22:15:04] <Hexorg> N1njaneer, yeah I thought so. Gentoo always has problems with avr's toolchain
[22:17:59] <N1njaneer> Here's the .lss breakdown if it is useful in identifying where your toolchain is sticking in generating a faulty image -- http://pastebin.com/iDuFR0VT
[22:18:00] <seldon> Well, it takes two clock cycles if it's a single pin and known at compile time. How do you do it in one? You'd have to know at compile time exactly what you want on the port when the code is run.
[22:18:11] <seldon> Unless I'm missing something, which is possible.
[22:18:57] <N1njaneer> #define _PORT_PA0_HIGH() asm volatile("sbi 0x1B, 0")
[22:18:57] <N1njaneer> #define _PORT_PA0_LOW() asm volatile("cbi 0x1B, 0")
[22:19:02] <N1njaneer> ... et al
[22:19:09] <seldon> That takes two clocks each.
[22:19:51] <N1njaneer> You can directly manipulate the bits in the output registers with CBI and SBI for the lower set.
[22:20:39] <N1njaneer> Oops you are correct, yes, CBI/SBI are 2-cycle instructions.
[22:21:06] <N1njaneer> At least does take less clock cycles than reading the port, and/or'ing, and setting :)
[22:21:20] <seldon> I have something similar in one project, except more generically.
[22:21:53] <N1njaneer> I think AVR code is about the only place I ever use #defines
[22:21:58] <seldon> Except I named it LED_foo because it was software PWM stuff. asm(instruction " %0,%1" :: "i" (_SFR_IO_ADDR(LED_PORT)), "i" (color))
[22:22:20] <seldon> Where instruction is either "sbi" or "cbi", LED_PORT is PORTx and color is the number of the pin.
[22:22:27] <N1njaneer> That works :)
[22:23:14] <seldon> Btw, you're not strictly allowed to use identifiers that start with _[A-Z] in C unless you're writing a standard library. Reserved for the implementation and all.
[22:24:24] <seldon> That is to say, a compiler can reject code like that and still be a C compiler.
[22:25:36] <N1njaneer> Never had a problem on the two I've used it on. I use leading underscores in a similar fashion. Not worried about portability when doing AVR work here :)
[22:26:38] <seldon> *shrug* As you please. I avoid that sort of thing unless I have reasons.
[22:27:08] <seldon> Btw, avr-gcc generates the same code for plain PORTfoo |= _BV(Pfoo1);
[22:27:46] <N1njaneer> Good to know. I've been using those since before gcc was AVR-capable, since other compilers weren't quite so smart :)
[22:29:14] <seldon> gcc wasn't always, if I infer from the documentation correctly. There are (now deprecated) sbi and cbi macros, so you could write sbi(PORTfoo, Pfoo1); That's no longer necessary, but it appears to have been at one point.
[22:30:48] <N1njaneer> I had to suffer Imagecraft's crap when I started with AVR stuff a decade ago because it and IAR were about all that was usable at the time. I switched to gcc as there was solid support, and kind of just carried the macros along since they worked well and gave known behavior :)
[22:31:09] <seldon> Yay, legacy.
[22:31:53] <N1njaneer> Very much
[22:39:43] <N1njaneer> Love the discussions in here - always learn something new!
[22:39:47] <N1njaneer> And with that.... weekend!
[23:27:36] <rue_shop2> Casper, not made a steam engine yet
[23:28:19] <Casper> rue_shop2: what about researches about it?
[23:28:42] <rue_shop2> oh I know a lot about them, easy to build
[23:28:54] <rue_shop2> all sorts of designes that are dirt simple too
[23:31:39] <Casper> rue_shop2: what about in the 100W range? :D
[23:32:29] <rue_shop2> thats getting large
[23:32:36] <rue_shop2> how many rpm?
[23:32:37] <theBear> that's what she said :)
[23:34:04] <rue_shop2> 300rpm would need .32kgm
[23:34:23] <rue_shop2> 32kg*cm
[23:34:50] <rue_shop2> so if your crank was 6cm
[23:35:27] <rue_shop2> 313N
[23:35:56] <rue_shop2> and your piston was 10cm dia
[23:38:09] <rue_shop2> about 6psi
[23:38:28] <rue_shop2> at a pretty good volume tho
[23:38:48] <rue_shop2> Casper, I'm not designing an engine for you tho am I...