#avr | Logs for 2016-05-16

Back
[01:33:41] <goddard> whats the difference between flash descriptors vs ram descriptors
[01:40:31] <Casper> one is for flash, the other is for ram
[01:59:28] <jacekowski> Lambda-Aurigae: someone made a fully functional mp4 player with SD support on AVR
[01:59:31] <jacekowski> Lambda-Aurigae: mp3
[01:59:46] <jacekowski> Lambda-Aurigae: actual mp3 decoding was done by external mp3 decoder
[02:36:22] <_ami_> jacekowski: nice, link plz?
[02:36:34] <_ami_> did he share his work somewhere?
[05:49:39] <Lambda-Aurigae> jacekowski, that's been done several times as I recall. It's not too difficult to suck data from an SD card and feed it to the mp3 decoder chip.
[06:28:05] <LeoNerd> Hmm.. So I need a kindof crazy ADC chip for this project. I have 6 test points; four of them in a straight line through AVCC -{0.1R shunt}- +term -{device under test}- -term -{0.1R shunt}- AGND; and two on either side of third shunt resistor driven by another power supply
[06:29:04] <LeoNerd> I need quite a few differential pairs: +term to -term (to measure device voltage), across any of the shunt resistors (to measure current), and between either +term to 3rd, or 3rd to -term (to measure bias voltage).
[06:29:46] <LeoNerd> Does anyone know of a decent ADC chip for doing this? Something >= 16bit, lots of muxable differential channels, and something ideally with a big PGA, so I can amplify up those crazy-small shunt differential voltages
[06:30:10] <LeoNerd> Ideally I'd love to sense 100µA, which means 10µV sense
[06:32:22] <LeoNerd> Hrm.. though maybe I could go for 1R shunts instead, and just accept more voltage drop across them
[06:32:30] <LeoNerd> .. or switch them. Mmmm.
[06:33:18] <LeoNerd> (If anyone wonders why; I'm trying to build a 3-terminal SMU that doesn't cost $4k)
[06:34:53] <Lambda-Aurigae> doubt you will find that all in one chip.
[06:35:50] <LeoNerd> Well.. so far I've found the ADS1158. Which is a crazy £15 chip. tiny little QFP48 thing
[06:36:01] <LeoNerd> 16 single-ended or 8 differential-input pairs. 16bit.
[06:36:20] <LeoNerd> No PGA though, but it does have an external loop between the mux and the ADC, so you can insert one
[06:36:30] <Lambda-Aurigae> I want to know how you are going to use a Programmable Gate Array to amplify things.
[06:36:35] <LeoNerd> Might be a bit accessive
[06:36:41] <Lambda-Aurigae> excessive
[06:36:44] <LeoNerd> Hrm? oh oops. Programmable Gain Amplifier
[06:36:48] <LeoNerd> A different PGA :)
[06:37:36] <LeoNerd> E.g. the INA219 has one of those; you can adjust the gain of the differential input before the ADC, so you can detect tiny voltage differences such as shunt drops
[06:38:36] <LeoNerd> I mean... I -could- use a multitude of sensors.. two INA219s on the main channel shunts and.. hrm.. some sort of bidirectional-capable version on the third. and a different differntial-capable ADC for the voltage measurements.
[06:38:55] <LeoNerd> But I like the idea of putting them all in one chip with external ref input, for consistency and accuracy. Means I can get one -good- ref
[06:39:35] <Lambda-Aurigae> http://hackaday.com/2016/05/16/a-dis-integrated-6502/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+hackaday%2FLgoM+%28Hack+a+Day%29
[06:39:51] <LeoNerd> Is that the one on a giant PCB at transistor level with lots of LEDs?
[06:40:04] <LeoNerd> Mmm yes,.. I saw that :)
[06:40:56] <Lambda-Aurigae> yeah.
[06:41:00] <Lambda-Aurigae> nifty neato looking.
[06:42:02] <LeoNerd> Ooooh.. this chip isn't quite as arbitrarily muxable as I thought
[06:42:25] <Lambda-Aurigae> they never are.
[06:42:26] <Lambda-Aurigae> hehe
[06:42:27] <LeoNerd> It has 16 analog input pins, but you can only pair them up for differentials. You can't arbitrarily route sensor taps onto the two sides
[06:42:29] <LeoNerd> Meh..
[06:42:40] <LeoNerd> Damn, once again I find myself wanting a crossbar switch
[06:42:47] <LeoNerd> Seriously people, crossbars
[06:43:26] <twnqx> isn't there a 4069 or something like that?
[06:43:32] <twnqx> with 4 analog switches
[06:43:55] <LeoNerd> There's a 4066, which is four simple SPSTs
[06:44:04] <LeoNerd> Stick enough of those on the board and it'll work
[06:44:22] <LeoNerd> Mm.. back each pair of those with a 74'595 and have nice big SPI-configurable crossbar. Mmmm :)
[06:45:56] <LeoNerd> Hm.. I wonder how much current you can push through a 4066
[06:46:34] <twnqx> or that
[06:46:45] <twnqx> not much
[06:47:00] <LeoNerd> I forget which but there's a chip that's dual 1-of-4 analog MUX switches with common input
[06:47:25] <LeoNerd> That would do me nicely. I could select any of .1 / 1 / 10 / 100R shunts. One switch for sense voltage, other for main current
[06:47:38] <LeoNerd> 4053?
[06:48:05] <LeoNerd> 4052. I was close :)
[06:48:38] <LeoNerd> Ugh... 25mA max
[06:50:21] <LeoNerd> Oh and it can only switch up to its supply voltage; up to 5V
[07:28:43] <LeoNerd> LTC2495. 16bit 16single/8diff channels. PGA. I²C.
[07:28:55] <LeoNerd> Cheap at <£5
[07:29:36] <LeoNerd> Still no crossbar though. 8 diff pairs, so I'll have to duplicate some of the input lines
[07:35:32] <LeoNerd> Ooh.. :/ But again the MUX can only cope with inputs within the main VCC range.. up to +5V
[07:35:41] <LeoNerd> I was really hoping for 12
[07:55:51] <Lambda-Aurigae> time to build one from mosfets!
[08:17:11] <Jartza> http://monster6502.com
[08:18:02] <Lambda-Aurigae> Jartza, I posted that some time earlier this morning.
[08:18:07] <Lambda-Aurigae> only, the slashdot article for it.
[08:18:14] <Lambda-Aurigae> is a kewl toy though.
[08:18:31] <Lambda-Aurigae> makes me want to build a 4-bit processor from 74xx series chips again.
[08:19:02] <LeoNerd> Lambda-Aurigae: Well, switching isn't really sufficient. I'd need to be able to do highside diff. inputs up at the 12-15V range, and also single-ended off ground
[08:19:39] <Lambda-Aurigae> need need need...
[08:19:53] <LeoNerd> I know ;)
[08:19:57] <Lambda-Aurigae> you need an analog computer, that's what you need.
[08:20:00] <LeoNerd> Nah..
[08:20:16] <LeoNerd> It'll be possible
[08:20:23] <Lambda-Aurigae> a -12 tp +12 volt analog computer.
[08:20:27] <LeoNerd> All I have to do is beat $4k for a "real" SMU
[08:20:42] <Jartza> Lambda-Aurigae: ahh, I missed that
[08:20:46] <LeoNerd> I suspect I may still be >$100 at this rate :/
[08:20:52] <LeoNerd> These nice ADCs don't come cheap
[08:20:53] <Lambda-Aurigae> shall I see if I can find one on sale for $3.5k?
[08:21:01] <LeoNerd> That's not *much* of a help
[08:21:12] <Lambda-Aurigae> it beats $4k!
[09:40:07] * LeoNerd discovers -fshort-enums
[09:40:11] <LeoNerd> This is lovely. I shall use this
[09:41:14] <kre10s_> heh. keeps those ints small! you could ofcourse just use #define
[09:41:32] <LeoNerd> But I like enums. named enums. They're much nicer for readers
[09:41:53] <LeoNerd> void timer0_setup(TimerPrescaler prescale, TimerMode mode);
[09:42:46] <kre10s_> meh. lots of typedef going on there... s' not me.
[09:43:36] <LeoNerd> You'd prefer to keep typing 'enum' all the time?
[09:44:52] <kre10s_> yea. because then I know it's size.
[09:46:23] <kre10s_> you only ever write it in the timer0_setup function def & prototype. most of the time you'll be using it like timer0_setup(ENUM_CONSTVALUEA, ENUM_CONSTVALUEB) anyway.
[09:47:25] <LeoNerd> Sure. But it's nice that the .h reminds readers what sort of values to pass there
[09:47:50] <LeoNerd> I dislike functions that take a long list of uint8_t params with no suggestion of what sorts of values they want
[09:48:21] <kre10s_> heh. but... then at least we know the size!
[09:48:47] <LeoNerd> Do I need to know?
[09:48:49] <LeoNerd> As the end user?
[09:50:55] <kre10s_> well. it's debatable. It becomes more obvious when you have things like typedeffed pointers.
[09:52:25] <kre10s_> You don't want those at all. sometimes you also want to pack things into structs for pushing on to some interface, then you also want to know the size at a glance.
[11:03:35] <carabia> jacekowski: yes, streaming a file to an _external_ mp3 decoder is very easy. An impressive feat would be to implement the decoder itself in the avr.
[11:09:09] <rue_bed> it turns out that getting the data off the SD card fast enough is a good trick
[11:09:38] <rue_bed> if your burst size is small, the cards really slow down
[11:20:50] <carabia> haven't got experience of anything else but HC cards
[11:22:01] <carabia> you can have more than fast enough speed if you have a buffer a sector
[11:22:16] <carabia> which is usually 512b
[11:22:21] <carabia> B even
[11:42:05] <rue_bed> at 512b read blocks, an SD card is barely fast enough to play a wav file
[11:42:24] <rue_bed> I ran into this trying to make a wav player
[11:42:43] <rue_bed> some cards are ok, most cards slow down with small read sizes
[11:43:18] <rue_bed> I didn't get the chance to tell it I wanted a large read and just throw out the other data
[12:08:11] <bss36504> I had no trouble reading mp3s off an SD card and streaming to an external decoder with a 32u4
[12:08:38] <bss36504> Pretty sure I used a 512B (yes, byte) buffer.
[12:13:35] <Casper> rue_bed: why not request a large read, then just stop the clock midway?
[12:14:12] <bss36504> That would work, but bit-banged SPI is really slow. So I was using the HW spi to read from the SD, then write to the codec.
[12:14:39] <bss36504> if you did some sort of clock gating hardware to the SD card, I think it would work like you suggested.
[12:32:25] <rue_house> did you have to help the decoder navigate bitrate changes?, I assume you were stripping out id3 and header info with the avr?
[12:37:11] <bss36504> Nope. The decoder was a VS1003. Shove the raw mp3 bytes in the buffer, it takes care of the rest.
[12:37:16] <bss36504> pmp.simpstek.com
[12:38:21] <bss36504> forgive the apple-esque wording :P
[12:42:59] <rue_house> its ok with the headers and id3 tag data?
[12:43:10] <carabia> yes it is.
[12:43:18] <rue_house> huh
[12:43:21] <carabia> vlsi-chips are super simple to use.
[12:43:55] <bss36504> Yeah, literally the easiest integration I've experienced. Their code wasn't stupidly over complicated to port like some companies' are
[12:43:59] <carabia> did a player with a vs1011 (iirc) a few years ago
[12:44:02] <rue_house> and its not ok with it like the wav player libraries that play the header as data and approximate the sample rate within 100hz?
[12:44:27] <bss36504> The hardest part of that whole project was getting the stupid SD card to work.
[12:44:34] <rue_house> yea
[12:44:37] <rue_house> been there
[12:44:43] <carabia> that particular chip could have been used as a standalone player too, with uploaded user application code
[12:44:45] <bss36504> Spent like a week tracking down one instruction I forgot to send too it
[12:45:10] <carabia> but i decided to go with an avr for streaming due to more i/o available
[12:45:18] <bss36504> yes that is true.
[12:45:19] <rue_house> did you do the code from scratch?
[12:45:33] <carabia> bss36504: CMD8?:)
[12:45:44] <bss36504> The whole project was intended to be as modular as possible so different group memers wouldnt bump into one another developing code
[12:46:01] <rue_house> but you ended up beingthe only coder?
[12:46:27] <bss36504> So i did the AVR stuff, another guy programmed the screen/databasing on board, a third did a java desktop app (iTunes like) and the fourth guy didnt do much :P
[12:46:30] <rue_house> cause the world sucks and nobody is interested in a good project till its finished and they can see it?
[12:46:31] <bss36504> but thats the way it goes sometimes
[12:46:40] <bss36504> Overall it went wonderfully
[12:46:49] <rue_house> cool
[12:46:57] <bss36504> We met all of our baseline objectives, had/have a working product
[12:47:05] <bss36504> "product"
[12:47:27] <rue_house> I'll bet the forward/back buttons weren't backwards like those chinese players either
[12:47:29] <bss36504> not like we intended too upend the market with that brick. It was a learning exercise, and also one of the only "Fully complete" projects at the end of the year
[12:47:32] <bss36504> haha no
[12:47:39] <bss36504> they were the way they are supposed to be
[12:48:33] <bss36504> The first guy on the team page, btw. Did the circuit design stuff too, since the other EE wasn't very helpful. Fortunately, I budgeted for having to do his work too
[12:48:54] <bss36504> whoops, that was supposed to say I'm the first guy*
[12:49:27] <carabia> circuit design for an mp3-player can be done in a day, _tops_
[12:50:00] <bss36504> Oh yes, but I was also taking like 22 credits so i didnt have a lot of spare time haha
[12:50:21] <carabia> yea well, one saturday afternoon and boom, done.
[12:50:53] <bss36504> Yes, the schematic was super quick compared to the system level design and the layout. Those took slightly longer.
[12:51:37] <carabia> yeah, system level functionality takes longer when you need to design a UI
[12:54:42] <bss36504> Right, and since I was responsible for finding parts that would work, and couldn't really rely on my teammates to double check hardware choices, I took my time planning and reading stuff. Got a prototype board made halfway through first semester, debugged a bunch of stuff with that then had all second semester to polish the rest of it. It was a pre
[12:54:43] <bss36504> tty interesting exercise in physical design as well. Usually I'd only worry about button locations in 2 dimensions. Enclosures that seem large on paper get very tight very quickly
[12:55:05] <rue_house> is there a project page for it?
[12:55:43] * Tom_itx wonders if rue_house is sick, dying, unemployed or just on vacation
[12:55:53] <bss36504> yeah pmp.simpstek.com
[12:56:00] <rue_house> vaccation
[12:56:24] <Tom_itx> ur supposed to go somewhere on vacation
[12:57:04] <rue_house> I did, I'm at home
[12:57:18] <Tom_itx> they can find you there though
[12:57:22] <bss36504> Staycation tom
[12:57:42] <rue_house> I dont go anyhwere on vaccation, thats the nice part
[12:57:46] <rue_house> dont have to go to work
[12:57:53] <rue_house> I do plan to go shopping tho
[12:58:02] <rue_house> I'm freaking out, I only have 5 days
[12:58:58] <rue_house> bss36504, a digital joystick might have helped eh? those buttons look pretty snug :)
[12:59:45] <rue_house> cool
[13:00:24] <bss36504> rue_house: Yeah in hindsight that may have been slightly easier, but those were pretty neat little buttons. Much smaller than most tactile switches.
[13:00:40] <bss36504> I was originally going to do capsense. Didnt have time though
[13:00:57] <rue_house> if that was all the room available, its probably better you didn't
[13:01:38] <bss36504> Spent a lot of time (poorly) machining that aluminum case, then literally on project presentation day one of my computer engineering teammates goes "why didnt we just 3D print it". I felt like a real dummy because that would have been so much easier haha
[13:01:55] <bss36504> "Why didnt you say something a month ago!?"
[13:01:59] <rue_house> because anyone can 3d print it
[13:02:05] <bss36504> that's true :)
[13:02:18] <bss36504> I needed an excuse too use a milling machine
[13:02:18] <rue_house> only someone hardcore can make it from a 15 lb block of metal ;)
[13:02:32] <rue_house> even better by hand!
[13:04:20] <Tom_itx> 3d metal print it
[13:05:21] <carabia> 5d plasma print it
[13:05:52] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/cnc/temp/prints/Ti_print1.jpg
[13:05:54] <Tom_itx> lrg pic
[13:05:55] <rue_house> time travel is a great way to speed up a print
[13:06:01] <Tom_itx> all those were TI metal printed
[13:07:04] <bss36504> Well that's neat
[13:07:12] <carabia> the universe is a computer simulation running on an ardrdedasdauin
[13:07:37] <carabia> ardudidiididino on a node.js interpreter
[13:07:46] <bss36504> Laser sintering?
[13:07:47] <carabia> on = with, actually
[13:07:55] <Tom_itx> yes
[13:08:01] <bss36504> fancy
[13:08:08] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/cnc/temp/prints/Ti_print2.jpg
[13:08:15] <bss36504> How much does one of those printers cost?
[13:08:18] <Tom_itx> the gear set was printed as you see it fully assembled
[13:08:23] <Tom_itx> more than you got
[13:08:44] <Tom_itx> it costs ~30k to fill the chamber with powder
[13:08:54] <bss36504> Oh bastard
[13:09:00] <carabia> Oh Tom_itx you old hillbilly :)
[13:09:05] <bss36504> what happened to the flat lego plate?
[13:09:10] <Tom_itx> it must be full each time
[13:09:19] <Tom_itx> probably got bumped during a print
[13:09:31] <Tom_itx> once it misses 1 layer it doesn't recover
[13:09:44] <Tom_itx> the beam is that fine
[13:13:16] <bss36504> Are the finished parts close to as strong as traditionally cast Ti?
[13:14:18] <Tom_itx> i dunno, they were running some test specimens on that the day i was there
[13:14:41] <Tom_itx> i presume it is however there are some voids in the print
[13:16:56] <bss36504> Very cool tech
[13:27:40] <carabia> i saw a bit on airbus doing titanium printing not so long ago, was pretty cool. For now, I'd rely more on cast titanium.
[13:35:36] <liwakura> i like that golf club
[18:39:56] <liwakura> my OCR* pins dont wanna PWM: https://w1r3.net/mXrhcaJo.txt
[18:40:31] <liwakura> the ws2812put is confirmed to work, and the ws2812 is raving like shit. but the OCR pins seem empty
[18:41:11] <liwakura> i attached the normal led to the ws2812 data and it showed the ws2812 signal dim
[18:41:22] <liwakura> so the leds work on non-OCR* pins
[18:42:15] <liwakura> they also work when i drive the led pins manually via PORT
[18:46:26] <kre10s_> Try just setting up one timer to a fixed frequency and duty cycle.
[18:48:32] <kre10s_> Or. Try compiling a small program to check the behavior of the sethue function.
[18:48:41] <liwakura> wait
[18:49:02] <liwakura> i found the mistake. typo, i initialize TCCR0A twice
[18:49:07] <liwakura> instead of TCCR0A and TCCR0B
[18:49:39] <kre10s_> you've done the same with 2A and 2B i see.
[18:50:00] <liwakura> yeah
[18:50:12] <liwakura> judging from the eyecancer i have now, its working
[18:50:15] <liwakura> headache
[18:50:17] <liwakura> fuck
[18:52:21] <liwakura> thanks anyways
[19:04:07] <liwakura> kre10s_: thanks, here is the result: https://w1r3.net/qbnFTtLT.mp4
[19:04:19] <liwakura> note: its 1:30 AM where i live
[20:42:12] <kre10s__> a dog with between 3 and 4 legs is either a cripple, or a legless dog.
[20:43:48] <Lambda-Aurigae> unless they are not the dog's legs...
[20:44:46] <kre10s__> you sly boy you!
[22:25:03] <carabia> i ran into a problem i've never seen before with this batch of 8g kingston uSD's. They seem to randomly lock up sometimes when performing a read operation. They acknowledge the read, but data never gets transmitted. micro just keeps clocking the line, and the card never recovers. I guess a timeout to reset and reinit the card is in order. Just a heads up for anyone else
[22:33:28] <Valen> carabia: sure they aren't fakes?
[23:04:31] <carabia> Valen: totally not sure. Heh
[23:05:23] <Casper> carabia: from ebay?
[23:05:52] <carabia> Casper: yeah
[23:06:09] <Casper> most likelly fake
[23:06:22] <Casper> don't buy kingston off ebay
[23:07:03] <carabia> Could be yeah. I can still modify the circuit. I'll just add in a transistor for powering it down if it hangs
[23:18:49] <Casper> carabia: there is some software available to test the card, I strongly advise that you do the test
[23:18:54] <Casper> it might be a 2GB only
[23:19:08] <Casper> or have bad cells
[23:46:20] <MarkX> quick question, is there a way to have atmel studio automatically use flip and upload the new hex file to the device?
[23:46:30] <MarkX> atmel studio 7
[23:46:33] <goddard> when you want to send data serially this is all I need to do right?
[23:46:35] <goddard> Serial_SendByte('a');
[23:49:32] <carabia> Casper: no it can't be that. Sometimes it hangs on data I have been able to read just fine.
[23:55:43] <DKordic> goddard: What do You mean ``send data serially''?! Send over UART, SPI, etc. USB?!