#avr | Logs for 2014-11-15

Back
[03:07:38] <hypermagic> back a bit what's up?
[03:20:43] <malinus> I keep looking into the avr-gcc manual, but I can't figure out which header to include and/or which flags to set to allow the usage of the function "asm". Any ideas?
[03:21:09] <hypermagic> hmm
[03:21:20] <hypermagic> i think it should be the same as in PC-C
[03:21:40] <hypermagic> i only used C for atmega yet
[03:22:00] <hypermagic> you need to include headers for asm?
[03:22:40] <malinus> nope, I just want the inline asm function 'asm("asm code, code")'
[03:23:17] <malinus> eh I figured it out
[03:23:54] <hypermagic> i think you will want to use the intel syntax too :)
[03:23:56] <malinus> after searching the header files for "asm", apperently you have to use " __asm__ __volatile__ ("ldi R18,23");"
[03:24:00] <hypermagic> pass -masm=intel to gcc
[03:24:12] <malinus> nah I don't care about the syntax that much
[03:24:15] <malinus> I can use both
[03:24:21] <hypermagic> good for you
[03:24:28] <hypermagic> i get annoyed big time from the default crap
[03:24:56] <hypermagic> everything can be learned but it is stupid
[03:25:28] <malinus> I still can't fiure out where that function is defined though
[03:26:31] <hypermagic> what? you mean the instruction?
[03:26:47] <malinus> no, the function __asm__
[03:28:36] <hypermagic> here is a memcpy i did last year http://pastebin.com/n0ptAKRw
[03:29:24] <hypermagic> (example for inline asm in C)
[03:29:26] <malinus> "hyperfast" hehe
[03:29:46] <malinus> yeah I know how to use it, the manual says that much
[03:29:55] <malinus> it just uses the wrong function name for some reason
[03:31:32] <hypermagic> nah i set the scrollback size instantly from 500 to 16384, i have a few GB of free memory, it maybe fits in.
[04:08:30] <Tom_itx> malinus i'm not sure i included any special ones for 'asm'
[04:11:15] <hypermagic> i think everything is included for using inline asm that gcc compiles your c code to
[07:58:41] <hetii> Hi :)
[07:59:04] <hypermagic> hi
[07:59:47] <hetii> I start creating library that will allow implement different programmer protocols for different platforms.
[08:00:29] <hetii> At the beggining i have alreadt a port of stk500v2 for ARM
[08:00:30] <hypermagic> different programmers are good usually, they solve problems better than the others
[08:01:17] <hypermagic> anyway what do you think about avrdude
[08:01:38] <hetii> it works already with my programmer via stk500v2
[08:01:57] <hetii> next will be hvsp and hvpp mode
[08:02:03] <hetii> for avr
[08:02:22] <hetii> and want to ask about other protocols that are already used for other mcu
[08:02:36] <hetii> that are worth to implement
[08:04:28] <hypermagic> olimex a20 is a neat stuff but is more like a pc
[08:04:38] <hypermagic> and the pink pager is good too ;)
[08:04:51] <Lambda_Aurigae> got an rPI model B+ on the way here.
[08:04:54] <hypermagic> it has a ti stuff with spectrum analyser
[08:05:33] <Lambda_Aurigae> planning on making a full dev environment for it for doing work with AVR, PIC, msp430, Stellaris, and 8052.
[08:05:38] <hypermagic> i'd rather go for a beaglebone black or rather the a20, it has 1GB ddr3
[08:05:48] <hypermagic> and sata
[08:06:19] <Lambda_Aurigae> I considered the a20 but the amount of work being done on it isn't as great as the rPI.
[08:06:28] <Lambda_Aurigae> maybe for my next step.
[08:06:33] <hypermagic> the hardware is much better
[08:06:45] <hypermagic> it does not have however tvout if you need that
[08:06:58] <Lambda_Aurigae> I'm also into supporting the educational part of the rPI...
[08:07:00] <hypermagic> and is more expensive
[08:07:19] <Lambda_Aurigae> I work with kids around here doing microcontrollers and they have been asking me about the rPI lately.
[08:07:28] <Lambda_Aurigae> so figured I would get one and see what I can do with it.
[08:07:29] <hypermagic> hm
[08:07:42] <hypermagic> i heard that the pink pager is cool too ;)
[08:08:09] <Lambda_Aurigae> I teach electronics, microcontrollers, and robotics to 4H and Scouting kids
[08:08:26] <hypermagic> http://www.youtube.com/watch?v=WGU30mF_dgM
[08:08:40] <Lambda_Aurigae> now I gotta find a 4 pole headphone plug.
[08:08:58] <hypermagic> cut it
[08:09:40] <hypermagic> 3.5 jack is used on headphones
[08:10:37] <Lambda_Aurigae> on the new B+ they integrated the composite tv out onto the headphone jack.
[08:12:01] <hypermagic> oh
[08:12:18] <hypermagic> great
[08:12:33] <hypermagic> you can grab a headphone socket from a dead motherboard or soundcard
[08:12:46] <hypermagic> jumper wires solves it
[08:12:53] <Lambda_Aurigae> don't need a socket...just a plug.
[08:13:01] <Lambda_Aurigae> I might even have one or three laying around
[08:13:04] <hypermagic> maybe some cat5 cable
[10:30:47] <Dumle29> What is the smallest MCU I can find, that I can use as a one button HID keyboard?
[10:30:58] <Dumle29> anything smaller than the SO8 ATTinies?
[10:32:22] <Tom_itx> probably
[10:32:32] <Tom_itx> did you search atmel's parametric search?
[10:33:41] <LeoNerd> You might be able to convince a 6-pin ATtiny to talk USB, but timing will be an issue
[10:33:48] <LeoNerd> The reason to use an 8-pin is for the XTAL pins
[10:34:06] <LeoNerd> Vcc, GND, XTAL*2, USB*2, button input. That's 7 pins; 8 for reset.
[10:34:12] <LeoNerd> tiny*5 then
[10:35:38] <Tom_itx> i doubt there's enough code space for it
[10:35:58] <Dumle29> http://cpldcpu.wordpress.com/2014/03/19/%C2%B5-wire-usb-on-an-attiny-10/
[10:36:25] <LeoNerd> I'd be surprised if you couldn't fit BOOTP USB HID on a tiny85
[10:36:30] <LeoNerd> Just to send one button
[10:36:33] <Dumle29> That's the one I found. Doubt I'll be able to make that work tho, as I'm not exactly good with propper C. I'm mostly used to just use the arduino bootloader
[10:36:43] <Dumle29> LeoNerd: I'll use V-USB
[10:37:08] <Dumle29> Fit's fine in a tiny85, but I want smaller :P
[10:37:12] <Lambda_Aurigae> v-usb needs a crystal unless you have the built in pll.
[10:37:21] <Lambda_Aurigae> not sure if the smaller ones have the pll.
[10:37:22] <Dumle29> Oh
[10:37:32] <Lambda_Aurigae> tiny85 has the pll.
[10:38:12] <Dumle29> I have to fit it under a cherryMX switch, so that's 15*15mm board. I can only populate the bottom, and there's 5 rather large holes for the switch and mount pegs
[10:38:21] <Tom_itx> tiny10 runs at 12 mhz though
[10:38:30] <Tom_itx> which is what you want
[10:38:41] <LeoNerd> It might be "12MHz give or take a huge amount"
[10:38:52] <LeoNerd> USB will want pretty precise timing
[10:39:02] <Dumle29> With a little extension on the board, I've managed to fit it with an ATTiny85, reset tied to VCC tho
[10:39:35] <Dumle29> I'd like to be able to change the button it sends, so that's why I'd like to move towards something even smaller.
[10:41:09] <Lambda_Aurigae> no pll in attiny 4/5/9/10
[10:41:22] <Lambda_Aurigae> so it won't run vusb without an external clock or crystal.
[10:42:13] <Dumle29> It does tho :S
[10:42:25] <Dumle29> But I doubt I could do it
[10:42:28] <Lambda_Aurigae> you have tried it?
[10:42:32] <Dumle29> http://cpldcpu.wordpress.com/2014/03/19/%C2%B5-wire-usb-on-an-attiny-10/
[10:42:43] <Dumle29> cpldcpu did it
[10:42:57] <Dumle29> and controlling a WS2812 LED too
[10:43:24] <Dumle29> 96.4% memory used, and 93.8% SRAM used
[10:43:52] <Lambda_Aurigae> it's running at the limit of the chip's capacity, speed wise...and hope that your internal RC oscillator is stable.
[10:44:01] <Lambda_Aurigae> specially sending USB packets.
[10:44:08] <Lambda_Aurigae> that implementation is just receiving them it looks like.
[10:44:18] <Lambda_Aurigae> they gutted V-USB core to make it fit and work too.
[10:44:25] <Dumle29> yeah :(
[10:44:31] <Dumle29> Okay, ATTiny85 it is
[10:44:31] <hypermagic> Lambda_Aurigae, do you like scheme?
[10:44:34] <Lambda_Aurigae> I bet they took out the send stuff.
[10:45:02] <Dumle29> And I'm guessing sending is more complicated than recieving
[10:45:04] <Lambda_Aurigae> hypermagic, what scheme?
[10:45:10] <hypermagic> racket ?
[10:45:10] <Lambda_Aurigae> Dumle29, yup.
[10:45:20] <Lambda_Aurigae> hypermagic, I have no clue what you are talking about.
[10:45:27] <Lambda_Aurigae> I don't know what a racket scheme is.
[10:45:37] <hypermagic> ohh, check it then, your name starts with LAMBDA
[10:45:39] <twnqx> scheme's a programming laguage
[10:46:06] <Lambda_Aurigae> my real name starts with "ray" too but that doesn't mean I'm a death ray.
[10:46:34] <hypermagic> you can use blue ray though
[10:46:58] <Lambda_Aurigae> and if you look further at my name, it's the name of a star.
[10:47:34] <Lambda_Aurigae> Lambda Aurigae (λ Aur, λ Aurigae) is the Bayer designation for a solar analog[11] star in the northern constellation of Auriga.
[10:47:47] <hypermagic> oh
[10:49:04] <Lambda_Aurigae> it also, in some strange twisted derivation of one arabic name conversion of the same star, means old goat.
[10:50:55] <vsync1> your name makes for a very poor pillow talk
[10:51:01] <vsync1> i guess the girls are not into it
[10:51:01] <Lambda_Aurigae> hehe.
[10:51:20] <Lambda_Aurigae> that's ok...I'm married...
[10:51:53] <hypermagic> hi vsync1
[10:52:38] <hypermagic> i remember you from dos mode when guys checked vsync before flipping screen buffer
[10:53:15] <Lambda_Aurigae> umm..that's still done, only by the video card these days.
[10:53:28] <hypermagic> not really
[10:53:36] <hypermagic> the video card generates vsync
[10:56:55] <Lambda_Aurigae> http://www.smbc-comics.com/comics/20141115.png
[10:58:17] <vsync1> oh you crack me up.
[10:58:28] <vsync1> let's talk about some software?
[10:58:34] <twnqx> lol Lambda_Aurigae, nice one
[11:31:34] <nn7> can I put ISR() functions in other C files that get compiled in?
[11:36:18] <hypermagic> you place your include file in the c file and it will be included by gcc
[11:39:56] <Tom_itx> sometimes ISRs are a bit more particular
[11:42:56] <hypermagic> well they need to be at specific position of your file, usually at the beginning.
[11:43:19] <hypermagic> this is why the code has a "jump to start"
[11:43:29] <nn7> I found a discussion thread on avrfreaks discussion problems with compilers dropping the isr when it's not in the primary C file
[11:43:41] <nn7> looks like it's best to leave it in the primary file
[11:43:52] <hypermagic> you can leave it while not leaving it there :)
[11:44:13] <hypermagic> macronize it, and you write isrmacro(); at corect location
[11:48:31] <Tom_itx> no reason not to leave it in the main file. they're supposed to be short anyway
[11:49:15] <hypermagic> you leave it here anyway, if you include it it will be there you will just not see it there in full extent
[11:59:52] <Tom_itx> meh
[12:00:01] <Tom_itx> good editors will let you collapse functions anyway
[12:08:48] <hypermagic> :) Youscope (oscilloscope demo) http://www.youtube.com/watch?v=s1eNjUgaB-g
[12:11:31] <Lambda_Aurigae> https://www.youtube.com/watch?v=s2E9iSQfGdg this one is more impressive considering when it was done and with what hardware.
[12:32:40] <nn7> ah ha! I'm a genius
[12:33:19] <nn7> I was so annoyed when avrstudio went from one-click programming to 4 click programming. I found the solution is to just open another instance of avrstudio.
[12:35:35] <Lambda_Aurigae> I prefer noclick programming
[12:36:12] <Tom_itx> silent keyboard?
[12:36:36] <Lambda_Aurigae> that too.
[12:36:38] <Tom_itx> heh
[12:37:14] <Tom_itx> looking into their cmd line programming utility was kinda fun
[12:37:26] <Lambda_Aurigae> oh?
[12:37:27] <Tom_itx> call it from your makefile
[12:37:35] <Lambda_Aurigae> that's what avrdude is for.
[12:37:39] <Tom_itx> yeah i helped Jordan_U get it working
[12:37:42] <Tom_itx> or that
[12:38:39] <Tom_itx> he wanted something his employees couldn't get into studio and screw with the source
[12:38:52] <Tom_itx> monkey simple
[12:40:24] <Tom_itx> atprogram
[12:41:27] <Tom_L> atprogram -t jtagice3 -p usb -i isp -cl 125khz -d atmega64m1 program -f X:\Path\to\file.hex
[12:41:47] <Tom_itx> that's what i came up with in his case
[12:41:59] <Tom_itx> you can set the -cl alot higher
[12:42:08] <Lambda_Aurigae> yeah...atprogram doesn't support as many programmers as avrdude does though.
[12:42:09] <Tom_itx> i tried 2mhz on my programmer
[12:42:31] <Tom_itx> well if he's using atmel products he's likely using their programmers too
[12:42:44] <Tom_itx> mine works good with it
[12:44:00] <Tom_itx> i think he wanted to stick with the windows environment
[12:44:11] <Tom_itx> getting dude to work there sometimes is a pain
[12:44:15] <Lambda_Aurigae> but, for the no-click programming...you have a script that runs and watches your compiler output folder...when a new .hex file shows up, it automagically uploads to a connected chip.
[12:45:14] <Tom_itx> right
[12:45:47] <Tom_itx> probably more for the development cycle
[12:51:03] <nn7> that's a cute idea
[12:51:35] <Lambda_Aurigae> used to have a build server that would keep the company's software compiled.
[12:52:03] <Tom_itx> like buildbot
[12:52:06] <Lambda_Aurigae> every time someone submitted code to the CVS repository it would get incorporated to the build server and a test build done...first debug then non-debug
[12:52:16] <Lambda_Aurigae> this was back in about 2002 when I set it up.
[12:52:25] <Lambda_Aurigae> all my own build scripts.
[12:55:30] <NicoHood> does anyone know a good PCINT library except this one? https://github.com/GreyGnome/PinChangeInt/blob/master/PinChangeInt.h
[12:56:03] <Tom_itx> why do you need a whold library for PCINT?
[12:56:10] <NicoHood> i am thinking of implementing my own but it seems its pretty hard to not waste too many resources for all function pointers etc.
[12:57:14] <nn7> must be a complex setup to need a library for that
[12:57:25] <NicoHood> i am working on an Infrared library which relys on pinchange interrupts. but this would also work with PCINT. and because not everybody has one free normal pin interrupt i was thinking of using a neat PCINt lib
[12:58:24] <Tom_itx> must be mostly for larger chips if it's got portJ & K
[12:58:26] <NicoHood> well its made for new users. i am working in an arduino environment. but the best thing is to manually add the ports and setup the isr, am i right?
[12:59:28] <NicoHood> this is working for an atmega 328 but takes some resources. https://github.com/NicoHood/IRLremote/blob/master/examples/Advanced/Receive_PinChangeInterrupt/PinChangeInterrupt.ino
[13:04:51] <NicoHood> the question i have is mainly: is there a way to implement an easy to setup library like this but without that much overhead or should i just implement it directly with the port numbers etc for advanced users?
[13:04:51] <Lambda_Aurigae> I thought PCINT was Pin Change INTerrupt.
[13:05:10] <Tom_itx> it is
[13:05:20] <NicoHood> it is
[13:05:20] <NicoHood> why not?
[13:05:21] <Tom_itx> but affects port wide
[13:05:21] <Lambda_Aurigae> <NicoHood> i am working on an Infrared library which relys on pinchange interrupts. but this would also work with PCINT.
[13:05:21] <Lambda_Aurigae> you are comparing pinchange interrupts and PCINT...which are the same thing.
[13:05:21] <NicoHood> the normal interrupts
[13:05:21] <NicoHood> PCINT and normal interrupts. dunno the name
[13:05:22] <NicoHood> pin 2 and 3, you all know ;)
[13:05:32] <Lambda_Aurigae> INT0, INT1
[13:05:44] <NicoHood> ISR(INT0_vect) these things
[13:05:44] <Tom_itx> those are external independent interrupts
[13:05:49] <NicoHood> yes
[13:05:56] <Tom_itx> your call
[13:06:05] <Tom_itx> depends what flexibility you need
[13:06:21] <Tom_itx> you can't do rising/falling edge alone with PCINT
[13:06:29] <Tom_itx> you can select it with INT0 INT1
[13:06:46] <NicoHood> i have the library working with these INT0 etc and also for PCINT with the code above. but the code is not optimal. and i am wondering if there is a way to provide any smart PCINT library or if there is no real better way
[13:07:11] <NicoHood> well you can. you just need to remember the last state
[13:07:22] <Tom_itx> it's more a kludge
[13:07:28] <NicoHood> and in my case i only need a change anyways for a specific pin
[13:07:53] <nn7> you're looking for a library for a single pin change?
[13:08:21] <Tom_itx> depends how much you use PCINT or INTx
[13:08:24] <NicoHood> yeah. or if a library for all pins is not that big, thats also fine
[13:08:24] <Tom_itx> i'd hardcode it personally
[13:08:43] <NicoHood> its for arduino users, new users mainly
[13:08:56] <NicoHood> who dont know anything about what a PCINT is
[13:09:29] <NicoHood> and its also easier if you could just choose a pin and BAM its working, you know ;)
[13:09:41] <NicoHood> the linked "library" is kinda smart at least for a 328
[13:17:31] <nn7> ok, I have just come across the strangest thing
[13:17:57] <nn7> I'm trying to debug why my microcontroller doesn't seem to be talking to the rf12 module anymore. It was working fine before I rearranged some code
[13:18:29] <nn7> In my main code I toggle a pin to make sure we get to that point, and I see the toggle on the logic analyzer
[13:18:46] <nn7> the next line calls rf12_init();
[13:19:04] <nn7> the first first lines of rf12_init do the exact same pin toggle, but I don't see it on the logic analyzer
[13:19:23] <nn7> BUT, a uart_put inside the rf12_init works fine.
[13:24:44] <NicoHood1> do i first have to use this PCMSK0 |= (1<<PCINT3); or this PCICR |= (1 << PCIE0);?
[13:25:19] <nn7> if you use the second one first, there's a brief moment where it could trigger on the wrong pin.
[13:27:58] <malinus> well he could just disable the global interrupts first, and re-enale it later
[13:28:13] <nn7> yes, that's true
[13:28:32] <nn7> that's assuming he doesn't need them enabled for another reason. This is the safe solution
[13:28:50] <malinus> yeah
[13:29:21] <NicoHood1> nn7: thx!
[13:29:29] <malinus> what's the sequence the interrupts are executed in?
[13:30:13] <nn7> Someone please look at this. I reduced my code to this and I get the same result. http://pastebin.com/KGXzc7dz
[13:30:21] <nn7> I only get two pulses, not three!
[13:31:13] <nn7> I can't understand why rf12_init cannot change pins
[13:37:36] <malinus> nn7: stupid question - is rf12 some old version of the well-known rf24 module?
[13:37:57] <nn7> I don't know
[13:38:11] <malinus> nn7: mind linking to the datasheet?
[13:38:33] <malinus> Also I would like to tell you, that the rf24 modules are great and just work.
[13:39:07] <nn7> https://www.sparkfun.com/datasheets/Wireless/General/RF12B-IC.pdf
[13:40:37] <NicoHood> am i the only one with a dc?
[13:40:54] <nn7> if I move rf12_init out of rf12.c and into the same .c file as main, it works fine
[13:40:56] <LeoNerd> Mmm?
[13:41:15] <nn7> nicoHood: I have a digital circuit, too!
[13:42:16] <NicoHood> nn7: ... yeaaah
[13:42:27] <nn7> I'm a terrible mind reader.
[13:42:31] <NicoHood> :D
[13:42:42] <NicoHood> it took me about 5 seconds to understand the joke
[13:42:45] <malinus> am I the only one with a ac?
[13:47:57] <nn7> weird! it seems my port #defines are completely ignored by rf12.c but the compiler gives no warnings.
[13:48:36] <twnqx> http://youtu.be/oATBcWn_efU \o/
[13:48:52] <nn7> pretty!
[13:49:39] <twnqx> just code recycling i used for a chain of ws2812 for christmas :P
[13:51:23] <twnqx> so the first plane of my LED cube is almost done
[13:51:29] <twnqx> and i found a construction mistake
[13:51:41] <twnqx> 6A connectors are no good for peak consumption of 30A...
[14:08:30] <NicoHood> thats how i finally "solved" my PCINT question: https://github.com/NicoHood/IRLremote/blob/master/examples/Advanced/Receive_PinChangeInterrupt_Basic/Receive_PinChangeInterrupt_Basic.ino#L15-L60
[14:08:39] <NicoHood> any improvements?
[15:15:31] <Dumle29_> Using bootloadHID, is it bad practise to use something like wait 3 seconds, if no upload of program has started, run the main program?
[15:20:48] <Tom_itx> something like that
[15:21:14] <Tom_itx> or wait for button push
[15:21:17] <Tom_itx> etc
[15:21:51] <malinus> one of the boards I have (teensy), just waits for a button push
[15:22:57] <malinus> Dumle29_: I suggest looking in the Bootloaders/ in LUFA. Won't hurt you.
[15:23:25] <Tom_itx> app109 too
[15:24:16] <malinus> what's "app109"?
[15:24:39] <Tom_itx> deals with bootloaders
[15:26:22] <twnqx> ah, that's why it's called avr109 in avrdude, i guess?
[15:26:41] <Tom_itx> very likely
[15:28:25] <Tom_itx> AVR112: TWI Bootloader for devices without
[15:28:25] <Tom_itx> boot section
[16:01:10] <Casper> Dumle29_: many projects have a wait x time, in fact, almost all routers do that! but it's not something you notice because the serial port is not accessible normally unless you hack the router... Like for tp-link, you power on, then have a second to type "tpl" in a terminal, then if you do so the bootloader is accessible...
[16:01:18] <Casper> ... it always take me a few try...
[16:11:12] * LeoNerd twiddles thumbs "Come on oshpark.. you've had 10 days now..."
[16:22:24] <twnqx> LeoNerd: 2 weeks is normal from china
[16:22:50] <LeoNerd> Hmmm
[16:22:57] <LeoNerd> Fair'nuff
[16:25:49] <twnqx> there's a reason to being an order of magnitude cheaper than low count locally manufactured ones:P
[16:26:25] <LeoNerd> Yah..I guess
[16:26:40] <LeoNerd> I mean I don't /mind/ as such, it's just a little annoying to get no status updates for two weeks
[16:26:43] <LeoNerd> Nearly
[16:26:55] <twnqx> heh
[16:27:20] <twnqx> i wanted to visit seeed a week ago with WormFood
[16:27:28] <twnqx> they were closed on saturday
[16:27:32] <WormFood> :(
[16:27:36] <twnqx> apparently they make enough money with us westerners :P
[16:27:38] <WormFood> sadly closed that day
[16:28:08] <twnqx> reminds me
[16:28:14] <WormFood> actually, we did visit the, we just didn't get in the doors
[16:28:23] <twnqx> if i EVER build a larger LED cube than this one
[16:28:41] <twnqx> i'll get me a few thousand 5mm round PCBs...
[16:29:03] <twnqx> putting these damn 0402 resistor between the legs is the single most annoying thing i ever did