#avr | Logs for 2013-02-10

Back
[05:12:40] <OndraSter> 'sup abcminiuser
[05:13:51] <OndraSter> so have you heard my evil plan abcminiuser ? If you talk to the board on 1200 baud (USB CDC) it will be talking to the bootloader. If you will be using any other baud rate = application
[05:14:06] <OndraSter> too bad AVR hasn't got hardware breakpoints accessible from "code"
[05:14:47] <specing> 120 character/s to bootloader? That is going to take a while.
[05:15:07] <OndraSter> specing, USB CDC I said
[05:15:13] <OndraSter> baud rate does not matter
[05:15:18] <OndraSter> it still is USB Full Speed :P
[05:15:29] <specing> hmm ok
[05:17:25] * abcminiuser is back, apparently in Norway your water pipes can freeze...
[05:17:29] <OndraSter> eh
[05:17:33] <abcminiuser> OndraSter, hrm, that sounds difficult to pull odd
[05:17:35] <abcminiuser> *off
[05:17:37] <OndraSter> why?
[05:17:50] <abcminiuser> Switching live between the two stacks
[05:17:56] <OndraSter> there won't be two stacks
[05:18:02] <OndraSter> the app will be using the bootloader's one
[05:18:20] <OndraSter> if it wants to use its own - okay, but no bootloader communication anymore :P
[05:18:29] <OndraSter> reset to jump to bootloader
[05:19:17] <abcminiuser> Ah right
[05:19:20] <abcminiuser> That would work
[05:20:54] <OndraSter> btw what is the "Enable USB pull ups during reset" -- it keeps the USB connection happy, right?
[05:22:16] <abcminiuser> Ja, if you don't the host will see a disconnect
[05:55:21] <foo808> Hi all. Is there any good way of synchronizing two output compare channels to be on the same phase using atmega328p?
[06:16:47] <ziph> abcminiuser: You're still in that third world hellhole? ;)
[06:25:02] <abcminiuser> ziph, yeah :P
[06:25:14] <abcminiuser> No girlfriend makes it suck a bit more than it did before
[06:25:18] <ziph> abcminiuser: Hooked on lutefisk yet? :)
[06:25:24] <abcminiuser> Jesus no
[06:25:28] <ziph> Oh?
[06:25:34] <abcminiuser> I found an Asian grocer yesterday, so I've bought ALL THE REAL FOOD
[06:25:36] <ziph> Did she freeze in the winter?
[06:25:48] <abcminiuser> She's moved back to Australia because of family/job
[06:25:55] <abcminiuser> Which kinda cramps my style here
[06:26:02] <ziph> Ah, right.
[06:26:06] <abcminiuser> Love the job, but that means I can't stay here forever..
[06:27:02] <ziph> Google Images on "Norwegian Girls" seems to suggest another solution.
[06:27:07] <ziph> ;)
[06:27:25] <ziph> She couldn't find work there?
[06:28:30] <ziph> (Waits for abcminiuser to get back from Googling "Norwegian Girls"... ...)
[06:28:41] <abcminiuser> Har der har har
[06:28:55] <abcminiuser> No fun being in a land of supermodels when you're the ugly duckling...
[06:29:16] <ziph> It looks warm based on what they're wearing...
[06:30:01] <ziph> Considered going for Atmel US? Might be less of a culture shock for your girlfriend.
[06:31:02] <abcminiuser> Nah, she's after family more than anything, can't replace that
[06:31:10] <abcminiuser> Might try for a FAE job in Australia eventually
[06:35:38] <foo808> Family first!
[06:35:41] * foo808 locks the door
[06:35:44] <foo808> good riddens
[07:00:45] <schnuws> hello! Anyone who can recommend linux tools equivalent to atmel studio? Need to assemble code, simulate and program..
[07:17:07] <inflex> gvim, avr-gcc :)
[07:17:22] <inflex> ja ja ja, I know, gvim isn't really like studio at all
[07:19:06] <schnuws> how about simulation?
[07:19:14] <creep> OndraSter_<< autobaudrate rulez
[07:19:41] <inflex> schnuws: basically you don't really have a genuinely practical option in linux for that. That said, I've never missed it - I just work directly on the hardware
[07:21:24] <schnuws> oh, ok =(
[07:22:39] * inflex loves his linux, and it's sad that there isn't a linux native Atmel Studio, but I can live with that.
[07:23:02] <inflex> About the only timeI ever really yearned for a sim was when I didn't have the gear with me here, ie, I was waiting for it to arrive after I had ordered it :D
[07:24:05] <schnuws> I only have access to the hardware at school, would have been awesome to be able to simulate at home :P
[07:27:24] <Horologium> is simulavr still actively developed?
[07:28:20] <creep> yey Horologium
[07:45:58] <inflex> schnuws: what country are you in?
[07:46:14] <schnuws> inflex: sweden, why?
[08:11:19] <inflex> schnuws: ah, if you were in AU I'd just send you some chips
[08:13:31] <schnuws> inflex: how nice of u :D
[08:13:49] <schnuws> If I should buy few chips, what do I need to program them?
[08:16:12] <vsync_> 10 black candles, full moon, a newborn, a hatchet... the list is pretty long
[08:16:13] <specing> schnuws: Ask them if you can borrow
[08:17:58] <schnuws> ...
[08:26:30] <jkmma> hello
[08:28:37] <specing> schnuws: if they are a good school they will let you borrow it
[08:32:19] <Malinuss> schnuws, someone wrote this nice little tutorial that explains what methods you can use to program your avr chips: http://tom-itx.dyndns.org:81/~webpage/abcminiuser/articles/avr_prog_methods_index.php
[08:35:09] <jkmma> http://forums.obdev.at/viewtopic.php?f=8&t=8254&sid=e556a241efad0b80e8bc4c2d11120d08
[08:35:12] <jkmma> help me plz..
[08:35:54] <schnuws> AVRISP MKI/II connects to the usb port, correct?
[08:36:14] <schnuws> thx btw ^
[08:40:26] <Malinuss> schnuws, yep... If you want a cheap one Tom_itx is making them himself
[08:46:20] <schnuws> Which works for everything the original does?
[08:46:32] <Malinuss> yeah
[09:04:15] <schnuws> Would it be possible to use an arduino to program the chip without the bootloader?
[09:10:45] <Tom_itx> you want to use an arduino to program another chip?
[09:11:42] <schnuws> I want to know if it's a possibility to use it as an isp
[09:11:48] <dunz0r> schnuws: I think so. The ArduinoAS-ISP works as any other atmega328-based ISP
[09:11:50] <schnuws> might be a stupid question
[09:12:08] <dunz0r> schnuws: I haven't tried it myself, but I see no reason that it shouldn't work.
[09:12:11] <Tom_itx> you may be able to but i'm not familiar with how they do it
[09:12:27] <schnuws> Couldnt find any info on google aswell, so I should probably skip that
[09:12:28] <schnuws> ^^
[09:12:37] <schnuws> Tom_itx: but you sell programmers?
[09:12:50] <Tom_itx> you'll get better support here going down a more conventional path
[09:12:55] <Tom_itx> i have some yes
[09:13:25] <dunz0r> schnuws: It's probably less of a hassle to just get a "proper" ISP. They're not expensive.
[09:13:47] <schnuws> probably
[09:14:08] <dunz0r> schnuws: I have a friend who used his arduino as an ISP though, no issues according to him.
[09:14:13] <dunz0r> ISP for "real" C that is.
[09:14:54] <schnuws> Guess that would be the same for assembler
[09:15:16] <dunz0r> schnuws: It's just a programmer, it'll program your chip with whatever hex-file you send it.
[09:15:19] <Tom_itx> no matter. you just need a .hex file
[09:15:38] <schnuws> figured
[09:26:04] <schnuws> yay, found a tutorial on sparcfun.com
[09:32:35] <Malinuss> schnuws, the arduino, only supports a few chips to program trough the ISP, iirc only tiny's actually.
[09:32:49] <Tom_itx> that method would be considerably slower
[09:33:10] <schnuws> oh oki
[09:33:22] <Tom_itx> i found the article
[09:33:42] <Tom_itx> programming at 19200 baud
[09:54:04] <bluesceada> hm someone knows how i can get the address of a label in avr assembler?
[09:54:12] <bluesceada> (of course they should be for the same segment..)
[09:54:43] <bluesceada> i have a label and a lot of .db entries and want to know the size of these by subtracting the first label minus a label directly following it
[09:54:52] <bluesceada> i dont always want to manually count that x.x
[10:02:24] <creep> hey
[10:15:33] <Tom_itx> bluesceada, look at the .lst file
[10:17:05] <bluesceada> Tom_itx: that doesnt help
[10:17:32] <bluesceada> i mean ok, .. but going back and forth is not very straightforward
[10:17:56] <Tom_itx> that's about the only way you'll find it
[10:18:20] <bluesceada> why is there no possibility to do .equ DescriptorSize =&StartDescriptor-&EndDescriptor
[10:18:26] <bluesceada> wtf....
[10:18:48] <Tom_itx> unless abcminiuser has some insight on it...
[10:19:00] <bluesceada> ok
[10:19:16] <bluesceada> would be really helpful ...
[10:22:51] <OndraSter_> just use it, bluesceada ?
[10:23:00] <OndraSter_> as in, ldi r16, low(somelabel)?
[10:23:01] <bluesceada> use what?
[10:23:08] <OndraSter_> ldi r17, high(somelabel)
[10:23:09] <OndraSter_> does not work?
[10:23:21] <bluesceada> but i just want one equ that has the size in it
[10:23:30] <OndraSter_> uh huh?
[10:23:36] <OndraSter_> size?
[10:23:38] <OndraSter_> you wanted address
[10:23:42] <bluesceada> size in byte
[10:23:46] <bluesceada> from one label to the next
[10:23:52] <OndraSter_> oh
[10:23:59] <bluesceada> it is a usb descriptor page
[10:24:03] <OndraSter_> if secondlabel - firstlabel does not work
[10:24:04] <OndraSter_> heh usb
[10:24:06] <OndraSter_> what chip?
[10:24:11] <bluesceada> atmega8
[10:24:27] <OndraSter_> v-usb? :o
[10:24:28] <bluesceada> i am trying to use mjoy and make it behave to my ways, harder than thought
[10:24:34] <bluesceada> it is based on that i think, yes
[10:24:39] <bluesceada> and it is only written in assembly
[10:24:58] <bluesceada> i thought that in assembly there are useful macros at least
[10:25:02] <bluesceada> but is really a big pain to use
[10:25:06] <OndraSter_> I gotta run, good luck with USB
[10:25:11] <OndraSter_> USB is a big pain to use on its own
[10:25:12] <bluesceada> usb works already ...
[10:25:13] <OndraSter_> even with hardware usb
[10:25:26] <bluesceada> the problem is only to customize it to my needs
[11:27:18] <Tom_itx> abcminiuser where did you move the compile switches to?
[12:04:18] <Tom_itx> abcminiuser, finally posted the eeprom updates
[12:38:14] <Tom_itx> for those that have the programmer there's an update available. It now saves the ISP SPI frequency in eeprom now so you don't have to select it in studio in case your target requires a different frequency than the default.
[16:03:15] <dunz0r> Wow. Now I feel stupid.
[16:03:24] * dunz0r just realised why his AD-values were mystically 8-bit
[16:03:45] <Casper> dunz0r: you used the fast mode?
[16:03:51] <dunz0r> If you store the values in an unsigned char instead of an unsigned 16bit int, you won't get 8-bits of resolution
[16:04:08] <Casper> :D
[16:04:12] <dunz0r> Casper: Nope. Stored a 10bit value in an 8-bit int :D
[16:04:48] <Casper> and lost the 2 MSB
[16:04:48] <dunz0r> Yup.
[16:04:48] <dunz0r> I started to consider that my atmega had broken or something.
[16:04:52] <Casper> hehe
[16:04:52] <dunz0r> A register getting "stuck" or something.
[16:20:50] <Malinuss> dunz0r, also fiy: AS have some cool pre-made macros, like "ADC", which just returns both the high end low byte
[16:21:08] <Malinuss> so you don't have to do it yourself
[16:23:57] <OndraSter_> 16bit registers
[16:25:17] <dunz0r> Malinuss: Yeah. AVR-GCC has it too I think
[16:25:48] <Tom_itx> or declare a 16bit var and just read the reg
[16:26:07] <dunz0r> Tom_itx: That's what I do now.
[16:26:07] <Malinuss> Tom_itx, but if it's in two registers?
[16:26:29] <Tom_itx> i think gcc will read it as one
[16:26:35] <Tom_itx> i could be mistaken
[16:28:03] <Malinuss> I'm pretty sure it won't is AS. I did it by mistake and only got the first 8 bits.
[16:28:54] <Tom_itx> so read both and shift it in
[16:32:13] <Malinuss> yeah I know, just saying
[16:32:25] <Malinuss> it's nice that you have macros that already do that
[16:32:39] <Malinuss> so you can just return(ADC)
[16:37:51] <Malinuss> I got hit on by a chic today, because I change colors of the graphs using "R code".. "Oh you are so skilled with computers <3" "yeah I know".. Alpha as fuck
[16:38:34] <dirty_d> lol
[16:42:06] <Malinuss> 1) learn R 2) get laid
[16:49:32] <Tom_L> u dawg
[16:53:56] <specing> What is this "R"?
[16:55:55] <OndraSter_> resistor codes :)
[16:57:28] <Malinuss> specing, "R is a free software environment for statistical computing and graphics."
[17:04:10] <OndraSter_> I feel like a god now that I have mastered it :P
[17:04:14] <OndraSter_> it = USB
[17:18:30] <Tom_itx> you da master now ehh?
[17:43:08] <OndraSter_> indeedy, Tom_itx
[17:43:14] <OndraSter_> I could help abc with xmega USB :P
[17:43:17] <OndraSter_> too bad he is done
[18:00:15] <Casper> I wish I was better with smps... I'ld like to make my own openups, but better
[18:00:28] <Casper> the kind 15A in 10A out :D
[18:00:37] <dirty_d> OndraSter_, i did USB on my stm32, a few days ago, that was an adventure
[18:00:45] <Casper> so I can have 5A for the charger :D
[18:01:33] <OndraSter_> dirty_d, complete USB stack?
[18:01:48] <dirty_d> OndraSter_, what do you mean?
[18:01:55] <OndraSter_> well, what part did you write?
[18:02:07] <OndraSter_> how deep did you have to go?
[18:06:01] <dirty_d> OndraSter_, of it has a usb peripheral
[18:06:11] <dirty_d> im not sure how it compares to xmega, i havnt used usb on it
[18:06:20] <dirty_d> basically it takes care of all the low level stuff
[18:06:41] <dirty_d> you tell it what data to send etc and to respond with ACK/NAK/STALL etc
[18:07:23] <OndraSter_> sounds identical
[18:07:28] <dirty_d> handles transmission errors and stuff
[18:07:33] <OndraSter_> yes
[18:07:35] <OndraSter_> identical then
[18:07:35] <dirty_d> cool
[18:08:20] <dirty_d> i made a class that reads in a device descriptor and config descriptor and initializes all the endpoints and stuff from it automatically
[18:08:51] <dirty_d> OndraSter_, what kinda throughput have you got with USB?
[18:08:51] <OndraSter_> eh
[18:08:54] <OndraSter_> well
[18:09:02] <OndraSter_> on full speed you can't get much above 8.something Mbps
[18:09:22] <OndraSter_> they did some testing @ atmel hq
[18:09:28] <OndraSter_> they pushed it to 8.67Mbps I think
[18:09:33] <OndraSter_> the highest of all common micros with USB FS
[18:09:38] <OndraSter_> with nearly 0% CPU load (DMA
[18:09:58] <OndraSter_> but in reality you can get much less
[18:10:01] <OndraSter_> with CDC
[18:17:52] <dirty_d> damn internet
[18:18:31] <OndraSter_> dirty_d, zlog
[18:18:42] <dirty_d> how do i use that?
[18:18:51] <OndraSter_> say zlog :)
[18:18:58] <dirty_d> say zlog
[18:18:59] <dirty_d> jk
[18:19:01] <dirty_d> zlog
[18:19:02] <OndraSter_> lol
[18:19:41] <dirty_d> i didnt use CDC
[18:19:44] <OndraSter_> oh
[18:19:54] <dirty_d> i just have an in and out endpoint
[18:19:58] <dirty_d> and i used libusb
[18:20:43] <OndraSter_> CDC was for me much better -- I can simply use it from my application cross platform (simple serial read/write) plus the user can use it very easily from his application
[18:20:53] <dirty_d> true
[18:21:16] <dirty_d> i think libusb is portable too
[18:21:28] <OndraSter_> no idea, I am doing it in C# :)
[18:21:32] <OndraSter_> runs in Mono so far good
[18:21:46] <dirty_d> dont have to know which /dev/tty... it is either
[18:21:47] <OndraSter_> haven't tried communicating with the board yet though
[18:21:54] <dirty_d> ahh
[18:22:02] <dirty_d> whats in C#?
[18:22:09] <OndraSter_> neither do I - I try opening all of them in sequence on special baud rate (1200) and ask 0x00 and wait if reply of 0x5A arrives or not
[18:22:15] <OndraSter_> SerialPort class :)
[18:22:26] <dirty_d> on the avr?
[18:22:30] <OndraSter_> on the PC side
[18:22:32] <dirty_d> oh ok
[18:22:36] <OndraSter_> lol
[18:22:44] <dirty_d> i actually used pythons pyusb
[18:22:48] <dirty_d> it was like 8 lines of code
[18:22:49] <dirty_d> lol
[18:22:50] <OndraSter_> .net micro framework runs on ARM only, not on anything small like AVR
[18:22:53] <OndraSter_> lol
[18:23:08] <dirty_d> you just need the vendorid and productid
[18:23:11] <dirty_d> and it finds it
[18:23:18] <dirty_d> its actually really easy to use libusb
[18:23:31] <dirty_d> brb food
[18:38:53] <dirty_d> OndraSter_, ive been using c++11 for all my stm32 programming, http://codepad.org/buOZpUPq
[18:39:02] <dirty_d> constexpr is awesome for microcontroller stuff
[18:39:36] <dirty_d> i got the device_desc and configuration_desc stuff from someone else
[18:39:37] <OndraSter_> I am using regular C
[18:39:47] <OndraSter_> because I need to fit whole bootloader into 7kB
[18:39:50] <OndraSter_> or 7.5kB
[18:40:02] <dirty_d> theyre constexpr functions, so its not actually a function call, but a constant
[18:40:09] <dirty_d> it just makes writing the descriptors easier
[18:40:46] <dirty_d> also the functions that parse the descriptors are constexpr, so if the args are constant, its all constants at compile time with no function calls
[18:40:59] <OndraSter_> device_driver.process -- no FIFO + interrupts?
[18:41:11] <dirty_d> OndraSter_, nah i did that before i learned about the interrupts
[18:41:55] <dirty_d> it doesnt take much cpu time anyway
[18:42:29] <dirty_d> it transfers 10MB in about 3 sec, so thats 64 bytes transfered per every iteration of that while loop
[18:42:53] <OndraSter_> but you have to run the process() just to see if any data were transferred :)
[18:42:56] <OndraSter_> or requested
[18:43:19] <mog> does anyone know of a project where someone built an optical bootloader for the avr? it worked by flashing black and white on the monitor
[18:43:24] <mog> i cant seem to find it
[18:43:29] <dirty_d> si u guess the while loop runs at about 10KHz
[18:43:38] <dirty_d> wait no faster
[18:43:51] <dirty_d> OndraSter_, right yea
[18:44:12] <OndraSter_> mog, lol?
[18:44:12] <dirty_d> id only be using USB for configuration stuff though, so other timing critical interrupts would be more important
[18:45:21] <dirty_d> OndraSter_, if i wanna use interrupts, i just have to stick process() in the USB ISR
[18:45:48] <OndraSter_> :)
[18:46:02] <dirty_d> ive only learned how to use them today, lol
[18:46:18] <dirty_d> the cortex-M4 NVIC is pretty damn neat
[18:46:50] <dirty_d> has priority groups and subgroups etc
[18:58:11] <mog> OndraSter_, i was slightly off but this is what i was looking for http://www.wayneandlayne.com/blinky_programmer/
[18:58:40] <OndraSter_> ah
[18:59:11] <mog> its pretty nifty project