#avr | Logs for 2014-04-16

Back
[13:35:38] <Jartza> howdy
[15:31:50] <clOI> hello, i have an atmega328 and try to write to an lcd module. Do you have an idea, why I need the _delay_us(30) at the end of my send_nibbles function? http://hastebin.com/cagogosisi.coffee
[15:32:18] <clOI> If I don't wait those 30us I get weird characters.
[15:32:50] <Jartza> when sending "command" instead of "data", it takes usually around 26.9us from the controller to handle the command
[15:33:02] <Jartza> at least that's what my lcd's datasheet says
[15:33:24] <Jartza> so you might also just wait 27us :)
[15:33:54] <clOI> I have the delays for commands when calling the command.
[15:34:09] <Jartza> although my lcd talks via SPI, your's a parallel?
[15:34:30] <clOI> I tried to write: if (Command_or_Data == comman) { _delay_us(30); } and still got weird characters
[15:35:23] <clOI> yes. i think it's a KS0066U controller (should be compatible to HD44780)
[15:36:04] <Jartza> hard to tell what happens in your code as the paste was so short :)
[15:36:08] <clOI> i use 4 data lines, the reg_select and enable line
[15:36:18] <Jartza> what is "Command_Or_Data" etc.
[15:36:44] <clOI> http://hastebin.com/yetalavevo.cpp
[15:37:59] <clOI> set_8_bits<LCD_D7, 3, LCD_D6, 2, LCD_D5, 1, LCD_D4, 0, LCD_REG_SELECT, LCD_REG_SELECT_BIT, PIN_UNUSED, -1, PIN_UNUSED, -1, PIN_UNUSED, -1>(PORTB, PORTC, PORTD, data);
[15:38:25] <clOI> sets LCD_D7 with the 3rd bit of data, LCD_D6, with the 2nd bit of data,...
[15:39:09] <clOI> http://hastebin.com/xamatiyofu.m
[15:39:25] <clOI> http://hastebin.com/xamatiyofu.cpp
[15:42:33] <Jartza> wow
[15:42:44] <Jartza> that needs some investigation :)
[15:43:11] <clOI> :) that's a nice way of saying, that my code is not very readable
[15:43:18] <Jartza> I made my own lcd-library for the st7032 -controller myself because I didn't know if there was readily available ones
[15:43:29] <Jartza> the whole library is ~300 lines
[15:44:03] <Jartza> and the library has some extra features like writing to display in random, different kind of "clear"-effects, font creation etc :)
[15:45:17] <Jartza> but the basic idea is, that after sending the command, you should wait at least the 26.9us
[15:45:30] <Jartza> seems to be quite same in all controllers, 30us is just a safe value
[15:46:50] <Jartza> did you try something more simple like:
[15:47:07] <Jartza> if (Command_or_data == 0) { _delay_us(30); )
[15:49:15] <Jartza> those templates make the code quite hard to read, IMO
[15:54:18] <clOI> Yes I tried that. I have to insert that delay for data too.
[15:54:58] <Jartza> hmm
[15:55:06] <clOI> the templates make the generated code faster
[15:55:31] <Jartza> compared to regular C?
[15:55:32] <Jartza> :)
[15:55:32] <clOI> and my hope was / is, that the usage itself is very easy.
[15:55:41] <clOI> yes :)
[15:56:13] <Jartza> https://www.youtube.com/watch?v=7rMJPgWqLus
[15:56:14] <Jartza> :)
[15:56:27] <Jartza> yes, that's an "character" lcd :)
[15:56:44] <Jartza> with attiny85 running on 1MHz
[15:56:58] <clOI> http://hastebin.com/habijagaxe.cpp
[15:57:00] <Jartza> binary size is around 2.2kB
[15:57:55] <clOI> that's nice :) My code won't make that easier... :)
[16:00:18] <Jartza> well, my library is used like this:
[16:00:19] <Jartza> http://pastebin.com/FRwfAP8y
[16:01:12] <Jartza> oh, zzz is another library I made for myself :)
[16:01:26] <Jartza> it puts the attiny85 to sleep, instead of sleeping with "delay"
[16:01:42] <Jartza> actually to "power off"-mode and the watchdog wakes it up
[16:02:55] <Jartza> although I have to say that I still have a lot of things to learn from AVR
[16:03:03] <Jartza> as I got my first AVR like 1 month ago :)
[16:03:36] <clOI> wow, not bad.
[16:04:19] <Jartza> actually I got Arduino starter kit
[16:04:43] <Jartza> 2 days after that I ordered some "real" programmers, 100 attiny85's, 100 attiny84's and few atmega 328's :)
[16:04:50] <clOI> I never really understood the advantage of the Arduino over a simple atmega. (Unless you want to use the libraries i guess)
[16:04:52] <Jartza> got a bit carried away
[16:05:09] <Jartza> well for beginners I guess it's more simple
[16:05:13] <clOI> lol, i think i have 50 attinys and 50 atmega328s as well :)
[16:05:32] <Jartza> I actually use my arduino daily, but I made a high voltage serial programmer out of it for attinys
[16:05:38] <Jartza> so I can also use the reset-pin as io :)
[16:06:36] <Jartza> sort of brings back memories from "the early days" with "abc123"
[16:06:42] <Jartza> my first 'puter
[16:07:44] <Jartza> it was delivered as a kit, needed to be soldered and it had 1kB of memory and 28x12 characters on screen (after soldering the rf-modulator so you could connect it to tv)
[16:08:00] <Jartza> and no programs available, so I had to learn coding
[16:08:19] <Jartza> the next machine was real high tech compared to that (c64)
[16:10:04] <clOI> i unfortunately discovered low level programming only a few years ago.
[16:10:05] <Jartza> but it seems that there's plenty of stuff one can do with even attiny85
[16:11:32] <Jartza> clOI: https://www.dropbox.com/s/j6b77eh5zjkr2ow/VID_20140327_225000.mp4
[16:11:43] <Jartza> another video I made with the LCD :)
[16:12:36] <Jartza> btw. "rakettitiede oy" is the company I work for, directly translated it means "Rocket Science Ltd"
[16:13:44] <Jartza> that LCD was my first "learning project" with avr
[16:13:56] <Jartza> but currently I'm working on a real project with it
[18:08:46] <Lambda_Aurigae> clOI, the reason for the delay is to give the processor on the display time to process the data you are sending it.
[18:09:04] <Lambda_Aurigae> w|zzy, it's HERE!
[18:09:16] <Lambda_Aurigae> w|zzy, again, THANKS!
[18:09:24] <w|zzy> Awesome
[18:10:47] <Lambda_Aurigae> just unboxed it...haven't powered it up yet.
[18:11:15] <w|zzy> Should work :-P
[18:11:26] <Lambda_Aurigae> did get a windows7 install in vmware so I can play with atmel studio with it though.
[18:12:07] <w|zzy> That could hurt.. atmel studio is nice but bloated
[18:12:50] <Lambda_Aurigae> yeah.
[18:12:59] <Lambda_Aurigae> I will also setup a linux dev environment for it.
[18:14:12] <Lambda_Aurigae> I have a decently fast machine here...quad core amd FX-4150 at 1.4GHz and 12GB of ram. windows in vmware isn't bad, other than being windows.
[18:15:02] <Lambda_Aurigae> got a cellular wifi thingie for work today too so I have internet wherever I go.
[18:16:31] <Lambda_Aurigae> oh man....technology from Starship Troopers(the movie) and Logan's Run(the movie as well) is getting closer, kindasorta.
[18:16:45] <Lambda_Aurigae> http://dangerousprototypes.com/2014/04/16/hacking-a-3d-printer-into-a-tattoo-machine/
[18:16:57] <Lambda_Aurigae> they use lasers in the movies but still...
[18:46:11] <w|zzy> :-)
[19:08:08] <w|zzy> Alrighty. Back in swing.
[19:08:11] <w|zzy> Tried it out Lambda_Aurigae ?
[19:08:27] <Lambda_Aurigae> not yet.
[19:08:33] <Lambda_Aurigae> have other things to do before I can play.
[19:08:41] <w|zzy> Said no one ever :P
[19:08:48] <w|zzy> or everyone.
[19:11:05] <Lambda_Aurigae> had to cook supper
[19:11:10] <Lambda_Aurigae> and have homework to do.
[19:11:39] <Lambda_Aurigae> calculus and creative writing tonight.
[19:12:15] <Lambda_Aurigae> calculus is just creative writing for math,,,but,,
[19:17:26] <w|zzy> :P
[19:17:39] <w|zzy> Capital structure here.
[19:17:41] <Lambda_Aurigae> it's still kicking my butt.
[19:18:06] <Lambda_Aurigae> the creative writing part is easy for me..
[19:18:25] <Lambda_Aurigae> I can bullshit my way through about anything.
[19:19:37] <Lambda_Aurigae> http://dangerousprototypes.com/2014/04/16/the-deal-with-dirty-cheap-dirty-boards-pcbs/
[19:19:46] <Lambda_Aurigae> an update on that dirty pcb service.
[19:22:22] <w|zzy> I personally use Hackvana
[19:24:34] <Lambda_Aurigae> I have always just made my own.
[19:25:29] <w|zzy> I do have a pcb mill in the store room...
[19:25:38] <Lambda_Aurigae> toner transfer method here.
[19:27:12] <w|zzy> ive never used it. Ive had it for 2 months. Need to ship it to the local hackerspace..
[19:27:16] <w|zzy> QUickcircuit 7000
[19:27:21] <Lambda_Aurigae> daym.
[19:28:29] <Lambda_Aurigae> and you just gonna give it away!?!?!
[19:29:19] <w|zzy> i was gifted it.
[19:29:49] <w|zzy> they will use it, i dont have the time
[19:30:35] <Lambda_Aurigae> we have a town wide garage sale(all 8 houses) in the park across the street from my house here each summer
[19:30:48] <Lambda_Aurigae> this year I'm gonna be giving away a bunch of stuff.
[19:31:04] <w|zzy> :)
[19:31:15] <w|zzy> i just want things used.
[19:31:18] <Lambda_Aurigae> will post on the local freecycle site a few days before.
[19:32:00] <Lambda_Aurigae> I have piles of old computer stuff here that I'll never use...most of it given to me.
[19:41:45] <w|zzy> Yeah. I hear you. I normally use them at work.
[19:46:01] <Lambda_Aurigae> last summer I gave away a whole truckload to a guy who rebuilds old computers and gives them to poor families with kids.
[19:46:43] <Lambda_Aurigae> I've got a good 3 to 4 truckloads to go.
[19:57:43] <w|zzy> :)
[21:36:14] <anton02> do encoder and wheel assemblies exist?
[21:53:22] <anton02> Is it possible to use a optical mouse's detectors on a robot car to tell the IC exactly which way the car is travelling and at what speed?
[21:54:25] <anton02> it seems like it could work at first glance but also seems a little bit too good to be true
[22:00:30] <anton02> What type of socket does this cable use on the white plug end? http://www.robotshop.com/en/sirc-01-sharp-gp2-ir-sensor-cable-8.html
[22:02:45] <mdszy> anton02: seems like some sort of molex thingie
[22:04:15] <anton02> yeah i have the sensor with me now, was just wondering if this is a standardized plug i could just get from an electronics store
[22:07:16] <anton02> Is there a cheaper way to track wheel speed than with something like this? It's too expensive at $45. http://littlebirdelectronics.com.au/products/rotary-encoder-200-p-r-quadrature
[22:08:10] <anton02> Motors with encoders built in are just as bad http://littlebirdelectronics.com.au/products/1001-metal-gearmotor-37dx57l-mm-with-64-cpr-encoder
[22:10:15] <anton02> Apparently it's a JST cable whatever that is
[22:29:05] <Casper> anton02: if you can get ps2 mouse, then yes, a mouse output a counter of how much the mouse moved in x and y since the last update it got
[22:29:38] <Casper> let's say it's a 300dpi mouse, then for each 300 count it moved by about 1 inch
[22:29:55] <Casper> take note that you may miss some counts, so not 100% precise
[22:33:27] <anton02> i wonder how reliable this encoder would be. it uses magnetics. http://littlebirdelectronics.com.au/products/wheel-encoder-kit
[22:48:09] <Tom_itx> inductive?
[22:48:21] <Tom_itx> auto industry uses inductive
[22:50:20] <Tom_itx> unless the magnets would interfere with other sensors like compass etc
[22:55:52] <Xark> I think you also need ADC to read a hall-effect sensor too.