#avr | Logs for 2015-06-18

Back
[04:57:55] <geohhot> well no punk rock bands here anymore :/
[05:00:09] <dunz0r> Why would there be punk rock bands in a channel about a microcontroller family?
[05:01:18] <geohhot> then nickname was NOFXx .. whatever
[05:01:59] <geohhot> btw, now that atleast I know someone is alive
[05:02:35] <geohhot> I was wondering if anyone tried messing with usbtinyisp, to make it an SPI slave, for debugging I mean
[05:17:05] <Lambda_Aurigae> geohhot, it should be doable. major software rework though.
[05:21:16] <geohhot> Lambda_Aurigae: well it didn't need a driver on linux, you would just use libusb to send usb commands right ?
[05:22:00] <Lambda_Aurigae> depends on how you reworked the software.
[05:22:24] <Lambda_Aurigae> as it is written, the thing doesn't do anything or send any information to the PC unless requested.
[05:22:37] <geohhot> yeah, that's the main bummer
[05:22:42] <Lambda_Aurigae> if you wanted it setup as an SPI slave then it would need a way to send data to the PC on its own..
[05:22:51] <Lambda_Aurigae> this would mean either HID or CDC
[05:22:52] <geohhot> the pc software must keep asking for new data
[05:23:14] <Lambda_Aurigae> CDC isn't officially supported for low speed USB so you either need windows or updated linux kernel module to support it.
[05:23:37] <geohhot> ok, now I see what you mean by "major" changes
[05:23:42] <Lambda_Aurigae> you could turn it into a HID keyboard to have it send data to the PC
[05:23:57] <geohhot> oh, that seems an awesome idea
[05:24:00] <Lambda_Aurigae> or you could write a libusb 2-way comms app for the PC too.
[05:29:27] <geohhot> Lambda_Aurigae: I've seen cnlohr's way of debuging his avr's, he was just asking for new data over and over again, so he was kindof overloading the SPI slave with requests again and again, but it was working
[05:29:45] <Lambda_Aurigae> don't know cnlohr.
[05:29:58] <Lambda_Aurigae> I use the LED and/or usart debugging methods myself.
[05:30:12] <geohhot> one step of making it better, was to turn of the SPI interrupt whenever you finished sending data back, but still, not the best way
[05:30:18] <geohhot> https://www.youtube.com/user/CNLohr
[05:31:19] <geohhot> well, usart can be pretty fast (up to 2 mb/s) but you need a seperate device and connection for it to work right ?
[05:32:55] <Lambda_Aurigae> that's what my serial port is for.
[05:33:36] <Lambda_Aurigae> and people need to learn to express themselves in text rather than talking to themselves for hours to describe something..hehe
[05:35:02] <geohhot> haha, that's a nice way of describing youtubers
[05:35:52] <Lambda_Aurigae> prezaktly.
[05:36:20] <geohhot> not sure what that means
[05:36:39] <Lambda_Aurigae> I can see embedding a video to show something, like, how something functions. I can not see any use in talking about something for 20 minutes where a paragraph would do.
[05:36:55] <Lambda_Aurigae> it is a hacked construct of "Precisely" and "Exactly"
[05:37:03] <geohhot> oh, nice
[05:37:31] <Lambda_Aurigae> something I used to say as a child to piss off my grandmother.
[05:37:35] <Lambda_Aurigae> she was an english teacher.
[05:38:01] <Lambda_Aurigae> ok. Sun is coming up. Time to take a shower and get ready for w*rk
[05:38:37] <geohhot> what are you working as ?
[05:52:48] <Lambda_Aurigae> I fix copiers for a living.
[05:52:49] <Lambda_Aurigae> and printers
[05:53:20] <Lambda_Aurigae> my official title is Lead Analyst...which means I know computers and can make the copiers and computers talk to each other and play nice.
[05:54:00] <geohhot> seems like a useful job, never managed to make my printer work with CUPS -_-
[05:57:33] <Lambda_Aurigae> does your printer have postscript built in?
[05:57:47] <Lambda_Aurigae> if not then there could be issues...there are some hackaround drivers that work sometimes.
[05:58:00] <geohhot> oh, not really sure it does
[05:58:13] <geohhot> altho the driver said it does, but the driver was for another 300,000 models
[05:58:31] <Lambda_Aurigae> and if it's an inkjet then you are likely really into the hackaround world.
[05:58:54] <geohhot> laserjet, an oldish canon
[05:59:10] <geohhot> and hackarounds work ? or I suppose you make them work
[05:59:20] <Lambda_Aurigae> I can usually make something work.
[05:59:30] <Lambda_Aurigae> most of what I do is winblows though...however much I hate it.
[05:59:34] <Lambda_Aurigae> then mac-n-crap
[05:59:45] <Lambda_Aurigae> with linux being less than 1% of my customers choice.
[06:00:05] <Lambda_Aurigae> but I work mostly with small businesses who are locked into winblows software.
[06:00:23] <geohhot> like XP or what ? :D
[06:01:51] <Lambda_Aurigae> xp, vista, 7, 8
[06:02:10] <Lambda_Aurigae> have one customer who still runs win98 for one piece of software that won't run on anything else.
[06:02:15] <geohhot> wow, and I thought armenia is the only place that has XP was alive yet
[06:02:22] <geohhot> lol
[06:03:21] <Lambda_Aurigae> and of course they need to print from it too.
[06:03:34] <Lambda_Aurigae> and bought a new copier/printer/scanner/fax unit a couple of months ago.
[06:03:45] <Lambda_Aurigae> I ended up using an old laserjet 5 driver to make it print.
[06:04:38] <geohhot> did it have a test page or were they invented in 21st century ?
[06:04:55] <Lambda_Aurigae> huh?
[06:05:14] <geohhot> did that old driver have the "print test page" option ? :D
[06:08:07] <geohhot> ay, did you ever end up modifing and recompiling drivers ? O.o
[06:13:33] <twnqx> there's a serial 2 hid example at obdev
[06:13:51] <twnqx> i guess it wouldn't be too hard to rewrite that to SPI 2 hid instead
[06:17:03] <Lambda_Aurigae> yes, the print test page option is there.
[06:17:08] <Lambda_Aurigae> and, no, I don't go that far.
[06:17:15] <Lambda_Aurigae> I won't recompile drivers for someone...
[06:17:32] <Lambda_Aurigae> most of what I work with is Xerox gear and the drivers are not open source.
[06:20:10] <geohhot> oh but obdev was Vusb right, the usbtinyisp was with the other usb project, igor something's usbplug .. I think
[06:20:39] <geohhot> but the concept should be the same, I suppose
[06:21:12] <geohhot> and V-usb supports more then 1 crystal frequency
[06:21:19] <Lambda_Aurigae> usbtinyisp is v-usb
[06:21:21] <geohhot> the other library was for 12 mhz only
[06:21:24] <geohhot> mmm
[06:21:31] <Lambda_Aurigae> igor just did the bitbanged usb first.
[06:21:36] <Lambda_Aurigae> obdev commercialized the idea.
[06:21:54] <geohhot> oh, I see, then the source code I have must be the old one
[06:22:15] <Lambda_Aurigae> usbtinyisp didn't come around until obdev came out with vusb.
[06:22:23] <Lambda_Aurigae> they called it something else to start though.
[06:23:02] <geohhot> wasn't it tinyusbisp or something
[06:23:09] <Lambda_Aurigae> I meant vusb
[06:23:27] <geohhot> I think usbisp-2 was vusb
[06:23:42] <Lambda_Aurigae> usbisp-2 used vusb, yes.
[06:24:59] <Lambda_Aurigae> I just can't remember what v-usb was called originally.
[06:25:56] <geohhot> IgorPlugUSB ?
[06:27:55] <Lambda_Aurigae> no...that's igor's first version.
[06:29:27] <megal0maniac> "This project was formerly known as AVR-USB. Due to
[06:29:29] <megal0maniac> a trademark issue, it was renamed to V-USB in April 2009"
[06:29:33] <Lambda_Aurigae> there we go.
[06:29:40] <Lambda_Aurigae> I knew it was called something else.
[06:30:07] <megal0maniac> I just searched for "v-usb formerly known as" :P
[06:30:34] <geohhot> ah right, I remember avr had that name or something
[06:30:55] <geohhot> in their mcu-s that have hardware usb implemented, I think
[07:00:34] <Lambda_Aurigae> ok..dumbfuck of the day....an idiot here nearby called in a bomb threat to an airport....VIA ONSTAR!
[07:33:45] <Valen> Lambda_Aurigae: lol nice
[09:02:10] <edmont> hi
[09:02:33] <edmont> is it possible to make an array of vectors?
[09:03:00] <edmont> like:
[09:03:10] <edmont> pirVect[PIRN] = {INT0_vect, INT4_vect, INT5_vect, INT6_vect};
[09:03:22] <edmont> and then:
[09:03:24] <edmont> ISR(pirVect[PIR1]) { }
[09:03:32] <edmont> something like that
[09:05:21] <LeoNerd> No
[09:06:40] <edmont> :(
[09:10:13] <specing> actually you can
[09:10:24] <specing> if you look at how the ISR macro is implemented
[09:10:24] <edmont> how?
[09:10:35] <specing> __attribute__((vector(something)));
[09:12:39] <edmont> so?
[09:30:06] <specing> edmont: get familiar with the toolchain
[09:31:11] <twnqx> more like, C macro expansion
[09:34:39] <twnqx> however if you want the vectors to be runtime dynamic - no way.
[09:39:39] <DKordic> edmont: IVT is in FLASH, so it can not be easily modified. You can go through yet another table in RAM ::D .
[09:39:53] <edmont> twnqx: i don't need them to be dynamic, just want code clarity
[09:40:08] <twnqx> arrays are runtime dynamic
[09:40:16] <twnqx> what you are doing is in fact LESS clear
[09:40:46] <twnqx> because that way you first have to look up what the content of pirvect is to actually see what interrupt you handle
[09:41:19] <DKordic> edmont: C does'n allow that kind of clarity :D :D :D .
[09:41:27] <twnqx> it is not clarity.
[09:43:18] <edmont> http://pastebin.com/YNZikJcJ
[09:44:23] <edmont> and then maybe I can use some ISR alias: http://www.nongnu.org/avr-libc/user-manual/group__avr__interrupts.html
[09:45:01] <twnqx> how to make a slow cpu... slower
[09:46:02] <edmont> because of the array fetching?
[09:46:46] <twnqx> init will have to copy those arrays to memory
[09:47:10] <twnqx> yes, indirect access is slow, at least 4 instructions
[09:47:29] <twnqx> also, they might eat your memory (though i doubt you'll have problems with that, unless you use 512 byte cpus
[09:47:54] <twnqx> on top of that, i doubt you know what volatile does
[09:48:16] <edmont> you are right :)
[09:48:26] <edmont> but that way it compiles and works
[09:48:34] <twnqx> your array is const, not volatile. it only contains pointers to your ports, and i doubt the adddress of the ports changes randomly
[09:49:42] <twnqx> volatile tells the compiler that the content might chnage asynchronously (e.g. from an interrupt handler) and thus has to be refetched on every access
[09:50:37] <edmont> i know that, but:
[09:50:38] <edmont> warning: initialization discards ‘volatile’ qualifier from pointer target type [enabled by default] const uint8_t * pirPort[PIRN] = {&PORTD, &PORTE, &PORTE, &PORTE}; ^
[09:50:55] <twnqx> mh
[09:51:02] <twnqx> right
[09:51:22] <twnqx> it's an array of pointers to volatile uint8_ts
[09:51:38] <twnqx> it's the array content that's const
[09:54:42] <twnqx> what cpu is that, btw?
[09:54:52] <twnqx> quite a lot of IO Interrupts
[09:55:43] <twnqx> oh, misread the code, it's just two banks
[09:56:19] <edmont> atmega256rfr2
[09:57:12] * twnqx goes back to layouting ugly PCBs
[09:58:06] <LeoNerd> laying-out
[10:01:43] <twnqx> so ugly ;(
[10:01:48] <twnqx> so many vias ;(
[10:02:06] <twnqx> so small components that 0.3mm vias look HUGE ;(
[10:03:30] <Chillum> fun
[10:10:35] <twnqx> http://i.imgur.com/HNIIf03.png :/
[10:13:15] <twnqx> *idea*
[10:14:27] <specing> twnqx: be a man and make it single layer
[10:14:33] <twnqx> lol
[10:18:26] <Chillum> 0 ohm resistors for jumpers
[10:18:36] <Chillum> (also known as wire)
[10:18:44] <twnqx> you do see the grid, right?
[10:18:54] <twnqx> even 0402 look huge next to these parts
[10:19:09] <Chillum> grids? We don't need no stinkin' grid
[10:19:27] <twnqx> but i just found a way to save half the vias :D
[10:22:43] <specing> real men grow up without grids
[10:23:31] <twnqx> i've grown up with self-sticking lines
[10:23:33] <twnqx> and no grid
[10:36:01] <twnqx> much better now :)
[12:09:30] <kwallace> Hello. I have one of these: http://embeddedwirelesssolutions.com/atmel_breakout_boards/ews_atmega32u4_breakout_board which comes loaded with a FLIP bootloader, which I can't use (I'm Linuxy).
[12:09:36] <kwallace> I would prefer to make this board Arduino friendly. I was able to to use Arduino to make sketches, then export the hex file and load with gcc-avr and avrdude separately using a usbtinyisp programmer through the ISP port.
[12:11:59] <kwallace> For fun, I tried loading Catrina-Leonardo.hex which I understand should work as a bootloader for my board. It loads but upon reset a USB programming port doesn't show up in Arduino or lsusb.
[12:12:13] <kwallace> Am I barking up the wrong tree?
[12:13:52] <DKordic> kwallace: #arduino is better choice for those tools, or I don't understand the question.
[12:14:17] <LeoNerd> I'd suggest just sticking on the Arduino Micro bootloader
[12:14:20] <LeoNerd> It seems reasonable
[12:14:56] <LeoNerd> It also seems to respond to the 1200baud+DTR autoreset signal, which Adafruit's seems not to
[12:18:42] <kwallace> I see a Caterina-Micro.hex file so I should try to load that? sudo avrdude -c usbtiny -p ATmega32u4 -U flash:w:Caterina-Micro.hex ? One of my assumptions is that that a bootloader is just like any another program so I can use the same procedure I use for my blinky program?
[12:19:12] <LeoNerd> Well having no idea where you got that .hex file from I really can't comment :)
[12:20:11] <kwallace> It's from the Arduino hardware directory that was installed when I installed Arduino IDE.
[12:21:08] <kwallace> It seems to be for Leonardo which uses the same ATmega32U4.
[12:21:44] <LeoNerd> Yeah, it should be fairly hardware-independent.. i.e. any 32U4 will be fine
[12:23:08] <kwallace> DKoric may be right. it may be better if I ask on #arduino.
[12:23:27] <LeoNerd> Eh.. maybe? It's not a very arduinio-centric question
[12:23:35] <LeoNerd> The bootloader is just an avr109 implementation
[12:29:55] <osteri> kwallace: it does support linux? http://www.atmel.com/tools/FLIP.aspx
[12:30:16] <osteri> and there is also dfu-programmer for linux
[12:38:29] <kwallace> osteri, apparently the Atmel FLIP Linux version never worked and was dropped.
[12:42:56] <kwallace> DFU might work but I'm not having any trouble using my ISP programmer so I haven't taken the time to figure it out. I thought it might be worth the effort to figure out the Arduino bootloader since the IDE makes it so easy for some applications. I don't think DFU helps me here, but I could be wrong.
[12:43:23] <LeoNerd> I don't use the Ardunio IDE at all. It's horrible
[12:43:38] <LeoNerd> I just use the Arduino Micro bootloader because it works nicely over USB, and responds to autoreset
[12:43:42] <LeoNerd> So you don't need to touch the reset button
[12:45:13] <kwallace> Do you have a command for loading a file?
[12:45:32] <LeoNerd> avrdude :)
[12:45:43] <LeoNerd> Weeelll... avrdude with a tiny wrapper that tickles the autoreset
[12:45:58] <LeoNerd> But the actual loading is just avrdude and will work on its own if you just press the button
[12:46:07] <kwallace> Do you have the rest of the command handy?
[12:47:50] <LeoNerd> https://twitter.com/cpan_pevans/status/600974479016222720
[13:05:37] <Chillum> neat trick
[13:07:11] <LeoNerd> Annoyingly it doesn't work on my Adafruit 32U4 board though :(
[13:07:21] <LeoNerd> It does work on a real 'Micro
[13:08:12] <Chillum> I have gotten very good at releasing the reset button at the right moment
[13:08:18] <Chillum> the trick is to pre-compile
[13:08:25] <LeoNerd> Sure
[13:08:30] <LeoNerd> make; {press button}; make install
[13:09:22] <Chillum> ya, I am in the IDE so for me it is click compile, press reset click upload
[13:09:25] <Chillum> but same thing really
[14:25:04] <LeoNerd> LM2596 buck-mode switching regulator. Just add inductor + diode. Anyone any thoughts/opinions on these chips?
[14:25:19] <LeoNerd> I want to drop 24V to 5V for a small microcontroller doing... frankly not much. A few buttons and sensors
[14:25:37] <LeoNerd> 24->5V feels just a bit too large a drop to just stick a 78L05 in, so I'm thinking a switcher
[14:33:47] <LeoNerd> WTF? How is it I can buy a single LM2596 chip from Farnell for £3.51, or I can buy an entire board with that + inductor + diode + caps + connectors,... for under £2 on eBay?
[14:39:30] <LeoNerd> I'm severely tempted just to buy these boards off eBay, reflow the parts off with my heatgun, throw away the PCB and reattach the parts on my own boards instead.
[14:54:53] <LeoNerd> Other random thoughts: I have two MCUs (a tiny84 and... a mega of some variety I haven't quite decided on yet) connected via I2C. Bus will be idle most of the time unless either has something exciting to say
[14:55:38] <LeoNerd> The tiny84 is just attached to some sensors. Rather than give it an extra interrupt line (which then needs another pin over the cable), would it be reasonable just to run them in a multimaster setup? Give each a slave address and leave them both in slave mode most of the time...
[14:55:45] <LeoNerd> run the bus as a real bus
[15:38:46] <Jartza> very strange
[15:39:12] <Jartza> compiling the same code for attiny85 and attiny45, gcc makes smaller code for attiny45
[15:39:17] <Jartza> which also runs nicely on 85
[15:39:50] <specing> attin85 has more stuff in it?
[15:39:59] <specing> more vectors?
[15:40:46] <LeoNerd> I thought the only difference was flash/RAM sizes
[15:46:02] <Jartza> yep
[15:46:16] <Jartza> 512 vs 256 ram and 8k vs 4k flash