#avr | Logs for 2015-06-05

Back
[01:13:25] * Xark notes on his 1284p while (!((UCSR0A) & _BV(UDRE0))) works fine for serial...
[01:15:56] * Xark confirms in DS that Data Register Empty is UDRE0, so sounds right to me...
[01:28:40] * theBear confirms that R.F. and Sk.B together form LMFAO, sounds pretty good to me...
[08:01:55] <zmo> hey guys!
[08:02:46] <zmo> anybody has an idea of how different is the atmel ice compared to the jtagice3? I mean, is the debug protocol totally different, or is it very close and just a matter of adapting a few commands and IDs in avarice to make it work?
[08:03:41] <zmo> the jtagice3 was my favorite programmer/debugger until now, but it's discontinuated and I cannot get my new colleagues up to speed with AVR debug :-(
[08:52:55] <guestavr> Do I have to set the fuse bit everytime I program a new avr?
[08:53:36] <LeoNerd> The fuse bits are part of the device itself, so yes
[08:53:40] <LeoNerd> New device => new set of fuses
[08:53:45] <twnqx> well, the content won't be magically transferred from one chip to another
[08:53:52] <twnqx> if you reflash the same chip, you don't have to
[08:54:04] <LeoNerd> But you should only need to do it once per chip; erasing/reprogramming the same chip will keep the fuses
[08:54:31] <LeoNerd> (I usually keep a set of debug-enabled refused chips in a box.. with yellow stickers on them to remind me)
[08:54:37] <LeoNerd> Note to self: play with dW more
[08:57:17] <guestavr> Is there a way to progam the fuse automatically when programming a new firmware on the chip?
[08:58:38] <LeoNerd> Personally: I do make install FUSES=1
[08:58:51] <LeoNerd> But then I've spent a while hacking my Makefiles to be juuust right for me ;)
[08:59:55] <guestavr> Any procedures to do that in Atmel Studio without playing with the makefile?
[09:00:52] <LeoNerd> I've never touched AS itself, so I can't advise
[09:01:14] <twnqx> yuck, windows software :P
[09:49:51] <sebus> guestavr http://www.avrfreaks.net/forum/fuses-code-help?name=PNphpBB2&file=viewtopic&t=132292 read here
[09:50:19] <sebus> .elf file can hold fuses data, useful if you program a lot of same chips
[09:55:58] <twnqx> that notion... is not 100% correct
[09:56:38] <twnqx> elf files can hold anything, and you can build a construct where you have extra sections for eeprom and fuse data, and use the makefile to deconstruct those section and program it accordingly
[09:57:33] <sebus> Agree with that.
[09:58:20] <LeoNerd> Personally I don't bother
[09:58:30] <LeoNerd> My makefile just has a line that adds some extra args to avrdude
[09:58:41] <twnqx> true, but it makes sense for eeproms
[09:59:02] <LeoNerd> Oh totally; I do eeprom data from ELF
[09:59:22] <guestavr> sebus: Thanks
[09:59:40] <LeoNerd> http://pastie.org/10225276 a chunk of my main control Makefile
[10:00:25] <LeoNerd> So if I just make install it writes just the flash; if I make install EEPROM=1 FUSES=1 it does those too
[19:50:53] <Eyre> hi there
[20:09:53] <Eyre> my friend told me that I'd better to ask in #avr in irc about my problem. so what's the deal. teh circuit http://pastexen.com/i/uBQTmE89Ii.png teh code (i'm so new in programming this and I program much in OO style, so it's the worst code I've ever did and no laughing.) http://pastexen.com/code.php?file=C3ei2xQ3w1.c this http://maxembedded.com/2011/06/lcd-interfacing-with-avr/ -- is what I've read about. so there's a li
[20:09:53] <Eyre> nk to the lcd files, http://homepage.hispeed.ch/peterfleury/doxygen/avr-gcc-libraries/group__pfleury__lcd.html#ga73b2370827e2d350cedd45e08a9eb0b2 in which the only change I did is setting lcd in lcd.h to PORTB. I'd like to have a library or something to work with it, I have no time to make my own implementation. so! the problem is "once I set ADEN to 1 lcd doesnt work" if I'm not using ADC at all and ADEN is set to 0 I can cou
[20:09:53] <Eyre> nt and print each "bigger" value (increments in the interrupt) in second string of lcd for example. once I turn on adc by setting aden to 1, I cant do even this. proteus tells something like http://pastexen.com/i/wcAbGld03h.png this. I dont think there's Peter's mistake anywhere, and I cant find mine. I'm working with atmel studio 6.2 and proteus 8.1. ask if any another details r needed. so. any ideas? =(
[20:10:16] <Eyre> gosh. sorry for long post =(
[20:11:58] <LeoNerd> If you simply change a PORT without changing the DDR, that sounds like it would probably not work
[20:12:26] <Eyre> interesting.
[20:13:58] <Eyre> I don't see any "DDRA" setting in lcd.h
[20:15:24] <LeoNerd> Well something *somewhere* will have to set the DDR bits
[20:21:04] <Eyre> I think this something is a macro like in lcd.c http://pastexen.com/code.php?file=5GmBiBYKr3.c this fragment. but and the thing is "lcd dont work when adc is switched on or even have been switched on even once" I can force set DDRB = 0xff but I think it's bad idea. and anyway, the ddrb is always changing somewhere in lcd.c because it should work with rsrwe and according to datasheet -- d7. to read the busy flag.
[20:23:26] <ayuu> I'm looking to program an avr from another microcontroller. Has anyone tried?
[20:25:04] <stanreg> I'm trying to understand how v-usb decodes NZR. It uses eor, but I don't understand it. Can someone throw me a hint? Here's the explanation, 3rd paragraph after the first code block: https://www.obdev.at/articles/implementing-usb-1.1-in-firmware.html
[20:26:32] <stanreg> NRZI*, oops.
[20:35:37] <hypermagic> lol i figured out a way to make 3 dacs from 2
[20:35:52] <hypermagic> 3x8 bit from 2x12 bit
[20:46:50] <Lambda_Aurigae> ayuu, many times.
[20:47:26] <Lambda_Aurigae> stanreg, I suggest learning how the whole USB comms works then contacting the people who wrote v-usb....
[20:47:47] <stanreg> Lambda_Aurigae, I won't be contacting them, but thanks for the advice :)
[20:47:49] <stanreg> I get it now.
[20:49:15] <ayuu> Lambda_Aurigae: cool! any source code I can look into at how it's done?
[20:49:41] <hypermagic> sup Lambda_Aurigae
[20:50:02] <Lambda_Aurigae> ayuu, lots of it out there. Google is your friend.
[20:50:12] <Lambda_Aurigae> all depends on exactly what you want to do.
[20:50:19] <Lambda_Aurigae> hi hypermagic
[20:51:07] <hypermagic> using 2 or 3 fast opamps as differential amplifiers, and 2 12 bit dacs is is possible to output 3x8 bit analog channels for rgb monitor driving for example
[20:51:36] <Lambda_Aurigae> that it is.
[20:51:47] <ayuu> Lambda_Aurigae: I want to program a single type of avr from a larger microcontroller
[20:52:05] <Lambda_Aurigae> what microcontroller?
[20:52:12] <Lambda_Aurigae> you mean another AVR?
[20:52:34] <hypermagic> Lambda_Aurigae, how you go about milling both sides of workpiece? :)
[20:52:40] <ayuu> Yes, or any other microcontroller
[20:53:01] <Lambda_Aurigae> hypermagic, mill one side and turn it over and mill the other.
[20:53:12] <hypermagic> sounds simple ...
[20:53:33] <Lambda_Aurigae> ayuu, look at the datasheet for the avr you want to program..the programming specification is very simple and straightforward really.
[20:53:37] <hypermagic> what if they need to be aligned downto um precision?
[20:53:39] <Lambda_Aurigae> it is all based on SPI.
[20:53:46] <Lambda_Aurigae> hypermagic, then have a professional do it.
[20:54:01] <Eyre> my question is still open .-. http://pastexen.com/code.php?file=ZkIipWfxAy.txt
[20:54:22] <Lambda_Aurigae> or mill it out of a block and leave some connection points to the outside of the block...that way you can reposition the block in the corner of something.
[20:55:00] <ayuu> Lambda_Aurigae: ok. any detailed procedures I can find online? I'm not sure what to search for exactly...
[20:55:00] <Lambda_Aurigae> Eyre, what exactly is your question? without pasting graphical screen captures?
[20:55:10] <hypermagic> hm, wasteful block milling sounds good too thanks
[20:55:27] <Lambda_Aurigae> same way you would mill a 2 sided PCB.
[20:55:36] <Lambda_Aurigae> mill one side, turn it over, mill the other side.
[20:55:36] <hypermagic> i first lap the top and i can drill guide holes too
[20:56:54] <Lambda_Aurigae> ayuu, have you read the AVR datasheet yet?
[20:58:45] <ayuu> Lambda_Aurigae: i'm checking
[20:59:32] <Lambda_Aurigae> ayuu, you can always look at the source for the usbasp. ...that is the cheapy avr programmer that uses v-usb bitbanged usb...rip out the v-usb part and add your own code to feed the data through the programmer connection.
[20:59:42] <Lambda_Aurigae> the datasheet is VERY comprehensive.
[21:00:16] <Lambda_Aurigae> the programming interface is physically very simple..it is SPI with an addition of holding the reset high while programming.
[21:00:20] <hypermagic> do you store things in your flash ?
[21:00:24] <Lambda_Aurigae> then you just send commands and read back data.
[21:00:41] <Lambda_Aurigae> hypermagic, sometimes. mostly lookup tables for trig functions.
[21:00:47] <hypermagic> löong term calibration values does not need to be rewritten often
[21:01:18] <Eyre> Lambda_Aurigae, there was a copy of my explanation I sent before. .-. all links to screenshots, code, manual, library... ehm the problem is "lcd is not working once aden is set to 1." i think i gave quite detailed explanation of my problem above and can send any additional data requested. .-.
[21:01:44] <Lambda_Aurigae> Eyre, I'm not about to read code this late at night.
[21:01:49] <Lambda_Aurigae> sorry.
[21:01:52] <hypermagic> Lambda_Aurigae, only advantage of using eeprm vs flash is number of write cycles ?
[21:02:03] <Eyre> ask what you need to know to help ^_^
[21:02:05] <Lambda_Aurigae> hypermagic, meh...
[21:02:11] <Eyre> and there's not much code.
[21:02:21] <Lambda_Aurigae> Eyre, debug your code....
[21:02:42] <Lambda_Aurigae> lcd is not working tells me jack. it could be hooked up wrong, you could have a typo, I have no clue.
[21:03:15] <Lambda_Aurigae> is your adc on one of the pins that is used for the lcd?
[21:04:05] <Eyre> in atmega8 adc is on port A right? I connect lcd to port B.
[21:04:23] <hypermagic> adcs are on portc
[21:04:48] <hypermagic> why not consult the datasheet diagram?
[21:04:58] <Eyre> hm
[21:05:56] <Lambda_Aurigae> honestly, I don't see how changing ADEN should affect your LCD interface if they are physically separated on different pins.
[21:06:48] <Lambda_Aurigae> unless you have some interrupt code that is causing issues when the ADC gets turned on.
[21:19:40] <Eyre> interrupt is good idea
[21:19:49] <Eyre> to disable
[22:07:35] <LoRez> Tom_itx: these things are avrisp2's right?
[22:16:19] * Tom_itx nods
[22:16:52] <LoRez> it worked earlier today on a windows box and libusb. won't work on this ubuntu trusty laptop
[22:16:59] <LoRez> did you shut down your website?
[22:17:35] <Tom_itx> the site is still up
[22:17:48] <Tom_itx> not selling right now though
[22:17:58] <Tom_itx> did you need one?
[22:18:18] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/
[22:18:26] <LoRez> just not running it on the dyndns thing anymore?
[22:18:31] <LoRez> ah.
[22:19:06] <Tom_itx> they wanted to sell me time
[22:19:42] <Tom_itx> it's there and one other link..
[22:19:51] <LoRez> mmattice@noc-lt03:~$ avrdude -c avrisp2 -P usb -p m1284p -t
[22:19:51] <LoRez> avrdude: stk500v2_recv_mk2: error in USB receive
[22:19:52] <LoRez> avrdude: stk500v2_recv_mk2: error in USB receive
[22:19:52] <LoRez> avrdude: stk500v2_recv_mk2: error in USB receive
[22:20:11] <Tom_itx> http://tom-itx.ddns01.com:81/~webpage/index.php
[22:20:18] <Tom_itx> that one is less reliable
[22:21:33] <Tom_itx> hmm
[22:21:42] <Tom_itx> dunno if i've seen that one
[22:23:02] <LoRez> yeah, it's a bit weird. Is there a test firmware to dump on it?
[22:23:54] <Tom_itx> http://tom-itx.ddns01.com:81/~webpage/avr/usbtinymkii/131027_AVRISP_studio.hex
[22:24:04] <Tom_itx> should work on windows or linux
[22:24:15] <Tom_itx> just not windows with avrdude
[22:25:17] <Tom_itx> there's a .rar file there if you'd rather get it compressed
[22:25:23] <Tom_itx> they're all in the .rar file
[22:27:26] <LoRez> it's been too long.
[22:27:45] <Tom_itx> yeah i agree
[22:29:15] <Tom_itx> avrdude -c avrisp2 -p m328 -P usb -U flash:w:"/usr/local/avr/test.hex":a -e
[22:29:21] <Tom_itx> that's one line i used in linux
[22:32:47] <Tom_itx> oh..
[22:32:56] <Tom_itx> LoRez, you used libusb on windows?
[22:33:10] <Tom_itx> you may need to change the firmware for ubuntu then to the one i linked
[22:33:25] <Tom_itx> the libusb on windows is the oddball one
[22:42:22] <LoRez> a friend plugged it into windows and it worked. it's not working on my linux laptop.
[22:42:36] <LoRez> which is odd, because I've never used it on windows before.
[22:43:04] <LoRez> how do I program this firmware onto it?
[23:18:51] <hypermagic> hmm
[23:19:08] <hypermagic> read the atmel datasheet appnote about oversampling improvement of adc resolution
[23:19:57] <hypermagic> the author says "averaging 16 samples will not yield improvement of resolution, but our magical add all 16 samples in and shift right will" ...
[23:20:12] <hypermagic> so atmel invents math
[23:20:23] <LoRez> shift right 4?
[23:20:35] <hypermagic> 2
[23:20:45] <hypermagic> because... 10 to 12 bit
[23:21:14] <hypermagic> well by definition average is the sum of all elements divided by the number of elements...
[23:21:29] <hypermagic> but atmel definitely does magic
[23:30:36] <hypermagic> btw i have invented a superior function to atmel's magic oversampling resolution enhancement
[23:30:45] <hypermagic> i call it weighted average...