#avr | Logs for 2012-07-20

Back
[00:00:16] <SuperMiguel> Well Z changes if the previous instruction had a 0 result
[00:00:40] <Sefid_Par> How many Z flags do we have?
[00:00:50] <SuperMiguel> instructions as ADD, AND, CP, ASR CLR
[00:01:31] <Sefid_Par> But none of these where used! It used only LDI and DEC
[00:01:52] <Sefid_Par> *were!
[00:02:09] <SuperMiguel> DEC is a calculation
[00:02:16] <SuperMiguel> so it does set the flag
[00:02:50] <SuperMiguel> LDI doesn't set Z
[00:03:45] <Sefid_Par> You mean any calculation instruction take effect on Z.
[00:03:56] <Sefid_Par> *make
[00:04:00] <SuperMiguel> most if not all do,
[00:04:12] <SuperMiguel> Z gets set only if the result is 0
[00:04:29] <Sefid_Par> Oh yea.
[00:04:42] <Sefid_Par> Thanks
[04:41:01] <theBear> !ban chaoshax!*@*
[04:41:19] <theBear> hmm... i coulda sworn i could do that here, just can't seem to remember how
[04:44:30] <w|zzy> use '
[04:44:32] <w|zzy> or `
[04:45:09] <theBear> hmm, i'll try to remember, only need to do anything in here every few months
[05:57:53] <theos> '
[05:58:14] <theos> 'ban chaoshax
[05:58:20] <theos> :S
[06:00:14] <theBear> :)
[08:30:47] <day_> hi
[08:32:00] <day_> short question. why do the atmegas provide a number of registers and a sram? which one should i use?
[08:34:58] <karlp> use for what? what are you asking?
[08:35:31] <day_> for example: i want to save a 8bit variable
[08:35:37] <day_> where would u save it?
[08:36:30] <day_> im talking about the "general purpose registers" obviously
[08:36:46] <cehteh> depends on your program, usually you want to put data into ram, but there are exceptions for that rule
[08:37:27] <day_> well why usually?
[08:37:35] <cehteh> very frequent and timing critical variables for example
[08:37:42] <day_> so registers are faster?
[08:37:44] <cehteh> also depends on the language you use
[08:38:18] <day_> well to make it fair i would say assembler
[08:38:29] <cehteh> registers are the things used to do calculations, if something is in ram it has to be loaded to a register first
[08:38:57] <day_> thanks
[08:39:43] <day_> i feel so retarded now :D
[09:23:07] <Patrik> Hi I'm trying to program my atmega168 PU-20 with my STK500 in Linux but cannot make it work. Been looking at forums and blogs but cannot find anything that works. Could someone point me in a direction on where to begin.
[09:23:53] <specing> You cannot make it work? Now that is DESCRIPTIVE!
[09:24:01] <Patrik> I've managed to program my atmega12 and 8515 with UISP but that is about all I know. (There are tutorials available for getting that up and running).
[09:24:18] <Patrik> specing, hold on :)
[09:25:34] <Patrik> avrdude gives me: stk500v2_ReceiveMessage(): timeout
[09:27:26] <Patrik> specing, This might be more descriptive. How am I suppose to wire and pin the STK 500 for programming atmega168 with avrdude?
[09:27:57] <specing> I have no idea :P I use an usbispmkii clone ;)
[09:29:11] <Patrik> Ah :)
[09:30:45] <Patrik> I've heard there is some info about pin setup and stuff in Atmel Studio but that is windows only.
[09:34:32] <specing> Patrik: I always get such confusing messages when I mess up the MISO/MOSI lines
[09:34:59] <specing> I remember getting USB errors on USBtinyISP
[09:48:02] <Patrik> specing, I'm trying everything now, let's just hope I don't burn the poor thing now
[11:26:57] <rhumbot> hi all. a question about uart: approximatley 1-5% of the data sent is not received correctly.
[11:27:06] <rhumbot> is this normal?
[11:27:29] <specing> What is your baud error rate?
[11:28:01] <specing> also in what direction are you sending stuff?
[11:30:02] <rhumbot> from computer to uC. and im not sure. i use a library and cant find the defind error rate
[11:31:06] <specing> rhumbot: I havent ever experienced character loss
[11:31:15] <specing> your code is broken ;P
[11:31:21] <rhumbot> :/
[11:33:17] <rhumbot> when you are sending data: do you open the connection, send and close again or keep the connection open and send whenever you need to?
[11:34:20] <specing> open
[11:34:49] <rhumbot> also: when you need to synchronize some variable on the uC with one on your computer. do you permanently send the value or wait till it changes and then send it only once?
[11:37:29] <specing> rhumbot: wait and require confirmation
[11:40:17] <Tom_itx> we will cure it with a check of the crystal frequency and a dose of WormFood's baudrate calculator: http://www.wormfood.net/avrbaudcalc.php
[11:54:12] <Tom_itx> maybe he's in a Norwegian jail for partying too hard
[11:55:19] <Steffanx> Drunk driving ..
[11:55:41] <Steffanx> !seen abcminiuser_
[11:55:41] <tobbor> abcminiuser_ was last seen in #avr on Jul 05 13:15 2012
[12:34:30] <Patrik> I'm trying to read the fuse values from an atmega168-20pu but the signature and fuse values are very random. Something like 1 of 3 reads of signature, lfuse, hfuse and efuse are wrong.
[12:35:15] <Patrik> What could be wrong? I've tried overwriting the fuse on one of my atmega168-20pu but that seems to have bricked it.
[12:36:16] <karlp> bad clock, bad power supply, to fast clock for reading out the vlaues
[12:39:09] <Patrik> I'm using an stk500v1 at 115200 baud
[12:39:47] <Patrik> I cannot change the baud because then I cannot communicate with the stk500
[12:41:00] <Patrik> Or is the clock for reading out values set somewhere else?
[12:41:42] <Patrik> Or am I just rambling? :)
[12:44:22] <specing> Patrik: avrdude -B 10 helps?
[12:44:34] <Patrik> is that bytedelay?
[12:44:44] <Patrik> ah bitclock, nm
[12:45:30] <Patrik> specing, no, still unreliable readings from fuses
[12:45:49] <specing> -B 100?
[12:45:52] <specing> -B 1000?
[12:47:31] <Patrik> tried them all, still not working
[13:22:31] <RikusW> http://code.google.com/p/corkami/wiki/PE101
[13:48:41] <Steffanx> stumbled upon something RikusW ? :P
[13:51:08] <RikusW> Yes :-P
[13:51:32] <RikusW> I have other docs on PE to, thats what I use to hack exe's ;)
[15:43:01] <Patrik> Anyone who knows if stk500v1 vs stk500v2 is just a difference in firmware or is it a new hardware revision?
[15:47:52] <Patrik> Seems I'm on STK500 v1 and AVR Studio 6 requires v2
[15:56:32] <Tom_itx> so use studio 5
[15:56:35] <Tom_itx> or 4
[15:57:28] <Patrik> Can't find downloads of those and not sure It'll run on Windows 7.
[15:58:10] <Tom_itx> they should and the downloads are available
[16:00:08] <Patrik> Any particular version of Studio 4 you would recommend?
[16:00:16] <Patrik> (I found the archive)
[16:00:59] <Tom_itx> the latest?
[16:01:43] <Tom_itx> 4.19 build 716 is what i have
[16:01:53] <Patrik> But does it work with v1? I recall reading somewhere that they switched from v1 protocol to v2 somewhere during 4.xx
[16:02:03] <Patrik> I'll just give it a try...
[16:02:20] <Tom_itx> i don't own a stk500
[16:02:23] <Tom_itx> can't tell you
[16:02:40] <Tom_itx> the newer one undoubtedly supports newer chips
[16:04:36] <Patrik> The real problem I'm trying to solve is to get avrdude in linux to be able to read fuses and signature on my atmega168-20pu
[16:04:54] <Patrik> I've tried everything so now I'm trying to upgrade the firmware in my stk500v1 to see if that helps
[16:05:58] <Tom_itx> read the avrdude pdf
[16:05:58] <Patrik> The signature and fuse values I get of the atmega168 is off about 1/3 of the times so programming fails.
[16:06:15] <Tom_itx> it may have more than one setting for the stk500
[16:09:06] <Patrik> I've read the manpages and fiddled with most of the settings. Programming my atmega16 and at90s8515 works fine.
[16:09:11] <RikusW> Patrik: you just need the firmware upgrade to stk500v2 protocol
[16:09:48] <Tom_itx> does studio 6 have it as a downloadable update?
[16:09:55] <RikusW> not sure
[16:10:00] <RikusW> 4.18 does
[16:10:18] <Patrik> RikusW, ok so its just software... cool
[16:10:32] <Tom_itx> see if 6 has the update available
[16:10:40] <RikusW> AS5 does have the upgrade
[16:10:49] <RikusW> so I would think 6 does too
[16:10:54] <Patrik> AS6 cannot even communicate with my stk500v1
[16:11:03] <Tom_itx> odd
[16:11:08] <Tom_itx> atmel makes both
[16:11:12] <RikusW> Program Files/Atmel/AVR Studio 5.0/tools/STK500/STK500.ebn
[16:11:15] <Patrik> It could be that I'm using a usb to serial converter though
[16:11:23] <Tom_itx> that's not so good
[16:13:17] <RikusW> Patrik: you could try manual upgrade
[16:13:26] <RikusW> there is a program button on the stk
[16:14:03] <RikusW> otherwise download AS4
[16:15:52] <Patrik> I'm trying a few things here... gimme a sec
[16:16:30] <RikusW> there should be some docs with AS6 to explain how
[16:19:19] <Patrik> Seems to have found something in AS4, upgrading now
[16:23:19] <Patrik> Now I can communicate with my atmega16, lets try the atmega168
[16:31:53] <Patrik> RikusW, Tom_itx, Seems to be working now, I get proper values from the atmega168
[16:32:15] <Tom_itx> good
[16:32:16] <Patrik> Unfortunately I've seem to have bricked one of my MCs
[16:32:58] <Patrik> Good thing I got a few spare ones :)
[16:33:24] <Tom_itx> maybe you can unbrick it
[16:33:39] <Tom_itx> HVPP or external clock source
[16:34:19] <RikusW> STK500 can do HVPP
[16:34:50] <RikusW> but you could try supplying a clock to XT1 first, its a bit simpler
[16:35:08] <RikusW> Patrik: did you change some fuses to brick it ?
[16:35:40] <Patrik> I accidentally succeeded to write fuse values to it while it was playing tricks on me.
[16:35:53] <RikusW> ooops
[16:36:01] <RikusW> HVPP will fix that
[16:36:16] <Patrik> I'll see if I can recover it with HV
[16:43:38] <Patrik> Hmm the signature is messed up as well
[16:44:25] <Patrik> I connected the pjumps and bsel2 terminal to PC2
[16:45:06] <RikusW> and the control and data ribbon cables ?
[16:45:56] <Patrik> Prog control and data should go where?
[16:46:22] <Patrik> PortB and PortD?
[16:46:40] <RikusW> sounds right
[16:46:55] <RikusW> check the docs though ;)
[16:47:13] <RikusW> or the m168 datasheet
[16:47:47] <RikusW> and then there is bsel2 and pjump, bu you seem to have done that already :)
[16:51:27] <Patrik> Is BSEL2 terminal the right pin?
[16:51:49] <Patrik> At least it looks like that in the docs
[16:54:22] <RikusW> right towards the serial connectors iirc
[17:08:22] <Patrik> sweet :)
[17:08:50] * RikusW reverse engineered the jtagice mki and stk500 firmware :)
[17:09:47] <RikusW> you'll have to use AS4 with the jtagice mki...
[17:11:16] <Patrik> I rather get AS out of the way. I'm a Linux + vim guy :)
[17:12:01] <RikusW> avarice + gdb will also work
[17:12:16] * RikusW use Debian too
[17:12:34] <RikusW> only rarely XP mainly to use AS4
[17:12:58] <RikusW> and I do like vim too :)
[17:13:24] <RikusW> regexps FTW
[17:13:49] <Patrik> :)
[17:15:37] <Steffanx> living in 1999 ftw!
[17:16:08] <RikusW> whats wrong with vim ? :-P
[17:16:15] <Patrik> Ahh those where the days :)
[17:19:50] <Patrik> Steffanx, the thing with vim is that it doesn't get in your way and it's almost always available. Editors that type things for you (ends curly braces and indents) never get it right anyways.
[17:21:09] <Patrik> RikusW, Do you have those megau2s in stock?
[17:22:06] <RikusW> yes
[17:22:32] <RikusW> about 100...
[17:24:10] <Steffanx> 100 .. oops
[17:25:31] <Patrik> I'll play a little with my setup and if I need one I'll let you know. You ship to Sweden I suppose?
[17:25:51] <RikusW> I've shipped to Germany once before
[17:26:29] <RikusW> so it shouldn't be a problem
[17:26:37] * RikusW is in South Africa
[17:28:59] <Patrik> Oh, so pretty much on the other side of the globe :)
[17:29:53] <Steffanx> http://samples.atmel.com/scripts/samplecenter.dll?atmel?cmd=partsearch that is new?
[17:30:24] <RikusW> About the same timezone though
[17:30:59] <Tom_itx> http://tom-itx.dyndns.org:81/~webpage/boards/new_batch/USB_chips.jpg
[17:31:02] <Tom_itx> i've got a couple
[17:31:36] <Steffanx> still have them?
[17:31:52] <Tom_itx> not quite all of them now
[17:32:44] <Tom_itx> i think most of one tray and part of the other is empty now
[17:41:38] <Patrik> Bedtime now... thank you all and good night
[19:48:53] <hetii> Hi :)
[21:50:38] <mog> does any one have a prefered usb to uart method? the ftdi chip i was sourcing is out of stock till october and that seems to happen to a lot of the ftdi designs i have looked at
[21:52:16] <Tom_itx> dean has a serial demo in LUFA i believe
[21:52:35] <Tom_itx> U2 etc
[21:52:49] <Tom_itx> atmega32u2 16u2
[21:53:26] <mog> i dont like that you need a crystal but thats the way im leaning
[21:54:46] <Tom_itx> i got a cheap resonator that works good
[21:55:06] <mog> thats enough? i thought it had to be close for usb clock
[21:55:15] <mog> 12 or 16 mhz?
[21:55:18] <Tom_itx> just a sec
[21:55:19] <Tom_itx> 16
[21:56:23] <Tom_itx> http://www.digikey.com/product-detail/en/CSTCE16M0V53-R0/490-1198-1-ND/584635
[21:57:37] <mog> ya that brings price to 3 dollars and change
[21:58:10] <mog> not a bad choice though
[21:58:17] <mog> at least space on board isnt huge
[22:00:37] <Tom_itx> it's why arduino went with the small one
[22:00:52] <Tom_itx> but it required a customized code
[22:01:42] <Tom_itx> 8u2 iirc
[22:03:15] <prpplague> mog: which ftdi chip did you source?
[22:03:32] <mog> ft231xs
[22:05:01] <prpplague> mog: yes that one is not one of their more popular ones that are regularly stocked
[22:05:42] <mog> it was cheapest and had good size package for my project. is there one that is more likely to be in stock prpplague
[22:06:47] <prpplague> mog: i am partial to the ft232r for single uart projects
[22:19:15] <mog> at that price its cheaper just to go with the atmega8u2 and parts
[22:22:09] <Tom_itx> that was arduino's decision as well
[22:27:10] <prpplague> mog: yes, there are trade offs
[22:27:29] <prpplague> mog: the atmega parts aren't robust enough for my uart needs
[22:27:41] <prpplague> mog: it all depends on what your requirements are
[22:28:07] <mog> 9600 baud and dtr bit is all i need
[22:29:29] <prpplague> mog: that is a pretty basic requirement, but there are others
[22:29:41] <mog> im aware prpplague
[22:30:00] <prpplague> mog: just saying there are draw backs to using the atmega
[22:41:21] <Devilholk> Morning. I'm using the avr plugin for eclipse but I can't figure out how to start the fuse bit editor. There is a button for it but nothing happens. Do I have to install something? o.O
[22:45:30] <Devilholk> Never mind
[22:45:39] <Devilholk> Had to load mega88 and then load mega88p >.<