#avr | Logs for 2012-06-04

Back
[00:00:08] <abcminiuser> Not bad, bleary eyed
[00:00:18] <abcminiuser> It's 6:45AM, about to have shower and go to work
[00:00:21] <abcminiuser> Love it here tho
[00:00:51] <Valen> good to hear your enjoying it
[00:01:03] <Casper> frostyville... is that the true name or just a really cold place?
[00:01:18] <abcminiuser> Casper, I'm in Trondheim, Norway
[00:01:30] <abcminiuser> First official day of summer last week it snowed again :P
[00:01:42] <abcminiuser> Just as a "screw you" to those who wanted to go outside
[00:02:49] <Casper> hehe
[00:02:59] <Casper> atleast you didn'T got a flood...
[00:03:37] <Casper> http://img713.imageshack.us/img713/9661/img3320.JPG ← the "new" floor :(
[00:04:03] <Valen> lovley
[00:04:13] <Valen> i imagine it has a nice septic clean smell too
[00:04:22] <abcminiuser> Ick
[00:04:54] <Casper> Valen: actually it does smells good
[00:05:01] <Casper> it got disinfected
[00:05:25] <Casper> http://img62.imageshack.us/img62/4729/img3316rz.jpg ← the floor, the day AFTER the flood...
[00:05:31] * abcminiuser shower
[00:05:32] <Casper> it got worse as day passed
[00:05:57] <Casper> at the 4th day.... it was almost dangerous as it lifted by almost ¼ of an inch!
[00:06:13] <Casper> (yes, fancy ¼ :D)
[06:30:47] <JyZyXEL> i don't understand how UDR can contain non-sense inside ISR(USART_RX_vect) {
[06:31:23] <JyZyXEL> according to documentation it should have the RX buffer
[06:32:07] <JyZyXEL> if i send "1" i get "8"
[06:32:13] <JyZyXEL> if i send "2" i get "2"
[06:32:20] <JyZyXEL> if i send "3" i get "2"
[06:32:22] <JyZyXEL> it makes no sense
[06:39:45] <xata> Hello
[06:43:41] <JyZyXEL> SO FRUSTRATING
[06:47:09] <xata> Is there any function in avr C to send serial data to some pin, or everybody makes it onw way each time? also i have a digipot, that needs clock source, T for end of 16-bit data, T/16 for each bit and third input pin is serial data - can i use atmega output on 3 pins, so i make one a clock, another one clock/16 and third as data output?
[06:53:49] <desaster> hmm does that describe SPI?
[06:54:15] <desaster> if clock is essentially SSEL
[07:05:49] <xata> desaster: yes, but i need to communicate with 3 digipots simultaneously, so SPI is not what i need.
[07:07:27] <xata> desaster: the main question is - can quick switching between 0 and 1 on pin be a clock source for digipot?
[07:09:05] <xata> or quartz is not just 1 to 0 at 8mhz
[07:32:08] <specing> JyZyXEL: receive and transmit buffers are not the same thing
[07:41:34] <JyZyXEL> specing: it turned out to be wrong F_CPU in my Makefile
[08:16:42] <specing> LOL
[08:18:36] <Tom_itx> woops
[08:35:34] <specing> Why are PMU chips so expensive? They cost nearly as the whole chip they are designed to manage!
[09:13:12] <JyZyXEL> bleh, its so easy to make my prgoram crap out if you unplug and replug the USB cable really fast
[09:13:40] <JyZyXEL> for some reason it results in eeprom getting correcupted
[09:54:29] * OndraSter is happy Lumia 800 user!
[09:56:57] <jacekowski> you can't say that sort of things
[09:57:01] <jacekowski> you have to say microsoft is bad
[10:06:26] <OndraSter> jacekowski, but..
[10:06:32] <OndraSter> my mother told me to not tell lies
[10:10:10] <Landon> is there a page with all of atmels appnotes?
[10:10:19] <Landon> or do I need to go product by product
[10:11:13] <Landon> I suppose the document search works as well as anything else
[10:38:20] <NTQ> Hi. Today I got my AVRminiProg and Ubuntu recognizes it with lsusb as "Atmel Corp. AVR ISP mkII". Which port I have to use for avrdude to flash my atmega8?
[10:39:01] <rhumbot> does anyone have an advice which development software to use on ubuntu? is there a gui to flash the C?
[10:39:22] <NTQ> rhumbot: Yes, you can eclipse with the avrdude plugin
[10:40:04] <NTQ> *use
[10:41:00] <rhumbot> NTQ do you happen know if there is a similar plugin for netbeans?
[10:41:32] <rhumbot> but i guess i can get used to eclipse as well :/
[10:41:56] <NTQ> rhumbot: I don't know. I haven't used eclipse yet
[10:42:17] <rhumbot> what du you use?
[10:42:47] <NTQ> I use eclipse-cdt on ubuntu
[10:43:42] <rhumbot> k thanks,
[10:44:01] <NTQ> This is a german site with instructions for installing eclipse with the gcc toolchain and avrdude: http://www.mikrocontroller.net/articles/AVR_Eclipse
[10:59:37] <specing> NTQ: -P usb
[11:00:10] <NTQ> specing: thank you. It works already. man pages are beautiful
[11:00:16] <specing> :)
[11:01:08] <OndraSter> I prefer woman pages
[11:04:38] <Landon> man woman
[11:04:38] <Landon> No manual entry for woman
[11:04:44] <Landon> you lost me, OndraSter
[11:05:16] <OndraSter> eh
[11:05:31] <NTQ> http://www.getdigital.de/products/man_woman
[11:09:08] <NTQ> who | grep -i blonde | date
[11:09:08] <NTQ> cd ~; unzip; touch; strip; finger; mount; gasp; yes; uptime; umount; sleep
[12:02:28] <JyZyXEL> any ideas why my EEPROM gets messed up when rapidly plugging and replugging USB?
[12:04:13] <OndraSter> do you supply power through the USB? :D
[12:04:19] <JyZyXEL> yeah
[12:04:33] <OndraSter> well do you write to the EEPROM when you unplug the USB?
[12:04:49] <JyZyXEL> no, only read after power comes on
[12:05:03] <OndraSter> hmm
[12:12:53] <LoRez> shit eeprom apparently
[12:24:07] <specing> LoRez you are alive! :P
[12:24:48] <LoRez> until I'm not?
[12:26:43] <MrStumbleUpon> http://opensourceecology.org/gvcs.php
[12:30:13] <Steffanx> hehe rikus
[12:31:59] <specing> MrStumbleUpon: You have stumbled upon an agricultural site?
[12:37:33] <JyZyXEL> im guessing these warning: implicit declaration of function are because i don't have a main.h?
[12:38:46] <RikusW> there is some electronics stuff too ;)
[12:39:13] <RikusW> like cnc machines
[12:43:03] <JyZyXEL> im starting to think using only one char over USART is not enough to trigger stuff... reliably without miss triggers
[12:44:46] <specing> JyZyXEL: Im starting to think you are doing something wrong (tm)
[12:46:12] <Steffanx> I think we all do something wrong
[12:46:18] <Steffanx> (r)
[12:46:33] <LoRez> true story
[12:48:10] <JyZyXEL> if you want i can paste full code
[13:35:19] <JyZyXEL> guess ill just ditch the idea of trying to store state on the EEPROM and store in on the computer hard disk
[15:12:16] <iR0b0t1> Is generating an accurate .25us delay hard?
[15:12:53] <mrfrenzy> what frequency does that equal?
[15:12:55] <iR0b0t1> Not accurate accurate. But kinda accurate. +/- .1us or so
[15:13:02] <iR0b0t1> 4MHz
[15:13:03] <iR0b0t1> ah
[15:13:05] <JyZyXEL> http://pastebin.com/ugZbPRwS is there perhaps a more elegant way of doin that?
[15:13:06] <iR0b0t1> hmm...
[15:13:18] <mrfrenzy> so, no problem with a standard avrs builtin timer
[15:13:20] <iR0b0t1> So you'd need at min an 8MHz processor, but probably more like 16MHz?
[15:13:39] <mrfrenzy> look at the datas on timers
[15:13:42] <iR0b0t1> well
[15:13:47] <iR0b0t1> software-generated delay
[15:14:01] <iR0b0t1> the timers can just count in that time period, I guess
[15:14:02] <mrfrenzy> eew
[15:14:12] <iR0b0t1> I'm not sure if I would be able to use the timers to generate the signals I'd need
[15:14:36] <mrfrenzy> you can certainly use the timers to make an accurate delay (it's the only proper way)
[15:14:52] <mrfrenzy> then the timer triggers an interrupt that runs your code when the time has expired
[15:14:59] <iR0b0t1> oh
[15:15:00] <iR0b0t1> oh
[15:15:10] <iR0b0t1> load timer count register with a value greater than 0
[15:15:14] <iR0b0t1> pin change on overflow interrupt
[15:15:18] <mrfrenzy> yes
[15:15:18] <iR0b0t1> :)
[15:15:22] <mrfrenzy> there are many great tutorials
[15:15:28] <mrfrenzy> or just spend a day in datasheets ;)
[15:15:42] * iR0b0t1 is up to his nipples in datasheets
[15:54:19] <rumbot> hi all, im new to microcontroller programming and trying to flash a attiny2313 using avrdude -p attiny2313 -c usbtiny -P usb -U flash:w:blink2.hex and i recieve a "ser_open(): cant open device /dev/ttyS0: Permission denied." ... could someone help me with this?
[15:55:05] <Corwin> you need root privileges for that command
[15:55:27] <LoRez> no you don't
[15:55:38] <Corwin> you sure?
[15:55:43] <LoRez> add yourself to the dialout group
[15:55:45] <specing> Yes, you do...
[15:55:49] <LoRez> no, you don't.
[15:55:56] <LoRez> you need privileges, not root
[15:56:01] <specing> Well unless you hax the permissions
[15:56:14] <LoRez> s/hax/properly set up/
[15:56:16] <specing> And the only way to do that is with root
[15:56:31] <rumbot> please treat me as a noob. what do i need to do?
[15:56:38] <specing> LOL
[15:56:42] <LoRez> use windows
[15:56:45] <Corwin> :D
[15:56:48] <specing> :)
[15:57:07] <specing> rumbot: use -P usb before -c usbtiny
[15:57:11] <vectory> LoRez: worst recommendation ever :)
[15:57:20] <LoRez> vectory: not by a long shot.
[15:57:31] <vectory> ;)
[15:57:51] <rumbot> "cant open device usb"
[15:58:10] <specing> doh
[15:58:12] <LoRez> rumbot: I'd at least sudo chgrp $LOGNAME /dev/ttyS0
[15:58:35] <specing> LoRez: udev should override it almost instantly
[15:58:57] <LoRez> specing: it won't fix permissions unless the device goes away and comes back
[15:59:15] <LoRez> at least not on debian/ubuntu
[15:59:50] <specing> I remember it kept nagging when I tried to do that with /dev/kvm
[16:00:02] <LoRez> a more long-term fix would be recommended, but that's better than running avrdude as root unnecessarily
[16:00:08] <timemage> rumbot, what do you get when you ls -l /dev/ttyS0 ?
[16:00:30] <rumbot> ok i tried and also tried sudo avrdude ... -> "cant set attributes for device /dev/ttyS0 inappropiate ioctl for device
[16:00:32] <specing> ttyS0 is irrelevant for him
[16:00:43] <specing> he is using an USBtinyISP
[16:01:07] <LoRez> true
[16:01:52] <rumbot> timemage: crw-rw---- 1 root thomasortner 4, 64 Jun 4 22:27 /dev/ttyS0
[16:02:07] <LoRez> heh, he did the chgrp
[16:02:09] <timemage> rumbot, i take it you were already messing with chgrp.
[16:02:33] <rumbot> never used chgrp
[16:02:40] <rumbot> oh
[16:02:51] <specing> ADMIT IT :P
[16:03:01] <rumbot> of course i did :D 2 min ago when LoRez told me to ;)
[16:03:09] <timemage> rumbot, and what for ls -l /dev/tty{USB,ACM}*
[16:03:35] <rumbot> crw-rw---- 1 root dialout 188, 0 Jun 4 22:28 /dev/ttyUSB0
[16:03:59] <timemage> rumbot, when you unplug the physical device that device file disappears?
[16:04:01] <OndraSter> arrgh, I am looking for some A2DP BT capable receiver IC, any hints?
[16:04:11] <specing> -.-
[16:04:59] <LoRez> not if it's a usbtiny
[16:05:01] <rumbot> timemage it does
[16:05:14] <specing> rumbot: whats the vid:pid of the usbtiny?
[16:05:20] <specing> (lsusb)
[16:05:21] <timemage> rumbot, try: sudo usermod -a -G dialout $USER
[16:05:23] <LoRez> whut?
[16:06:08] <specing> I dismantled my usbtiny like a week ago...
[16:06:17] <rumbot> timemage i tried. same error.
[16:06:24] <specing> rumbot: what is it?
[16:06:24] <timemage> rumbot, open a new terminal window.
[16:06:36] <rumbot> specing i dont know what a vid:pid is
[16:06:38] <LoRez> a usbtiny shouldn't make a serial port show up
[16:06:53] <specing> rumbot: vendor id:product id
[16:06:56] <specing> rumbot: usb stuff
[16:07:09] <timemage> rumbot, you're assigned to groups when you log in. so until you log again (open another terminal) you won't properly belong to the group.
[16:07:28] <rumbot> specing: sorry, how do i check it
[16:07:34] <timemage> rumbot, when you open the new term, see what running "id" gets you.
[16:07:44] <specing> rumbot: lsusb
[16:08:43] <timemage> rumbot, you should see dialout in the groups= section.
[16:09:24] <rumbot> got a new error after opening a new terminal: avrdude: Error: Could not find USBtiny device (0x1781/0xc9f)
[16:09:31] <rumbot> :(
[16:09:49] <Tom_itx> what programmer do you have?
[16:10:35] <timemage> rumbot, well, one problem down.
[16:10:49] <specing> rumbot: stick the following line into a file name /etc/udev/rules.d/999-mine.rules:
[16:10:52] <specing> SUBSYSTEM=="usb", SYSFS{idVendor}=="1781", SYSFS{idProduct}=="0c9f", GROUP="users"
[16:10:57] <Tom_itx> seems everyone assumed he had the right programmer selected
[16:11:09] <specing> rumbot: and replug the thing
[16:11:10] <Tom_itx> and started bickering about root
[16:11:27] <timemage> Tom_itx, he wasn't getting as far as opening the port. so it didn't matter so much.
[16:11:42] <Tom_itx> no but the bickering wasn't helping him
[16:11:43] <rumbot> http://shop.myavr.de/index.php?404;http://myavr.de:80/shop/article.php?artDataID=36
[16:11:59] <timemage> Tom_itx, i was bickering?
[16:12:03] <rumbot> a friend told me to use usbtiny. looks like i should use avr910 or avr911
[16:12:29] <LoRez> now wt giant f is that programmer
[16:12:36] <timemage> rumbot, what is the actual device?
[16:13:01] <specing> lol
[16:13:21] * Tom_itx slaps specing for posterity
[16:13:33] <rumbot> timemage what do you mean?
[16:13:45] <LoRez> AVR911 programmer, so it is apparently a serial device.
[16:14:37] <timemage> rumbot, product name, model number, link to the item you bought.
[16:14:38] <rumbot> its connected via usb ...
[16:14:43] <rumbot> http://shop.myavr.de/index.php?404;http://myavr.de:80/shop/article.php?artDataID=36
[16:14:49] <LoRez> serial over USB
[16:18:24] <rumbot> damn s crashing .... ill be back in a minute
[16:19:12] <timemage> rumbot, try setting an option for 19200 baud.
[18:36:18] <cehteh> ldi r3,2 spies out 'register number above 15 required' is that a hardware limitation or a gcc barf?
[18:42:05] <OndraSter> hardware limitation
[18:42:12] <OndraSter> immediate instructions work only on r16 - 31
[18:43:13] <timemage> cehteh, http://www.atmel.com/Images/doc0856.pdf look at page 94
[18:43:38] <cehteh> ah thanks
[18:43:57] <timemage> cehteh, register number encoded with 4 bits.
[18:44:39] <cehteh> ok
[18:46:11] <cehteh> i want to bind few commonly used global vars to registers to avoid excessive load/store instructions (tiny13, save program space) .. this defeats the purpose slightly
[18:47:22] <cehteh> well ldi was only a test and is rarely used later
[18:54:42] <OndraSter> well on tiny13 one usually uses only asm
[18:54:44] <OndraSter> :P
[19:02:45] <cehteh> slowly i am concluding this
[19:03:14] <cehteh> maybe i write a skelleton in C, generate .s and then hand-modify that
[19:04:01] <cehteh> but i am really new to uC .. this is my first humble attempt :)
[19:15:34] <Casper> cehteh: are you a programmer on other architecture?
[19:21:43] <cehteh> Casper: linux / C system programming and higher level stuff, used to learn a bit m68k asm long long ago
[19:22:09] <Casper> ok, so in a way you are used to waste ressources then :/ hehe
[19:22:32] <cehteh> not more than it is comfortable
[19:23:07] <cehteh> i am just surprised by gcc .. on one thing its smart, on another its stupid :)
[19:23:14] <Casper> yeah
[19:23:42] <Casper> and there is some bugs that are still open years after they opened it up, and some even offered bugfix...
[19:24:17] <cehteh> i am not that far yet to discover these on avr ..
[19:24:28] <cehteh> and i would like to avoid to do all in asm
[19:24:47] <Casper> usually C do the job
[19:24:51] <karlp> and you want to use a tiny13?
[19:24:55] <karlp> and you want to avoid asm?
[19:25:11] <cehteh> its just a very small thing i am planning to do
[19:25:53] <cehteh> brought some tiny45 and tiny85 as well .. but hey, where is the challenge :)
[19:28:04] <cehteh> blinker/beeper for a model helicopter, watches the throttle channel, if grounded for some time it starts to beep (lost plane crying for help) and monitor the battery and blink the led depending on the voltage level
[19:28:43] <cehteh> i found an beeper only thing for the tiny13, but want to improve it slightly
[19:31:07] * cehteh wonders if -ffreestanding and some inline asm will still be more comfortable than using asm entirely
[21:29:01] <cehteh> are registers all initialized to zero at cold start?
[21:29:44] <Tom_itx> default values are given in the device .pdf file
[21:31:35] <cehteh> i mean the general purpose registers not the control registers
[21:31:43] <Tom_itx> i believe so
[21:31:59] <cehteh> i'll see :)
[21:32:09] <Tom_itx> the memory section will tell you probably
[21:32:15] <Tom_itx> but they should be
[21:32:27] <Tom_itx> don't assume they are
[21:32:39] <Tom_itx> that's just poor programming
[21:41:18] <cehteh> heh
[21:41:33] <cehteh> if its well defined then its ok .. i want to save every byte :)
[21:43:24] <Tom_itx> i would rely only on the docs then. not someone's advice
[21:44:15] <cehteh> yes, i hoped someone here could give an authorative answer as in "I know" .. not "i believe"
[21:44:39] <cehteh> but this thing is just a toy and nothing critical so i am not much concerned
[21:44:58] <Tom_itx> if abcminiuser were here he could.
[21:45:05] <Tom_itx> he's part of atmel tech support now
[21:45:40] <cehteh> well i assume that people dont want to give false advices here willingly :)
[21:46:05] <cehteh> i didnt found it in the datasheet yet, i just assume its zeroed for now and keep it in mind
[21:47:09] <Casper> afaik, registers are NOT zeroed
[21:47:14] <Casper> as memory is not
[21:47:24] <Casper> well
[21:47:32] <Casper> the r0-r31 I mean
[21:47:49] <Casper> but the "named" registers are resetted to the default specified in the datasheet
[21:47:58] <Casper> but they are not all to zero, some bits are to 1
[21:49:08] <Landon> I'd go with what casper says, there's nothing indicating initial value in the r0-r31 register diagrams (unlike the SREG diagram on the previous page of the t2313 datasheet)
[21:50:44] <Tom_itx> like i said, if the data sheet don't say it.. it ain't so
[21:51:04] <Tom_itx> after all, they're never wrong :D
[21:52:08] <Casper> correction: almost never wrong
[21:52:28] <Landon> well
[21:52:34] <Landon> they're never right about what they don't say :P
[21:53:45] <cehteh> ah ok thanks
[21:58:12] <cehteh> this datasheets are fun sometime .. reading eeprom takes 6cycles? 4 is mentioned as 'cpu halted' and 2 for the actual running instructions? if not blocked of course
[22:00:42] <Casper> possible
[22:00:46] <Casper> eeprom is slow
[22:07:19] <cehteh> works for me, i only read it
[22:08:25] <cehteh> anyways .. good night .. tomorrow is another day
[22:20:02] <iR0b0t1> Would it be possible to use the "overdrive" one-wire protocol on an 8MHz ATtiny85?
[22:23:02] <Casper> what's the difference?
[22:23:21] <Casper> is it more than 4MHz clock cycle?
[22:30:34] <iR0b0t1> Casper: It is exactly 4MHz clock cycle
[22:30:37] <iR0b0t1> I dunno if I can do it with a timer
[22:30:49] <iR0b0t1> my idea was to use the high speed timer/counter1, but that might be *too* fast.
[22:31:34] <iR0b0t1> Other option was software delays.
[22:31:40] <iR0b0t1> Which might work out better
[22:31:49] <Casper> basically the avr can toggle pins at half of it's F_CPU
[22:32:04] <Casper> so you can go as fast as F_CPU/2 if using hardware
[22:36:43] <iR0b0t1> okay
[22:36:49] <iR0b0t1> damn, there goes my other timer
[22:37:06] * iR0b0t1 would like designers to put in more timers on their chips.
[22:42:56] <Casper> maybe you rely too much on them?
[22:42:59] <Casper> as in bad coding?
[22:43:05] <iR0b0t1> I've tried.
[22:43:16] <iR0b0t1> But I'm decoding IR signals, which probably needs a timer
[22:43:32] <iR0b0t1> and one-wire probably needs a timer, at least for reception
[22:44:21] <iR0b0t1> Is using multiple pins on the same port for a pin-change interrupt (IE, same protocol handler is used) a bad idea if you're doing protocol decoding?
[22:44:42] <iR0b0t1> I guess if you could guarantee only one protocol would be active at a time.
[22:45:53] <iR0b0t1> er, same pin change interrupt is used
[22:46:14] <iR0b0t1> It'd be like cramming two state machines in there, and you'd have to pick. Would be awkward.
[22:46:57] <iR0b0t1> Yeah okay, rambling.
[22:47:00] * iR0b0t1 sees himself off.
[22:48:33] <iR0b0t1> Casper, I am wondering now: what is something you could use a timer for but would not need to?
[22:49:07] <Casper> use hardware stuff instead of software uart
[22:49:24] <iR0b0t1> ?
[22:50:03] <iR0b0t1> I have a USI but I do not think it will be useful to me. I tried TWI, but 1) I can't debug it, 2) it uses one more pin than I would like.
[22:50:29] <iR0b0t1> Using it would, also, 3) negate the benefit of freeing up the timer, as I could not use the PWM pins.
[22:50:43] <iR0b0t1> I need a different device, it would seem.