#avr | Logs for 2016-08-26

Back
[00:06:33] <holmser> I'm jumping into someone else's code right now, and coding an avr for the first time. Can't figure out what this accomplishes:
[00:06:46] <holmser> (character_buff[55-x] & (0x40>>y))<<y)>>0)
[00:07:08] <holmser> and.... as soon as I post it I think I understand it
[00:07:25] <holmser> except for the >> 0
[00:19:36] <Casper> holmser: >>0 is useless, shift right by 0 bits, optimised out
[00:20:08] <Casper> I'm guessing some left over code, or debugging
[02:02:41] <owl-v-> how is atmel's picopower different from microchip's xlp ??
[02:05:25] <gjm> yes
[02:06:13] <Casper> that is not an answer
[02:07:15] <gjm> 42
[02:07:29] <owl-v-> microchip also have nanowatt xlp :P
[02:07:49] <owl-v-> pico is smaller
[02:17:23] <owl-v-> after comparing attiny10 and pic10lf ...
[02:17:58] <owl-v-> wow. pic10lf looks amazing
[02:18:54] <owl-v-> or, maybe i was reading wrong..
[02:19:21] <owl-v-> power down mode (attiny10) 0.1uA
[02:19:45] <owl-v-> sleep mode (pic10lf) 20nA
[02:20:32] <owl-v-> hm..
[02:21:24] <owl-v-> still, pic is amazing
[04:01:54] <eszett> Does "5v tolerant" mean the chips can be powered with 5v from USB too?
[04:03:25] <owl-v-> i think so
[04:04:20] <eszett> k..
[04:04:33] <owl-v-> 5v tolerant it's not about powering with 5v, but i/o pins are 5v tolerant
[04:04:54] <eszett> its really annoying that most modern MCUs are 3.3v only, since then i must add a voltage regulator when i want to power them over USB
[04:05:11] <Snert> stop using cheesy power anyways.
[04:05:39] <eszett> I would say your keyboard is using cheesy power now isnt it?
[04:05:50] <Snert> it's a cheesy thing.
[04:05:54] <eszett> no..
[04:05:55] <Snert> it's appropriate.
[04:06:09] <eszett> Im a keyboard designer
[04:06:13] <_ami_> Snert: he is not using usb power just for power. he might be making usb based devices.
[04:06:30] <_ami_> how is it cheesy thing for you?
[04:06:39] <Snert> move to the future and get some 3.3v power.
[04:06:49] <owl-v-> you don't want to draw too much power out of usb2.0 stuff
[04:06:55] <Snert> leave the legacy behind.
[04:07:11] <owl-v-> lol
[04:07:22] <owl-v-> usb-c ??
[04:07:39] <Snert> I'd sidestep all usb.
[04:07:44] <Snert> to begin with.
[04:07:54] <owl-v-> then, lightning ?
[04:08:02] <Snert> it's for rodents and keyboards not video.
[04:08:35] <owl-v-> bluetooth, then.
[04:09:03] <eszett> owl: AFAIk "drawing power" depends more on amps than on Voltage
[04:09:16] <_ami_> Snert: you did usb to hdmi kind of thing?
[04:09:25] <owl-v-> eszett: power = v*i
[04:09:51] <eszett> so i dont really get what is the advantage of 3.3v over 5v
[04:10:04] <Snert> hi _ami_ - no, I am dongle averse. I usually don't use donglage/adapters and stuff like that.
[04:10:25] <Snert> if I need 3.3v I get 3.3v
[04:11:22] <Snert> I'll use usb power as a temporary measure or a convienence thing but my final stuff ain't powered via usb.
[04:12:00] <eszett> Snert: what do you user as power source?
[04:12:23] <Snert> bench supply. or a computer psu
[04:12:25] <_ami_> eszett: 3.3 v circuit consumes 50% lesser power than the same circuit at 5v.
[04:12:26] <owl-v-> eszett: what are you makeing?
[04:12:43] <eszett> ami: really so much
[04:12:56] <eszett> im working on a keyboard pcb for a custom keyboard Owl
[04:13:24] <_ami_> eszett: using avr mcu?
[04:13:28] <eszett> ye
[04:13:34] <_ami_> which one?
[04:13:35] <Snert> eszett: sounds kinda fun.
[04:13:42] <eszett> the atmega32u4, ami
[04:13:52] <owl-v-> arduino?
[04:14:16] <eszett> no arduino, just the chip
[04:14:24] <_ami_> nice. it has usb intf too. no external chip requires
[04:14:27] <_ami_> for usb
[04:14:44] <eszett> yes thats pretty important criteria
[04:14:59] <_ami_> i still use vusb :/ :P which i can't scale much :P
[04:15:07] <Snert> that's the nice convienient thing about usb. It's all there and works pretty good.
[04:15:16] <_ami_> need to try with real usb talking chip once.
[04:15:28] <Snert> I think it's just being pushed to do things it was never intended to do.
[04:15:53] <_ami_> Snert: mega32u4 ones?
[04:16:11] <Snert> usb in general. No specific case.
[04:16:21] <_ami_> ah, okay
[04:16:44] <Snert> like...gee...let's pump HD video down a usb bus just because we can.
[04:16:56] <_ami_> Snert: haha, true
[04:17:26] <_ami_> i am thinking to make usb to spi interface just to run few spi intf. lcds on rpi2 :P
[04:18:12] <_ami_> i know rpi has spi intfs
[04:18:44] <Snert> I must learn to spi.
[04:19:14] <_ami_> Snert: usb to hdmi adapters are there in marker.
[04:19:23] <_ami_> market*
[04:20:58] <_ami_> i saw a freelancer project somewhere, they want to make hdmi to spi adapter.. i wonder why would they want that.
[04:21:03] <Snert> I use them when I have to - I just prefer to stay native if I can.
[04:21:04] <_ami_> hdmi is too FAST
[04:21:40] <Snert> is that a problem?
[04:22:00] <Snert> harder to code, perhaps?
[04:22:08] <_ami_> width * height * 8 bits * 60 fps = <huge value> which i don't think an AVR can handle?
[04:22:35] <_ami_> Snert: i think there is a need to scale down the resolution to fit into lcd screen
[04:22:51] <Snert> lol...yea I guess so :)
[04:22:52] <_ami_> so its really HARD!
[04:23:46] <Snert> you're a much better coder than me if you can do that.
[04:25:35] <Snert> but seriously, why do that in the first place. Just send text data to the screen.
[04:25:49] <Snert> after all, it's an avr.
[04:25:54] <Snert> not a 32bit cou.
[04:25:57] <Snert> cou
[04:26:02] <_ami_> Snert: i shall work on it soon. currently learning Linux Device driver programming (especially usb ldd) . this project would be good excuse to apply the newly required knowledge.
[04:26:45] <_ami_> Snert: linux framebuffer can be used?
[04:26:46] <Snert> ya. and cement the knowledge and get it really learned.
[04:27:12] <Snert> I'm sorry, I'd have no idea about advanced programming stuff like that.
[04:27:28] <Snert> I can barely run a 7seg display.
[06:27:49] <Lambda_Aurigae> use an octapentaveega to send text to a VGA display.
[06:27:51] <Lambda_Aurigae> works great.
[06:28:56] <Lambda_Aurigae> using 1 or 3 attiny85 chips to generate text display on vga..it's really nifty little project and functional too.
[06:35:00] <Jartza> Lambda_Aurigae: thumbs up for that ;)
[06:35:10] <Jartza> https://github.com/rakettitiede/octapentaveega
[06:36:16] <Lambda_Aurigae> Jartza, morning dude....I've even been pushing it over on ##pic.
[06:37:42] <Jartza> hehe. I see it has 9 stars in github, last time I checked there was only 2 :)
[06:39:41] <Lambda_Aurigae> awesome.
[06:40:57] <Jartza> when I get my next 3D printer, I'm going to make a 3D printer VGA controller version
[06:41:10] <Jartza> with some kind of joystick
[06:41:22] <Lambda_Aurigae> oh?
[06:41:26] <Lambda_Aurigae> nice big display?
[06:41:32] <Lambda_Aurigae> you should get a touchscreen!
[06:41:51] <Lambda_Aurigae> I have an elo 14 inch touchscreen that works great with it.
[06:42:01] <Lambda_Aurigae> it even has a serial port for the touch interface.
[06:42:22] <Lambda_Aurigae> running an atmega1284p, I have one serial interface for the display and one for the touch interface.
[06:53:07] <Jartza> hmmh
[06:53:59] <Jartza> my printer controller runs atmega2560
[06:54:14] <Jartza> but it only has 20x4 character LCD
[06:55:00] <Jartza> and I have a lot of extra VGA monitors around
[06:55:13] <Jartza> so I thought to make some kind of display that I can just look across the room and see the status
[06:55:23] <Jartza> 32x16 characters on 19" monitor suits that nicely
[06:55:30] <Lambda_Aurigae> hehe.
[06:55:51] <Jartza> I also found an oscillator chip that has enough driving power to drive 3 chips simultaneously, no need for daisy-chaining the cloc
[06:55:55] <Jartza> clock
[06:56:14] <Jartza> and it gets rid of the tiny amount of sync problem with colors
[06:56:29] <Jartza> just need to design a new pcb for it
[06:56:32] <Lambda_Aurigae> awesome.
[06:56:39] <Jartza> http://www.linear.com/product/LTC1799
[06:56:49] <Jartza> sot23-5 :)
[06:57:13] <Lambda_Aurigae> I want to see if I can generate that 20MHz clock from a pic32
[06:58:03] <Jartza> well that clock can be generated from multiple sources, even from attiny
[06:58:10] <Jartza> but the clock just has too much jitter usually
[06:58:22] <Jartza> don't know how much jitter pic32 has
[06:58:31] <Lambda_Aurigae> that's what I want to find out.
[06:58:45] <Jartza> but at least none of the atmel chips have good enough internal oscillator for VGA
[06:59:02] <Lambda_Aurigae> oh, I would be using an external crystal to drive the pic32..
[06:59:23] <Lambda_Aurigae> and a dma source most likely to generate the clock signal.
[07:00:33] <Lambda_Aurigae> http://hackaday.com/2016/08/25/hackaday-prize-entry-a-cnc-scribe-for-making-circuit-boards/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+hackaday%2FLgoM+%28Hack+a+Day%29
[07:00:36] <Lambda_Aurigae> ok....this I like.
[07:00:50] <Lambda_Aurigae> take copper clad and coat it with something etch resistant.
[07:01:06] <Lambda_Aurigae> then use a scribe point to draw out the outlines of the circuit.
[07:01:08] <Lambda_Aurigae> and etch.
[07:01:35] <Lambda_Aurigae> this could be done with an old hp plotter and a sharp scribe point.
[07:01:41] <Jartza> yeah
[07:03:17] <Jartza> I still played around with an idea to have 24x12 characters with 8 colors with single attiny
[07:03:45] <Lambda_Aurigae> an 85?
[07:03:51] <Jartza> yea :)
[07:04:20] <Lambda_Aurigae> you have a projector there?
[07:04:25] <specing> or you could do 640x480 with a cpld
[07:04:35] <Lambda_Aurigae> specing, what's the fun in that?
[07:04:43] <Jartza> yea
[07:04:48] <Jartza> cpld, fpga... not fun
[07:04:52] <specing> very fun
[07:04:59] <Jartza> too easy
[07:05:05] <Lambda_Aurigae> Jartza, hook the opvg to a projector.
[07:05:13] <Lambda_Aurigae> throw that display up on the wall of the workshop.
[07:05:19] <Lambda_Aurigae> then you can read it from across the street!
[07:05:25] <Jartza> hehe. I do have projector, but I watch movies from it :)
[07:05:50] <Lambda_Aurigae> lately I only use my projector for flying rockets in KSP
[07:05:50] <Jartza> although, I've tried opv with projector and it works nicely
[07:06:10] <Lambda_Aurigae> ok..time to get ready for worky.
[07:06:34] <Jartza> time to go and pick up mails and then pick up kid from daycare
[07:06:41] <Lambda_Aurigae> eewww.
[07:06:57] <Lambda_Aurigae> children: a 100% terminal sexually transmitted disease!
[07:08:12] <Jartza> true :)
[07:08:40] <Jartza> but he's fun. I have someone to play ps4 games with, because my wife is not that much of a game geek (yet)
[07:09:49] <Jartza> anyhow. laters!
[17:04:35] <learath> https://www.youtube.com/watch?v=gEDsFgODJ1c
[17:11:43] <learath> https://www.youtube.com/watch?v=3zzJ-oAle94
[22:49:32] <daey> im getting a 12bit value from a temp sensor. i want to split said value into an integer and fraction value. the best idea i could come up with is to return a struct containing the two values. (char and unsigned int). considering that the fractional part is orginially encoded with only one nibble, it feels stupid to take such a big variable for it. how would you do this? http://pastebin.com/LkXRgDSJ
[22:55:49] <Casper> no fixed decimal?
[22:57:40] <daey> how does that work?
[22:58:06] <Casper> 17.25 -> 17250
[22:58:20] <daey> ah y. that was my first idea
[22:58:29] <daey> but for some reason i dumped it :/
[23:00:27] <daey> one thing though. when i do these *1000/16 calculations, till when do they work? are they limited by variable types?
[23:02:02] <CORDIC> daey: Are You sure that You want to both ``>>4'' and then ``/16''?
[23:02:21] <daey> yes
[23:02:29] <daey> the formula works
[23:02:55] <daey> its just a disgusting solution
[23:04:10] <Casper> I wonder if gcc think of doing >>4 instead of /16
[23:04:27] <daey> according to google it does
[23:05:09] <CORDIC> Casper: I bet it would optimize ``/16'' into ``>>4''. There is no simpler optimization.
[23:06:44] <Casper> it just depend if gcc think of that shortcut or if it does the division... cheat or real...
[23:23:09] <CORDIC> Introducing local variables with good names (simplest form of comment) will clarify the intent. Same machine code would be compiled.