#avr | Logs for 2016-01-07

Back
[01:20:50] <SadSmile> hey. what's the recommended way to program a 433MHz OOK/PWM receiver in an avr chip?
[01:22:02] <gevorg> there are a bunch of libraries out there
[01:34:43] <SadSmile> most of them are crap though
[01:35:16] <gevorg> true storry
[01:35:24] <gevorg> ever used any of them ?
[01:51:10] <rue_house> Jartza, bytes or bits
[01:51:41] <rue_house> ok they used bytes
[03:36:05] * inflex waits for Tom_itx to return
[05:33:55] <Roklobotomy> RIP atmel
[05:34:13] <Roklobotomy> microchip might buy?
[05:34:44] <Lambda_Aurigae> is possible.
[05:35:01] <Lambda_Aurigae> I would love to see AVR core with pic peripherals.
[05:36:39] <Roklobotomy> it's an ARM ARM ARM ARM world.
[05:39:20] <Lambda_Aurigae> is going that way.
[05:39:30] <Lambda_Aurigae> but,,,there are still 6502 remakes out there.
[05:39:43] <Lambda_Aurigae> and 8052 is still the most use microcontroller in the commercial world.
[05:40:04] <Lambda_Aurigae> well, 8051/8052 series
[05:40:07] <Xark> I just read that Imagination Technologies says 2016 is the year of MIPS. :)
[05:40:28] <Lambda_Aurigae> mips is nice...that's what pic32 is.
[05:40:42] <Xark> Yep. MIPS is pretty nice.
[05:40:44] <Lambda_Aurigae> a rather complex core though.
[05:40:48] * Xark us using it on FPGA. :)
[05:40:49] <Lambda_Aurigae> although, arm is more so.
[05:40:58] <Roklobotomy> be default from being stuffed into every USB controller and 2.4GHz wireless SoC out there.
[05:41:08] <Xark> ARM (especially Thumb-2) has better code density.
[05:41:33] <Xark> I think 8051 is on many smart cards too. :)
[05:41:39] <Roklobotomy> i think 8051 is simple and royaltee free and has no surprises. Noone is surprised 8052 sucks.
[05:42:09] <Roklobotomy> i hate it
[05:42:16] <Lambda_Aurigae> tv remote controls use 8051 quite often as well.
[05:42:24] <Roklobotomy> done several projects with it and it blows.
[05:42:37] <Lambda_Aurigae> the 8052 chips I use are fairly decent although a bit pricy...
[05:43:04] <Lambda_Aurigae> but 8052 was the first chip I could use to execute code from external sram.
[05:43:19] <Xark> I used some cheap but fairly decent STC chips. However, Visual Basic programmer utility was a deal breaker. :)
[05:43:20] <Lambda_Aurigae> still can't do that with any AVR
[05:43:45] <Lambda_Aurigae> ds89c450...built in serial bootloader that is simple to use.
[05:43:46] <Roklobotomy> Lambda_Aurigae: true dat
[05:43:48] <Xark> Lambda_Aurigae: Actually some AVR allow that... :)
[05:43:51] <Lambda_Aurigae> and sdcc
[05:44:03] <Lambda_Aurigae> Xark, 8bit attiny or atmega in a dip package?
[05:44:15] <Lambda_Aurigae> atxmega, yes...but not in a usable package for me.
[05:44:24] <Roklobotomy> SiLabs 100MHz 8052 with code cache - sucking faster than ever!
[05:44:38] <Xark> Lambda_Aurigae: Sure, Atmel 644 or 1284 can use external SRAM.
[05:44:46] <Lambda_Aurigae> not for program
[05:44:49] <Xark> (40 pin DIPS).
[05:44:50] <Lambda_Aurigae> just for data storage.
[05:45:04] <Lambda_Aurigae> atmega1284p is not dip...nor is the 644 as I recall.
[05:45:10] <Lambda_Aurigae> err
[05:45:10] <Xark> Sure it is.
[05:45:20] <Lambda_Aurigae> atmega1284p is dip..but no external ram interface
[05:45:27] <Xark> https://imgur.com/a/dIrLJ#1
[05:45:31] <Lambda_Aurigae> atmega128 has external ram interface but data only.
[05:45:32] <Roklobotomy> the world should be 68000 based
[05:45:47] <x29a> lol
[05:45:52] <Lambda_Aurigae> Roklobotomy, I have a pile of those!
[05:46:07] <Roklobotomy> nothing wrong with it
[05:46:10] <Xark> Roklobotomy: It should be. But Motorola was late and Intel had crappy 8086 ready... (wand we wasted > 10 years dicking with segments and 16-bit). :)
[05:46:16] <Lambda_Aurigae> Roklobotomy, if it was only faster.
[05:46:49] * Xark was just watching https://www.youtube.com/watch?v=q9KRq2Ns0ZE giving nice history of CPUs. :)
[05:47:03] <Roklobotomy> can you imagine, if we had our "i7" 68000's now we could run AMiga code natively.
[05:47:15] <Lambda_Aurigae> Xark, was at typo on my part...atmega1284p is a great chip with its 16K of sram...but still can't execute code from sram, internal or external, and has no external ram interface.
[05:47:33] <Lambda_Aurigae> Roklobotomy, 68040 chip rocked.
[05:55:13] <inflex> huh? ppl still use DIP?
[05:55:25] <Lambda_Aurigae> of course.
[05:55:49] <Xark> inflex: On breadboards. :)
[05:57:33] <Lambda_Aurigae> holy horse droppings batman!
[05:57:38] <Lambda_Aurigae> nobody won the 500 mil powerball.
[05:57:55] <Lambda_Aurigae> it's up to 675 mil for saturday....413 mil cash option before taxes.
[06:15:30] <Snert> I'll take it!
[06:15:45] <Snert> 413Mil would buy much beer.
[06:16:09] <Lambda_Aurigae> and a couple of pizzas to go with it too!
[06:16:14] <Snert> eve 260Mil after taxes
[06:16:18] <Snert> even
[06:16:18] <Lambda_Aurigae> yeah.
[06:16:34] <Snert> dang wish my state did lotteries.
[06:16:34] <Lambda_Aurigae> I could live off the interest from that,,,very comfortably.
[06:16:46] <Snert> yeah for sure.
[06:16:51] <Lambda_Aurigae> I'll be buying some tickets before saturday.
[06:17:03] <Snert> are they just 1buck a ticket?
[06:17:10] <Lambda_Aurigae> 2 per ticket for powerball.
[06:17:23] <Lambda_Aurigae> which is why it grows so fast.
[06:17:33] <Snert> unlucky me, Alaska doesn't do lotteries yet.
[06:18:03] <Lambda_Aurigae> minimum powerball is 20mil and it goes up 20mil at a time till it hits 100mil then the jump varies.
[06:19:22] <Lambda_Aurigae> and powerball is a multi-state lottery so lots of people in on it.
[06:20:19] <Lambda_Aurigae> someone about 40 miles from me won a 40million dollar powerball a few years back.
[06:22:01] <Lambda_Aurigae> it would be so awesome to be able to walk in to my boss' office monday morning and drop my phone and computer on his desk and tell him I can't work anymore because my give-a-shit is busted.
[09:54:57] <LeoNerd> Anyone know much (or has done anything) talking to SD cards over SPI? I'm having trouble getting anything to work
[09:57:30] <LeoNerd> So basically looking for some sort of overview / spec / document of some kind.. or some examples
[10:03:32] <tpw_rules> LeoNerd: yeah it's pretty esay
[10:03:49] <tpw_rules> http://elm-chan.org/docs/mmc/mmc_e.html
[10:04:10] <LeoNerd> I think I understand the principle, but it doesn't seem to work
[10:04:20] <LeoNerd> Yeah, that's the doc I was reading
[10:04:50] <LeoNerd> I've sent CMD0 to the chip, but it never responds... even if I try to clock 512 bytes out of it, the MISO line remains continuously low
[10:04:57] <tpw_rules> http://pastie.org/private/2ao6vaqqaxhg47eh8am23w
[10:05:13] <tpw_rules> that's the code i use. SD only, not SDHC
[10:05:51] <LeoNerd> Hm.. so init at 250kHz
[10:05:56] <tpw_rules> i put two files into one so it might not make sense
[10:06:07] <LeoNerd> ahhh... that dummy clocking is interesting - lines 40-43
[10:06:11] <tpw_rules> "After supply voltage reached 2.2 volts, wait for one millisecond at least. Set SPI clock rate between 100 kHz and 400 kHz. Set DI and CS high and apply 74 or more clock pulses to SCLK. The card will enter its native operating mode and go ready to accept native command."
[10:06:45] <LeoNerd> Ooooh DI high during that clocking
[10:06:49] <LeoNerd> I was clocking dummy zeroes into it
[10:07:58] <LeoNerd> Hrm.. and apparently it needs the DO pullup
[10:08:02] <LeoNerd> I don't have one of those
[10:08:15] <tpw_rules> yeah when reading you're supposed to clock in FF
[10:08:36] <tpw_rules> https://i.imgur.com/4CZ9E57.png you can just enable that in the port
[10:08:37] <LeoNerd> I seeeee
[10:08:52] <LeoNerd> Well, I''m not directly connected to the chip; my breakout board has a level shifter on it
[10:08:57] <LeoNerd> 74LVC125
[10:09:01] <tpw_rules> oh
[10:09:02] <tpw_rules> mine might too
[10:09:03] <LeoNerd> I'm not sure if that puts a pullup on
[10:09:03] <tpw_rules> idk
[10:09:10] <tpw_rules> i'm using the combo touchscreen and sd card shield
[10:09:30] <LeoNerd> (Also I should add I'm not actually talking via an AVR chip yet; I'm hacking first experiments using a PC-attached FT232H)
[10:09:39] <tpw_rules> oh
[10:09:56] <tpw_rules> but all that worked for a regular SD card
[10:09:59] <tpw_rules> SDHC is a bit different
[10:10:00] <LeoNerd> But I can mentally translate :)
[10:10:12] <LeoNerd> This isn't an HC card. It's a 2GiB microSD
[10:10:17] <tpw_rules> ok
[10:10:18] <LeoNerd> Oh. I don't think
[10:10:23] <tpw_rules> nah it shouldn't be
[10:10:28] <tpw_rules> usually >=4GiB is SDHC
[10:10:32] <LeoNerd> actually, how could I tell? I can plug it into my laptop
[10:10:45] <tpw_rules> i dunno
[10:11:03] <tpw_rules> but 2 should always be regular SD
[10:12:27] <tpw_rules> but try that other stuff first
[10:13:15] <tpw_rules> and i believe it is spec that you must deassert CS at the end of the command
[10:14:17] <tpw_rules> honestly i'm not sure. this particular application has multiple devices on the SPI bus so i may be doing it just to be safe
[10:14:50] <tpw_rules> "The CS signal must be driven high to low prior to send a command frame and held it low during the transaction (command, response and data transfer if exist). "
[14:25:12] <nuxil> good evening all :)
[14:28:41] <gevorg> good evening
[14:30:38] <gevorg> although, it's midnight here
[14:33:13] <nuxil> heh. its just 21 here
[14:33:18] <nuxil> sup
[14:34:08] <nuxil> im making progress with my Led mirror. got it kind of looking like a blue matrix ;D
[14:34:56] <nuxil> https://gyazo.com/02e0bd8d7f17924afb791673ddb423cf https://gyazo.com/bec36268d8ffd42d92c864ab07ab0495 https://gyazo.com/dce4288ff59a258005132249a517ae4f
[14:35:28] <nuxil> tinted the glass today and finished up the top plate. :)
[14:36:22] <gevorg> oh, looks pretty good
[14:36:50] <nuxil> a fun little project
[14:37:00] <nuxil> using 2x Atiny85's
[14:37:40] <gevorg> making one of those inifinite table thingies ?
[14:37:41] <nuxil> one as pwm and the other for the leds though shift registers
[14:37:58] <nuxil> this is justt a wall pize
[14:38:13] <nuxil> i want to do a table tho
[14:38:55] <nuxil> but im starting with a small mirror before i go loose on my table and cut it up :p
[14:39:53] <gevorg> are they talking to each other ?
[14:40:23] <gevorg> yeah, the table would look sick, but not really convinient imo
[14:40:29] <gevorg> *convenient
[14:40:53] <nuxil> nop :( no pins availeble on the one driving the shift registers,, except the reset which i cant use anyway
[14:41:09] <gevorg> hah, RIP table
[14:41:26] <nuxil> hehe
[14:41:46] <nuxil> i dont afford to fuck up :p
[14:41:53] <gevorg> i needed to make a i2c pwm controller on attiny84 once, never got around to do it though
[14:42:08] <gevorg> no hardware twi, only an imitation of one
[14:42:21] <gevorg> the USI ~_~
[14:43:34] <nuxil> the tiny85 is my 1st experiance with programming chips :)
[14:43:46] <nuxil> been fun tho
[14:43:49] <julius> hi
[14:43:53] <nuxil> hello
[14:44:33] <TechChristoph__> hi im locking for a good avr-tutorial
[14:44:41] <TechChristoph__> anyone some tips
[14:45:08] <julius> anybody got a "simple" example for a ws2812 led string? i looked at this one: https://github.com/cpldcpu/light_ws2812 but the three examples got a description at the top that contradict the basic ideas of the library - ease of use
[14:45:19] <TechChristoph__> i googled already but not any tutorial covers the whole thing
[14:45:23] <gevorg> oh, congratz then, have you killed anyone yet ?
[14:45:29] <julius> ive got a atmega32 controller, no arduino
[14:45:42] <julius> TechChristoph__, you german?
[14:45:49] <TechChristoph__> yes i am
[14:46:00] <TechChristoph__> swissgerman
[14:46:03] <TechChristoph__> of course
[14:46:06] <nuxil> TechChristoph_stick around here and what you want to know? there are some example on the net blinky,
[14:46:22] <nuxil> TechChristoph_this is a good channel to learn. good people in here ;D
[14:46:28] <nuxil> at times :p
[14:46:35] <TechChristoph__> oh cool thanks
[14:46:45] <TechChristoph__> well i worked with the arduino allready
[14:46:49] <nuxil> besides. there is some stuff in the topic
[14:46:53] <TechChristoph__> but i got bored
[14:47:14] <nuxil> why?
[14:47:49] <TechChristoph__> well 1. 30 bugs is a lot of money for one microcontroller and 2. I can build that for less money :)
[14:48:01] <nuxil> oh
[14:48:15] <nuxil> yeah
[14:48:30] <gevorg> well, https://www.newbiehack.com/Categories/AVR seems pretty good
[14:48:31] <gevorg> erm, I meant https://www.newbiehack.com/MicrocontrollerTutorial.aspx
[14:48:42] <nuxil> im loving the ATtiny85 tho
[14:49:05] <gevorg> TechChristoph__: what is the 'whole thing' ?
[14:49:14] <nuxil> im so impressed with what people do with it. eps Jartza and his vga controller
[14:49:33] <TechChristoph__> i meant the whole thing equals covers every part of one microcontroller
[14:49:33] <nuxil> hes on a tiny5 tho :p
[14:49:41] <julius> TechChristoph__, mikrocontroller.net - on the left, the avr gcc tutorial is good
[14:49:44] <gevorg> julius: write your own, that's the way to get the simplest libs
[14:50:03] <julius> true
[14:50:07] <TechChristoph__> ok
[14:50:38] <TechChristoph__> so you all are programming in C or is assembly the most better way ?
[14:50:50] <gevorg> and there were a number of ways to implement ws2812 protocol, which way do you want ?
[14:51:10] <nuxil> C for me.. having a hard time enuf with it. dont want to blow yo my mind on asm :p
[14:52:46] <TechChristoph__> nuxil: https://www.newbiehack.com/MicrocontrollerTutorial.aspx this covers the avr atmega32 right
[14:52:55] <nuxil> oh
[14:52:59] <nuxil> dot ask me anything :D
[14:53:06] <TechChristoph__> :)
[14:53:07] <nuxil> im a noob :D
[14:53:26] <TechChristoph__> well we are alle noobs in some ways :)
[14:54:30] <nuxil> making a eeprom board from scratch + getting it to work on the raspebrry pi then start to learn C + programming microcontrollers "ATtiny85" has been quit a ride for me :D
[14:54:30] <gevorg> cnlohr had ethernet bitbang on attiny85
[14:54:58] <gevorg> no such thing as the best
[14:55:00] <gevorg> depends on the project
[14:55:20] <gevorg> alhtough, once into it, assembly isn't that hard
[14:55:49] <nuxil> TechChristoph_ im making a led mirror "infinity mirror" using 2x tinys :D
[14:55:59] <nuxil> matrix in blue https://gyazo.com/dce4288ff59a258005132249a517ae4f :p
[14:56:45] <nuxil> real world modding ftw :)
[14:57:32] <TechChristoph__> nuxil: cool project
[14:57:45] <nuxil> it is :)
[14:58:03] <nuxil> i can reccomend trying to do it.
[14:58:11] <TechChristoph__> finished ?
[14:58:17] <nuxil> almost. 90%
[14:58:53] <TechChristoph__> ah ok
[14:58:57] <TechChristoph__> nice
[14:59:18] <TechChristoph__> well a member of a swissgerman hackerspace
[14:59:22] <nuxil> need to hook up the button to the top plate. make some more code for different lighting of the leds. but thats basically it
[15:00:10] <TechChristoph__> ok my next project will be a 3x3x3 led-cube
[15:00:23] <nuxil> rgb :p
[15:00:31] <TechChristoph__> yeah
[15:00:42] <gevorg> sounds fun
[15:01:08] <TechChristoph__> hope it will be :)
[15:01:26] <nuxil> that was one of my 1st ideas. it might be fun to do.. but it looks ugly as hell if not done properly
[15:02:45] <gevorg> well, it may be ugly, if it's a prototype
[15:02:58] <nuxil> true dat
[15:05:20] <gevorg> well, got to go
[15:05:22] <gevorg> good night everyone
[15:05:55] <nuxil> gnite
[15:06:46] <TechChristoph__> gnite
[16:43:20] <nuxil> C dudes.. question.. if i have a random binary/int.. but take example 0b1010.. (int 10) .. how can i Iterate though this var and check which bit has 1 and 0 ?example for a 8 bit?
[16:44:19] <nuxil> im trying something like. x=uint8_t x ; x= 0xA; for (i=0; i<8 ;i++) { if ((x << i) & 0x01) { its 1} else { its 0} but its not working :p
[16:49:01] <Mr_Sheesh> How can you figure it out? Clue: print the shifted number out each time, this can help a lot :P (Not doing well but I try to share the tools I'd use)
[16:50:47] <nuxil> no
[16:50:55] <Mr_Sheesh> IIRC << is left shift with 0's shoved in at the low end isn't it?
[16:54:12] <Mr_Sheesh> Not sure you're doing what you wanted to be doing
[16:54:30] <nuxil> ok. lemme try explain
[16:54:44] <nuxil> i have a random number. example 10
[16:55:40] <nuxil> im trying to send this number to a shift regiser. so i need to know the "bit sequense" of the var im trying to send. cos the shift register takes serial input
[16:56:04] <nuxil> so i need to know when to clock a 0 or 1 into the register.
[16:57:20] <Mr_Sheesh> are you shifting the low bits (2^0) or high bits? (2^7) in?
[16:57:24] <Mr_Sheesh> er first
[16:58:36] <nuxil> so for the number 10.. i need to set PB0 High(datapin). PB1 high/low.. (clock pin) , Pb0 low. clock, pb0 low, clock.
[16:59:03] <nuxil> now my clock and latch functions are working fine.
[16:59:34] <nuxil> just need to know how to read a int bit by bit
[17:00:09] <Mr_Sheesh> how about shifting the mask left or right, so for bit 2^7 you use 0x01<<7 then & that with the number, if 0 its 0, if non zero its 1?
[17:00:48] <Mr_Sheesh> x=uint8_t x ; x= 0xA; for (i=0; i<8 ;i++) { if (x & (0x01 << i) { its 1} else { its 0}
[17:01:20] <nuxil> oh
[17:01:26] <nuxil> i almost had it :p
[17:02:03] <nuxil> lemme try
[17:02:40] <Mr_Sheesh> not sure why the other didn't work; I tend to dump what's happening to a lot w/ #ifdef debug code & then if needed I can figure out what I messed up. Today, headache = guaranteed I might mess up, so test the code please :)
[17:03:17] <Mr_Sheesh> its basically the same just created differently but ...
[17:22:44] <nuxil> Mr_Sheesh, thx,, worked fine :D
[17:26:39] <Mr_Sheesh> nuxil, good :)
[17:35:59] <LeoNerd> \o/ I have some success with the SD card
[17:38:44] <LeoNerd> The trick, is that you have to wake it up by sending 10 bytes of junk over SPI, but that has to be all 0xFF bytes - I was sending 0x00