#avr | Logs for 2016-08-24

Back
[04:28:42] <owl-v-> how can I make attiny85 delay with c ?
[04:44:42] <owl-v-> this warning... is it bad? should I ignore? # warning "Compiler optimizations disabled; functions from <util/delay.h> won't work as designed"
[04:51:58] <_ami_> owl-v-: are you using windows?
[04:52:04] <_ami_> using winavr?
[04:52:18] <owl-v-> osx + avr-gcc
[04:52:29] <_ami_> hmm..
[04:52:52] <_ami_> seems like libavr-c is not installed properly.
[04:53:01] <CORDIC> owl-v-: Take a quick look in `delay.h'. First of all it is busywaiting.
[04:53:11] <_ami_> try reinstalling it
[04:54:00] <_ami_> i had similar issue with winavr once. it used to work fine till i installed official atmel ide.. then winavr started complaining. "same error" which u got.
[04:54:12] <_ami_> i reinstalled winavr and problem has gone away.
[04:54:30] <owl-v-> I'm targeting attiny85
[04:54:48] <_ami_> owl-v-: does this error come only for t85?
[04:55:45] <_ami_> owl-v-: whats the binary size? i am sure its big.
[04:56:07] <CORDIC> owl-v-, _ami_: `delay.h' is using floating point math! With sufficient compiler optimizations it is calculated at compile time.
[04:56:45] <CORDIC> And no it is not specific to ATtiny85.
[04:57:44] <CORDIC> Answers are in that header file.
[05:00:29] <_ami_> CORDIC: __OPTIMIZE__ flag is not defined.
[05:00:40] <_ami_> probably owl-v- is not using correct gcc flag.
[05:00:57] <_ami_> owl-v-: did you enable optimization flags in gcc while compling?
[05:02:33] <ThatDamnRanga> you're better off setting a timer and handling the timer interrupt
[05:02:40] <owl-v-> after using avr-objcopy I get a size of 3147
[05:02:45] <ThatDamnRanga> delays are........ very inline
[05:03:14] <_ami_> ThatDamnRanga: delays are gonna increase the size if delay time is higher. :P
[05:03:33] <_ami_> owl-v-: hopefully u did not do _delay_ms(10000000); :P
[05:03:44] <owl-v-> avr-gcc -mmcu=attiny85 main.c -g3 -o attiny85
[05:04:11] <owl-v-> _delay_ms(1000);
[05:04:24] <_ami_> owl-v-: add -Os
[05:04:58] <owl-v-> what's -Os ?
[05:05:25] <_ami_> enables optimization
[05:05:27] <owl-v-> optimize space?
[05:05:52] <_ami_> for size
[05:05:53] <_ami_> yeaj
[05:05:57] <owl-v-> cool! now I have no warning and size is 283 !!
[05:06:04] <_ami_> coolness :)
[05:06:21] <_ami_> you could use -Wl,--relax -Wl,--gc-sections to reduce the size further.
[05:07:25] <_ami_> these are linker flag thoug
[05:07:53] <_ami_> i wonder why you type gcc command to compile the code.
[05:08:00] <_ami_> use the Makefile for ave.
[05:08:13] <_ami_> avr*
[05:08:37] <owl-v-> _ami_ that reduces obj file, not actual code ".text"
[05:08:38] <_ami_> a simple google search will yield a avr-makefile
[05:09:09] <_ami_> owl-v-: as i said earlier, its a linker flag.
[05:09:20] <owl-v-> avr-makefile?
[05:09:21] <_ami_> so yeah, reduces the obj size not text.
[05:09:26] <_ami_> makefile for avr.
[05:13:10] <owl-v-> how is avr-makefile different from makefile
[05:13:12] <owl-v-> ?
[05:15:19] <_ami_> its no different. i suggested you to use makefile for avr instead of typing avr-gcc everytime on shell.
[05:15:22] <_ami_> http://www.nongnu.org/avr-libc/user-manual/group__demo__project.html
[05:15:44] <_ami_> you can copy the makefile from above link.
[05:16:09] <_ami_> owl-v-: http://www.nongnu.org/avr-libc/examples/demo/Makefile
[05:17:35] <_ami_> http://arduino.stackexchange.com/questions/12114/basic-makefile-for-avr-gcc
[05:17:36] <owl-v-> oh, so it's semi-pre-configured makefile
[06:43:47] <jsoft> I stumbled into an error where it atmel studio was moaning about ADCSR not being defined, and apparently there is some bodge hack where you define it as ADCSRA. Does this seem legit?
[06:44:15] <jsoft> This is my first crack at avr studio / avr programming
[06:48:25] <Lambda_Aurigae> avr studio won't run on my computer, so I'm no help.
[06:50:32] <jsoft> Fair enough.
[06:51:46] <Lambda_Aurigae> have you checked to see how it is defined in the header files?
[06:52:23] <CORDIC> jsoft: Which device (like ATmega328P)?
[06:52:52] <Lambda_Aurigae> I suspect it's avr-libc definitions rather than anything to do with atmel studio.
[06:53:35] <jsoft> CORDIC, An Atmega8a
[06:54:39] <Lambda_Aurigae> there is no ACDSR in atmega8
[06:54:47] <Lambda_Aurigae> it is ACDSRA
[06:54:55] <Lambda_Aurigae> so, it's not a bodge hack.
[06:55:35] <Lambda_Aurigae> nothing to do with atmel studio at all.
[06:55:47] <Lambda_Aurigae> ADCSRA is how it is defined for that chip.
[06:56:03] <Lambda_Aurigae> it's right in the datasheet.
[07:02:07] <jsoft> Right.
[07:02:26] <jsoft> Im just preparing to bodge up some other code which was supposed to be all good to go, that was the only error I got.
[07:02:50] <jsoft> I've not even looked at the data sheet for registers and what not yet, but will do. Thanks
[07:32:47] <Palsson> I have a microcontroller that is connected to a module using UART, it seems that TX on my MCU only works as intended when i connect my FTDI breakout board to it. Anyone got any idea?
[07:38:55] <CORDIC> Palsson: I don't understand. I think You can connect RX of FTDI breakout board (for debugging) in parallel with RX of "module" to uC TX.
[07:42:58] <CORDIC> I think You need to provide more information. What do You mean ``works as intended''? How could connecting FTDI breakout board change operation of AVR peripheral?
[11:27:09] <owl-v-> somebody stopped developing html based compiler for avr ?? --> http://hackaday.com/2012/04/10/html-based-avr-compiler-aims-to-make-arduino-development-on-ios-possible/
[11:30:46] <owl-v-> not so good :( --> http://tadpol.org/Avrian-Jump/avrianjump.html
[12:11:49] <CORDIC> owl-v-: I can't remember if I saw anything worse than that.
[12:13:59] <owl-v-> XD
[14:02:24] <_ami_> does anybody know which module usbasp programmer uses when we connect it?
[14:02:28] <_ami_> on linux
[14:03:38] <_ami_> i can see 60-avrdude.rules file in /lib/udev/rules.d
[14:04:01] <_ami_> i commented the line for usbasp, so ideally usbasp should not be recognized by kernel
[14:04:16] <_ami_> but still its getting recognized.. i did reboot after changing udev rules.
[14:04:23] <_ami_> just wonder what i missed.
[14:04:25] <_ami_> hrm
[15:04:26] <gjm> _ami_: dmesg? lsusb?
[15:05:44] <gjm> try this: https://gist.github.com/arturcieslak/f097ad370d1fc90ba98a
[15:13:00] <_ami_> gjm: i wanted the opposite.
[15:13:05] <_ami_> not recognized
[15:14:19] <gjm> oh, sorry
[15:41:22] <_ami_> gjm: no problem.
[15:41:30] <_ami_> i figure out the problem though.
[15:42:09] <_ami_> it was the stupid reason for which my ldd was not catching the usb device. ;/
[15:42:51] <_ami_> gjm: i was trying to write linux device driver for my avr device.
[15:43:23] <_ami_> issue was wrong value provided to vendor and product id. i swapped those values and it worked fine.
[15:43:29] <_ami_> i wasted a lot time in this.
[15:43:33] <_ami_> :((
[15:49:54] <_ami_> 2 am here
[15:49:55] <_ami_> time to sleep
[15:49:57] <_ami_> nn guys
[17:42:22] <chupas> Anyone have any experence with alibaba? I have the following message: We don't have ali-pay account, so our company cann't create order on alibaba.
[17:42:22] <chupas> Could you pls tell me your address? So that i can check the freight charge and send invoice to your email.
[17:42:55] <chupas> Is it normal to do this outside of alibaba?
[17:44:18] <Lambda_Aurigae> sounds fishy to me.
[17:44:41] <chupas> I agree but also this seemed like one of the better suppliers ive looked at
[17:45:00] <chupas> perhaps its a better facade
[17:48:20] <chupas> https://ledhd.en.alibaba.com/company_profile.html
[19:07:15] <specing> Hey all
[19:07:20] * specing looks around
[19:07:33] <rue_house> I'm a starw guy
[19:07:39] <rue_house> straw
[19:07:44] <rue_house> not much into hay
[19:07:47] <specing> It has been some time since I was last shaking this channel
[19:08:01] <specing> but I was scouring through stuff on ebay
[19:08:03] <rue_house> I'm still building a 12' mecha
[19:08:17] <Lambda_Aurigae> hay is for horses..corn is tastier.
[19:08:19] <specing> and I find one seller with 11213 sold USBasp programmers
[19:08:21] <specing> 0.o
[19:08:27] <rue_house> my hexapod still isn't done
[19:08:40] <Lambda_Aurigae> yeah...usbasp sells well...
[19:08:43] <Lambda_Aurigae> unfortunately.
[19:08:46] <rue_house> toms are still better
[19:08:51] <specing> why unfortunately?
[19:09:17] <Lambda_Aurigae> usbasp are the cause of more questions and problems than any other programmer I've seen.
[19:09:42] <Lambda_Aurigae> bitbanging USB is a fun toy but not something I would want to rely on for a business.
[19:10:09] <rue_house> heh, is that what the usbasp is about?
[19:10:11] <specing> well... it is apparently also the most used programmer
[19:10:27] <rue_house> they are $2
[19:10:30] <rue_house> so yea
[19:10:31] <specing> less
[19:10:37] <specing> http://www.ebay.com/itm/USBASP-USBISP-AVR-Programmer-Adapter-10-Pin-Cable-USB-ATMEGA8-ATMEGA128-Arduino-/310506909410?hash=item484ba76ee2:g:ZWQAAOSw-KFXehMl
[19:10:39] <rue_house> I'm canadian
[19:10:42] <specing> here is the ad in question
[19:11:04] <specing> I think my previous programmer was a homemade usbtiny
[19:11:19] <rue_house> I use a mega32u2
[19:11:25] <specing> wait no
[19:11:28] <rue_house> the u4 is 'too special'
[19:11:34] <specing> it was something with atmega8u2
[19:11:45] <rue_house> so its been sitting around unused for a WHILE :/
[19:11:45] <specing> but it stopped working for some unknown reason
[19:11:54] <rue_house> you blowed it up
[19:12:04] <specing> its still in one piece
[19:12:28] <specing> not counting the USB B connector which I forgot to flip in schematics...lol
[19:12:49] <Lambda_Aurigae> my first ever avr programmer from 2001 still works.
[19:13:18] <specing> I think I'll just buy this usbasp, $1.69 is cheap for a backup programmer
[19:13:37] <Lambda_Aurigae> in fact, I use it more than any other AVR programmer
[19:13:51] <specing> the atmega8u2 was bootstrapped via serial port bitbanging (with 3v3 zeners)
[19:14:02] <specing> it must have took like a whole day to program it, lol
[19:14:13] <Lambda_Aurigae> my main programmer is a 74ls244 based stk200 clone.
[19:14:52] <Lambda_Aurigae> and, yes, my modern computer still has a parallel port
[19:15:02] <Lambda_Aurigae> built into the motherboard even.
[19:15:07] <specing> I don't do AVRs anymore though
[19:15:14] <specing> now its more or less just FPGAs
[19:15:28] <Lambda_Aurigae> yeah..haven't made that jump myself.
[19:15:40] <specing> I wanted to upgrade to 32 bit but was too impatient to wade through all those clock enables
[19:15:42] <Lambda_Aurigae> mostly I've been doing pic32 these days.
[19:15:50] <specing> got some stm32 and lm4s devkits
[19:15:55] <specing> gathering dust
[19:16:18] <Lambda_Aurigae> sounds like my rPI
[19:16:39] <Lambda_Aurigae> ok...tired, bored, and off to bed.
[19:16:40] <Lambda_Aurigae> laters.