#avr | Logs for 2015-02-14

Back
[02:06:35] <vsync> jaggzt: really, what's with fucking around with the bootloader?
[02:06:55] <vsync> can't you just flash the chip jesus
[02:07:41] * Casper slaps vsync
[02:07:54] <vsync> huh?
[02:08:25] <vsync> i have no idea wtf the chip is doing, and i think he doesn't either. he's been going at it for a few days
[02:08:44] <vsync> i'd imagine this is because he doesn't have a programmer really
[02:08:51] <vsync> which kinda makes me smile inside, a bit
[02:11:42] * Casper zaps vsync
[03:39:51] <rysiek_> Hello everybody :)
[03:40:47] <rysiek_> I am new... so forgive me my posts.
[03:44:04] <Xark> rysiek_: Hello
[03:49:37] <rysiek_> Why is there so empty? Nobody writes.
[03:50:02] <Fleck> this is no "hello, how old are you?" chan! :D
[03:52:08] <rysiek_> At first I want to apologize for my english. I have been learning for 5 months
[03:55:39] <rysiek_> Ok, I understand :) . I have a few problem with W5100 device. But at this time I would say "hello" :)
[03:57:52] <rysiek_> Is anybody here who worked with this device ?
[03:58:38] <Xark> rysiek_: Hmm, a little bit. However, I just used a library...
[04:00:25] <hackvana> rysiek_: Good English for 5 months!
[04:00:45] <hackvana> Please ask then wait, at least for a few hours.
[04:57:15] <anonnumberanon> is it faster to read the ram or the flash of an avr? are they both made of flash?
[04:58:57] <Xark> anonnumberanon: RAM is faster.
[04:59:37] <Xark> Load from SRAM, 2 cycles, load from program FLASH 3 cycles (IIRC).
[05:01:02] <anonnumberanon> ah I see.
[05:02:19] <Xark> anonnumberanon: Flash is not "too slow", so if you don't need to write, using it is often a good idea (usually only a small amount of SRAM).
[05:02:56] <Xark> For for fastest speed, SRAM is faster (and all in registers faster still).
[05:03:05] <anonnumberanon> yes for like lookup tables and the likes?
[05:03:20] <anonnumberanon> we are trying to cram a lot of computing into a simple 328 avr
[05:03:23] <Xark> anonnumberanon: Yes, or (especially) big things like strings.
[05:03:32] <anonnumberanon> ah
[05:03:40] <anonnumberanon> We won't need those I believe.
[05:04:18] <anonnumberanon> just sensor calibration lookup tables, cosine and sine tables
[05:04:56] <Xark> Cool. Those are good candidates for flash (unless you are up against the wall for speed).
[05:05:57] <hackvana> http://www.avrfreaks.net/forum/flash-vs-ram-speed
[05:09:09] <Xark> hackvana: Thanks. Seems to confirm 2 cycles for SRAM and 3 for Flash (with some other "chatter"). :)
[05:09:31] <hackvana> It surprised me too. All this time I thought all of them were 1 cycle.
[05:09:56] <hackvana> I thought the whole point about AVR RISC was one clock per instruction
[05:10:04] <hackvana> Or instruction per clock
[05:10:10] <Xark> hackvana: Hehe, I've been bit-banging NTSC on AVR, so I am very very familiar with cycle counts. -> https://www.youtube.com/watch?v=Imk5ony8JHI&feature=youtu.be
[05:10:25] <hackvana> I'd like to watch, but I'm not able to, sorry.
[05:11:13] <Xark> hackvana: NP. Just showing ~192x192 B&W bitmap with text and sprites flying over it.
[05:12:09] <Xark> (tiled character map really - 500 bytes tile map, 1K redefined chars for sprites).
[05:12:35] <Xark> Bitmaps don't go very well with AVR and 2KB SRAM. :)
[05:13:04] <Xark> 4 cycles per pixel
[05:13:59] <hackvana> I'm sure you've seen this video/page then: http://www.linusakesson.net/scene/craft/
[05:14:35] <hackvana> Deeply impressive
[05:14:54] <Xark> Oh yeah. :)
[06:49:51] <megal0maniac> Hello all
[06:51:02] <megal0maniac> I'm wanting to make a "touch screen" using a matrix of optical transmitters and receivers. A row along the top of the TV firing down, a row along the side firing across. Interrupt the beam with your finger and it is detected
[06:52:08] <megal0maniac> I was guessing narrow-beam infrared with slightly off-set wavelengths and filtered receivers. Am I on the right track?
[06:55:58] <Lambda_Aurigae> megal0maniac, don't need to change wavelengths.
[06:56:26] <Lambda_Aurigae> just use tight "beams" by doing it the pinhole camera way.
[06:57:43] <Lambda_Aurigae> small pinholes on the receiving end.
[07:01:39] <Lambda_Aurigae> you could also do it with a pair of spinning mirrors and one emitter and one detector.
[07:02:09] <Lambda_Aurigae> by doing a scanning kinda thing where you watch for reflection.
[07:08:22] <megal0maniac> Ooh. Spinning mirrors sounds cool
[07:08:29] <megal0maniac> But wouldn't coverage be limited then?
[07:08:35] <Lambda_Aurigae> not really.
[07:08:52] <megal0maniac> Then I'm misunderstanding you
[07:09:12] <Lambda_Aurigae> emitter in the upper right corner....sensor in the upper left.
[07:10:04] <Lambda_Aurigae> the two spinning at different rates.
[07:10:21] <Lambda_Aurigae> the border around the bottom and sides would be IR absorbing
[07:10:34] <Lambda_Aurigae> when you put your finger on the screen you get a reflection...
[07:10:58] <Lambda_Aurigae> by knowing the position of both emitter and sensor you can calculate the triangle.
[07:11:04] <Lambda_Aurigae> Angle Side Angle....
[07:11:19] <Lambda_Aurigae> you know side by knowing the distance between emitter and sensor.
[07:11:43] <Lambda_Aurigae> a little trig and you can find the length of the other two sides...and figure out the position on screen.
[07:11:46] <megal0maniac> That sounds like a really cool way of doing it
[07:12:00] <megal0maniac> Does darker skin reflect though IR?
[07:12:09] <megal0maniac> *reflect IR though?
[07:12:15] <Lambda_Aurigae> it should.
[07:12:47] <megal0maniac> Because I don't know who I'll be demonstrating to. And it would be pretty embarrassing to have a racist touch screen :P
[07:12:58] <Lambda_Aurigae> I've used that method for range finder before...by having sensor and emitter turning equal but opposite...and instead of spinning they just wag back and forth.
[07:13:22] <megal0maniac> Well it would only have to move 90 degrees back and forth, right?
[07:13:30] <Lambda_Aurigae> yeah.
[07:13:44] <Lambda_Aurigae> you could do wiggle back and forth too.
[07:13:55] <Lambda_Aurigae> I've seen it done both ways,,,wiggle and spinning mirror.
[07:14:13] <Lambda_Aurigae> the spinning mirror mode can be run much faster for better response and less shaking.
[07:14:29] <megal0maniac> Wait, so where does the transmitter go and where does the mirror go?
[07:15:53] <Lambda_Aurigae> well, easiest way would be to have the motor sit under the mirror..mirror sitting at a 45 degree angle..and the emitter/sensor sitting directly over pointing down at the mirror...
[07:16:16] <Lambda_Aurigae> now turn the whole thing on the side and stick it to the front of your display.
[07:16:43] <megal0maniac> If I'm wiggling it 90 degrees, is there any reason not to attach the LED to the motor directly?
[07:16:59] <Lambda_Aurigae> no reason at all if you just do wiggle.
[07:17:18] <megal0maniac> And getting the narrow beam?
[07:17:22] <Lambda_Aurigae> have you ever looked at how a laser printer does its scanning?
[07:17:31] <megal0maniac> I have not
[07:18:06] <Lambda_Aurigae> http://en.wikipedia.org/wiki/Laser_printing#mediaviewer/File:Laser_unit_dell_p1500_print.jpg
[07:18:30] <Lambda_Aurigae> for narrow beam, pinhole through a piece of plastic 1cm thick.
[07:18:44] <Lambda_Aurigae> that is the picture of a laser from an HP laser printer.
[07:19:12] <Lambda_Aurigae> laser itself is on the right. In front of that is a pinhole cut in a piece of metal basically...
[07:19:27] <megal0maniac> I assume the hexagonal thing is a spinning mirror?
[07:19:28] <Lambda_Aurigae> the beam hits that hexagon thingie which spins..
[07:19:41] <megal0maniac> Awesome :)
[07:19:45] <Lambda_Aurigae> it spins and does the scanning beam.
[07:19:56] <Lambda_Aurigae> now, the two lenses and mirrors above that flatten it out.
[07:20:29] <Lambda_Aurigae> using the polygon method like that takes some additional math though to figure out your angle.
[07:21:20] <megal0maniac> So between knowing the position of the mirror and pulsing the laser, it scans line by line?
[07:21:23] <Lambda_Aurigae> in that particular laser unit, I would bet the polygon spins between 10K and 15K rpm
[07:21:30] <Lambda_Aurigae> yeah.
[07:22:07] <Lambda_Aurigae> you wouldn't want to go that fast with a touchscreen sensor though..specially if you were using an avr to control it.
[07:22:23] <Lambda_Aurigae> in a laser printer they usually use a custom asic or fpga based controller.
[07:23:25] <megal0maniac> Well, I do have an FPGA on hand... :P
[07:23:36] <megal0maniac> 200K gate Spartan 3A
[07:23:40] <megal0maniac> That's bloody fast
[07:23:50] <megal0maniac> (The mirror, not the fpga)
[07:24:54] <Lambda_Aurigae> that is probably from a 30 page per minute printer...at 600 lines per inch, 11 inches per page, 30 pages in a minute...6 mirrors...33000 rpm.
[07:26:21] <megal0maniac> Good grief
[07:26:34] <megal0maniac> I think I need to find a dead laser printer
[07:26:53] <Lambda_Aurigae> which is about right...23ppm sharp color laser copier runs at 27K officially.
[07:27:06] <Lambda_Aurigae> I fix these things for a living.
[07:27:51] <Lambda_Aurigae> also, in there, upper right quadrant, kinda above and to the left of the laser diode, there is a little lens thing by itself...under that is a sensor.
[07:28:03] <Lambda_Aurigae> it's used for calibrating position and for making sure the laser is actually firing.
[07:29:31] <megal0maniac> Oh yes, I forgot that you were the 'printer guy' :)
[07:29:40] <megal0maniac> Some pretty underappreciated tech
[07:29:45] <Lambda_Aurigae> yup.
[07:29:52] <Lambda_Aurigae> you should see the color laser unit.
[07:29:56] <Lambda_Aurigae> 4 emitters in there.
[07:30:00] <Lambda_Aurigae> one polygon.
[07:30:07] <Lambda_Aurigae> lots of mirrors.
[07:31:37] <megal0maniac> Awesome :D
[07:31:51] <megal0maniac> I think I may need to look into this. Multiple LEDs will be painful
[07:31:51] <Lambda_Aurigae> and one high speed color laser I tore apart had 8 lasers in it.
[07:31:56] <megal0maniac> And expensive
[07:31:56] <Lambda_Aurigae> 2 for each color..
[07:32:09] <megal0maniac> Not CMY/RGB?
[07:32:17] <Lambda_Aurigae> no...all CMY
[07:32:29] <Lambda_Aurigae> laser printers don't print RGB
[07:32:32] <megal0maniac> Wow
[07:32:33] <Lambda_Aurigae> they are all CMYK
[07:33:20] <Lambda_Aurigae> RGB is for emissive technologies,,,displays....CMYK is for reflective mixing technologies like printing.
[07:33:45] <megal0maniac> Is there nothing which uses all 7? Or am I getting confused with something else?
[07:34:06] <Lambda_Aurigae> high end inkjets will use up to 8 colors
[07:34:15] <Lambda_Aurigae> but that's usually the big mongo professional units.
[07:34:22] <megal0maniac> Yes, that's the one
[07:34:35] <Lambda_Aurigae> but that's not CMYKRGB
[07:34:38] <megal0maniac> Oh
[07:34:43] <Lambda_Aurigae> it's more like different shades of the CMYK
[07:37:00] <megal0maniac> Found a 50mW 650nm emitter with a 5 degree angle
[07:37:16] <megal0maniac> $16 a pop from digikey :D
[07:37:41] <Lambda_Aurigae> just found one designjet that has 12 diferent inks.
[07:38:41] <Lambda_Aurigae> it does have RGB in there.
[07:39:14] <Lambda_Aurigae> but it's still an inkjet.
[07:40:14] <Lambda_Aurigae> probably costs $0.50 to $1.00 per square foot to print too.
[07:41:22] <megal0maniac> Just to give you some context
[07:41:50] <megal0maniac> http://www.batsocks.co.uk/products/Other/TellyMate.htm
[07:42:15] <Lambda_Aurigae> http://www.magictouch.com/IR_screen.html
[07:42:38] <megal0maniac> I'm planning on using 2 micros. One to act as my 'tellymate' and another to do useful stuff (like gather sensor data), generate sensible output for the tellymate and interpret 'touches'
[07:42:58] <megal0maniac> Yeah I saw that. No price but I'd imagine it would cost a small fortune
[07:43:06] <Lambda_Aurigae> they aren't so bad.
[07:43:14] <Lambda_Aurigae> for your project, probably too much.
[07:43:20] <megal0maniac> I also live in South Africa
[07:43:30] <megal0maniac> So the exchange rate, the shipping, the customs...
[07:43:35] <megal0maniac> Plus I'm a student
[07:45:46] <Lambda_Aurigae> there used to be a bar you could stick to a whiteboard and it did much the same thing.
[07:45:55] <megal0maniac> Anyway, I'm off. Thanks for the info - will definitely look into the mirror option :)
[07:46:10] <megal0maniac> Oh cool. Haven't found that yet
[07:46:13] <Lambda_Aurigae> there were rings you put on your markers and the sensors would know the difference from the different color rings.
[07:46:17] <megal0maniac> And probably wouldn't talk to the micro
[07:46:21] <Lambda_Aurigae> smart board
[07:46:31] <megal0maniac> Yeah. HID USB thingy
[07:46:42] <megal0maniac> Too smart for my purposes ;)
[07:47:05] <megal0maniac> Cheers
[08:08:22] <Lambda_Aurigae> megal0maniac, you might look at a tethered light pen too.
[08:10:40] <Lambda_Aurigae> press the pen to the screen and it flashes once...drawing and erasing a single dot over the entire screen...and the light pen picks up the dot when it is drawn where the pen is pressed.
[08:11:07] <Lambda_Aurigae> by knowing where the dot is drawn when the sensor triggers you get the position on screen.
[08:11:18] <Lambda_Aurigae> easily doable with an avr generating the video picture.
[08:18:08] <LeoNerd> Ohgod.. eBay is scary sometimes. I searched "1M 0603", and 3 mouse clicks later I had ordered a strip of them to my house.
[08:18:38] <Lambda_Aurigae> hehe.
[08:18:59] <Lambda_Aurigae> I haven't gotten into the surface mount parts yet myself.
[08:19:26] <Lambda_Aurigae> I do occasionally surface mount stuff..but it's all through hole parts with the pins bent flat..
[08:25:08] <LeoNerd> I kinda switched entirely overnight, when I discovered how easily you can get small-run PCBs fabbed
[08:26:09] <Lambda_Aurigae> I fab them myself.
[08:26:49] <Lambda_Aurigae> got a t-shirt iron-on press and a big pile of press-n-peel blue and a good laser printer.
[08:26:50] <LeoNerd> I mean, getting boards themselves made
[08:26:57] <Lambda_Aurigae> yeah...
[08:26:58] <LeoNerd> Oh.. yeah; but that just does one side of copper
[08:27:06] <Lambda_Aurigae> I can do both sides.
[08:27:13] <Lambda_Aurigae> have done double sided several times.
[08:27:20] <Lambda_Aurigae> and even 3 layers.
[08:27:21] <LeoNerd> I get double-sided + drills + plated vias + soldermask + silkscreen, for $5/board at my usual sizes
[08:27:40] <Lambda_Aurigae> yeah..no soldermask or silkscreen or vias.
[08:28:01] <LeoNerd> I honestly don't know why I would bother with the faff of doing it myself, when I can get those
[08:28:25] <LeoNerd> Plated vias/throughholes alone even, would make it worth it. Plus when you're doing mostly SMT and not TTH components, you really want that soldermask
[08:28:29] <Lambda_Aurigae> for double sided I print both sides align with the transfer on the inside, tape together, then slide the pcb into the pocket.
[08:29:08] <LeoNerd> Yeah; see that's whole chunks of the fab process I just don't have to care or know about. :) I just know that I draw a pretty picture on my screen, send it over, and then boards arrive in my front door that look like my picture
[08:29:09] <Lambda_Aurigae> put it into the iron on press and,,,,press..
[08:29:56] <Lambda_Aurigae> I started making my own PCBs back 30ish years ago with radio shack PCB kit...
[08:30:35] <Lambda_Aurigae> hand drawn circuits using a special sharpie.
[08:30:48] <Lambda_Aurigae> and a nice ferric chloride bath.
[08:32:25] <Lambda_Aurigae> went to toner transfer method back 10 or 12 years ago or so.
[08:32:47] <LeoNerd> Hah.. yeah; that's the other reason I do these PCBs... They're at a smaller scale than I could hand-draw with a pen
[08:32:57] <LeoNerd> Anything large enough scale I'll just do it on stripboard
[13:48:44] <_abc_> Based on the well known fact that real nerds are here on special evenings, here I ask again: Has anyone run into a atmega328p whose receiver usart has problems wit odd or even parity reception, but works fine with no parity? The usart transmitter works okay in both modes.
[15:24:28] <DrGamatos> Hello! I would like some help with avr VUSB... A really simple thing
[15:24:47] <DrGamatos> i am a completely begginer and i am building this
[15:24:52] <DrGamatos> http://www.bidouille.org/elec/usbnesadapter
[15:25:12] <DrGamatos> i made one adapter as it is in the schematic on a tiny perfboard
[15:25:37] <DrGamatos> and it works BUT i have swapped the USB D+ and D- inputs...
[15:26:00] <DrGamatos> So to avoid re wiring the whole messy stuff i decided to take the pull up resistor
[15:26:15] <DrGamatos> and rewire it to the other input and somehow configure
[15:26:29] <DrGamatos> the chip code to swap the expected usb inputs...
[15:27:02] <DrGamatos> That means USB_CFG_DMINUS_BIT 2
[15:27:14] <DrGamatos> and USB_CFG_DPLUS_BIT 0
[15:27:38] <DrGamatos> the thing is the usbconfig.h says that D+ must also be connected to interrupt pin int0
[15:27:50] <DrGamatos> that is now used by D- ....
[15:28:20] <DrGamatos> And as far as i can understand DOWN DOWN in the header there are some settings to circumvent this
[15:28:45] <DrGamatos> like USB_INTR_* things
[15:29:15] <DrGamatos> the problem is that i know NOTHING ABSOLUTELY about these so can someone help me please?
[15:29:49] <DrGamatos> TLDR: i want to swap the D+ and D- ports on a VUSB configuration that used pins PB2 and PB0 respectivelly
[15:29:57] <DrGamatos> Any help is really appreciated
[17:39:31] <tpw_rules> do pin change interrupts queue?
[17:44:33] <LeoNerd> I dno't imagine so
[17:44:55] <LeoNerd> You'd have to check the DS, but I suspect it's just a simple flag, to remember if at least one pin has changed
[17:46:30] <Jartza> at least on attiny88 there's PCIFR register
[17:46:37] <Jartza> where you get flags set when pcint occurs
[17:46:43] <Jartza> so in a sense they are
[17:47:36] <LeoNerd> Ooh?
[17:47:49] <Jartza> but you're right, it's just a simple flag
[17:47:59] <Jartza> but I'd call that flag a poor man's queue :)
[17:48:07] <LeoNerd> Much like the "classic" (i.e. non-RT) POSIX signals
[17:48:41] <LeoNerd> There's just a single bit for each interrupt, that remembers if it's pending. Multiple invokations don't count; don't expect to get three calls to PCINT<n> just because three bits changed separately
[17:49:22] <Jartza> indeed
[17:49:36] <Jartza> the flag just means that pcint will get called when possible.
[17:49:48] <Jartza> it doesn't matter how many pin changes you got
[17:57:48] <LeoNerd> PCIFR just stores a bit per bank of PCINT pins, not per pin
[18:36:18] <Lambda_Aurigae> DrGamatos, changing the pins on v-usb can be very tricky...specially if you move off of the int0 pin....it uses certain pins in order to stick to some very strict timing...
[18:38:15] <Lambda_Aurigae> DrGamatos, you could use int1 pin if your chip had such, but it doesn't so, you are stuck with pin 7 on the attiny45 as the D+ pin...must use that pin...period.
[18:39:15] <Lambda_Aurigae> DrGamatos, and,,pcint0 is not the same as int0 so that's a no go too.
[18:46:47] <Lambda_Aurigae> hmm..or is it the D+ pin for the int0? must look that up..one min.
[18:48:04] <Lambda_Aurigae> yeah...D+ must go on PB2/int0/pin 7...
[18:48:13] <Lambda_Aurigae> http://www.harbaum.org/till/i2c_tiny_usb/schematic.gif