#avr | Logs for 2013-10-26

Back
[07:11:02] <RikusW> Does anyone want a free Altera USB Blaster clone for USB AVR ? https://sites.google.com/site/megau2s/home/supporting-software/Blaster20131026.7z?attredirects=0
[07:12:00] <specing> Can I get a free money tree replacement clone?
[07:13:50] <RikusW> specing: you'll have to make the printing plates yourself though... :-P
[07:14:09] <RikusW> Seems its months of work carving a single block of steel
[07:14:53] <RikusW> specing: it can be used as a generic JTAG bitbanger too
[07:20:36] <Fornaxian> RikusW, with the right milling machine one could do it in days!
[07:21:04] <RikusW> engraving rather
[07:21:37] <Fornaxian> yup.
[07:22:28] <Fornaxian> mmm...homemade bacon is awesome.
[08:28:48] <vsync_> "homemade bacon" what does that even mean? are you a farmer?
[08:28:56] <vsync_> otherwise, if you just cooked it in the pan, i'm thinking "homemade bacon" is just as homemade as "homemade apple slices". Boy sure they are homemade!
[08:59:23] <Fornaxian> vsync_, we got a 10 pound pork belly from someone who had a hog butchered.
[08:59:36] <Fornaxian> then we cured and smoked it.
[09:00:12] <Fornaxian> well, we cured it here for a week then the neighbor smoked it for us...
[09:00:28] <Fornaxian> so, if we had our own smoker and butchered our own home raised hog it might be more homemade.
[09:00:32] <Fornaxian> but this is damned close.
[09:01:21] <Fornaxian> I'm not really a farmer but we do have 40 chickens and 4 ducks and a garden...and live in the middle of nowheresville.
[09:11:50] <vsync_> I guess it's better than nothingtown
[09:13:03] <Fornaxian> not by much.
[09:13:17] <Fornaxian> only businesses here are a church and a crop production services facility.
[09:13:30] <Fornaxian> and, I suppose, our veggie stand out by the road.
[09:13:39] <Fornaxian> but it's shut down for the season now.
[11:06:56] <beaky> hello
[11:07:09] <beaky> what sleep modes still let hardware PWM run
[11:08:27] <megal0maniac> beaky: Datasheet?
[11:08:41] <megal0maniac> Hint: PWM needs timers
[11:10:33] <vsync_> not the arduino smps again?
[11:11:48] <beaky> yes i want my arduino to sleep when pwm duty cycle is 0
[11:11:54] <beaky> i mean when the pulse is 0*
[11:12:16] <beaky> improving efficiency of my smps
[11:13:24] <Tom_itx> 120% ?
[11:14:30] <vsync_> that's fast sleeping
[11:14:39] <vsync_> i.e. "power nap"
[11:17:32] <megal0maniac> Power factor of 1.2?
[11:17:36] <megal0maniac> Sounds legit
[11:21:01] <hjohnson> alas I can't work on my project right now because I can't see
[11:21:14] <hjohnson> (I got my eyes lasered yesterday.... so i'm effectively blind right now :P)
[11:23:10] <megal0maniac> A bee flew into my car today while I was driving
[11:23:35] <megal0maniac> Could have stung me in the eye, but it didn't. It was on my hand.
[11:23:48] <megal0maniac> I hope you all enjoyed that story. Bye :)
[11:36:13] <tzanger> you can have a power factor > 1
[11:36:20] <tzanger> just indicates a capacitive load
[11:37:11] <tzanger> not sure how popular it is now but many factories used to have a synchronous motor driving a compressor (stable load) and ran it slightly ahead of unity to help offset all the other inductive loads
[11:39:43] <RikusW> beaky: only one sleep mode will work for that
[11:39:55] <RikusW> all others shutdown the clock
[11:41:04] <beaky> ah right idle onl works
[11:41:13] <beaky> but what about the asynchronous timer2
[11:41:37] <beaky> s/idle/cpu/
[11:43:26] <RikusW> clock startup takes time... it will screw the feedback loop
[11:43:58] <beaky> ah
[11:44:40] <beaky> n
[11:44:45] <RikusW> you'll probably want continous ADC
[11:44:49] <beaky> i thought it took nanoseconds
[11:45:12] <RikusW> depending on fuses quite a few ms, up to 65ms
[11:45:42] <RikusW> crystals take a while to stabilize
[11:45:51] <beaky> ah thats slow
[11:49:44] <RikusW> check the SUT fuses
[11:50:02] <RikusW> for sleep there is a separate register for it too
[11:50:41] <beaky> ah
[12:10:31] <beaky> are avr gpio full duplex?
[12:11:39] <vsync_> lol
[12:11:43] <vsync_> think about it? are they?
[12:11:47] <beaky> nope
[12:11:55] <beaky> only half
[12:13:42] <beaky> I love GPIO
[12:13:46] <beaky> GPIO can do everything
[12:14:20] <vsync_> D:D
[12:14:33] <vsync_> What else do you love? Tell me everything
[12:14:44] <vsync_> the thing about "full duplex" is that you can implement it
[12:14:51] <beaky> but i need two pins
[12:15:06] <beaky> or just one?
[12:16:19] <vsync_> for what purpose is this?
[12:17:08] <beaky> usb
[12:17:28] <vsync_> arduino?
[12:17:31] <beaky> i want to conect my arduino to pc
[12:17:53] <vsync_> doesn't the arduino have a ftdi on it
[12:18:01] <vsync_> ??
[12:18:12] <beaky> whats an ftdi
[12:18:37] <beaky> oh a usb-rs232 transceiver?
[12:18:39] <vsync_> those rs232 to usb chips
[12:18:45] <beaky> but i want direct usb
[12:18:52] <vsync_> on a 328?
[12:18:59] <beaky> yes
[12:19:28] <vsync_> Okay
[12:19:47] <vsync_> I guess you'd have to go V-USB and given the amount of whine people have been giving out of it here... Good luck
[12:19:57] <vsync_> or, alternatively, bit bang it (kekekek)
[12:20:39] <beaky> haha
[12:20:47] <beaky> i love bit banging
[12:21:22] <vsync_> ahahah. sure you do
[12:23:04] <vsync_> okay time to get cracking with my fat32 lib...
[12:26:23] <RikusW> bitbanging usb ?! no fun....
[12:26:44] <RikusW> beaky: get a proper USB AVR
[12:30:27] <vsync_> i guess there aren't any arduinos with usb avr so he can't
[12:42:20] <RikusW> there are actually
[12:42:23] <RikusW> m32u4
[12:44:06] <Tom_itx> arduino?
[14:27:06] <qartis> I've got a handheld digital camera that's being powered from regulated 3.3v
[14:27:29] <qartis> it's meant to take 2xAA (around 3.1V)
[14:27:59] <qartis> but some AA batteries go up to 1.6V+ so I'm confident 3.3V won't kill it
[14:28:26] <qartis> but the first thing the camera does on bootup is mechanically extend the lens using a motor
[14:29:10] <qartis> and that current draw seems to cause the voltage to dip just enough for the camera to think it's got dead batteries, and it retracts the lens and shuts off
[14:29:43] <qartis> I've got a 100uF capacitor across the battery terminals, but it doesn't seem to be enough
[14:30:09] <qartis> do you think I need a bigger cap, or is there maybe something else I'm forgetting?
[14:30:14] <qartis> 100uF is the biggest I've got at home
[14:30:21] <RikusW> what psu do you use ?
[14:30:34] <RikusW> are it able to supply enough current ?
[14:30:53] <qartis> ld1086v33 with proper caps
[14:31:19] <RikusW> and before that ?
[14:31:40] <qartis> 5V 1A usb wall wart
[14:32:02] <qartis> I've got a few 10uF caps on the 5V input to the 3v3 regulator as well
[14:32:40] <qartis> last night when I set this up, it worked perfectly
[14:32:52] <qartis> so I feel like I'm not far off
[14:33:07] <RikusW> sound ok
[14:33:08] <RikusW> what changed ?...
[14:33:17] <qartis> it's daytime now
[14:33:26] <qartis> the ld1086 must be light-sensitive
[14:33:30] <qartis> ha, ha
[14:33:53] <qartis> nothing else changed though, and today it works about 10% of the time
[14:34:06] <RikusW> bad connections ?
[14:34:37] <qartis> hmm, it's possible
[14:34:48] <qartis> I don't have a scope to see the actual dip
[14:35:05] <qartis> or to measure the peak current draw
[14:35:10] <qartis> just a multimeter
[14:54:56] <juri_> 3.3<->5v level conversion, irf510 good enough?
[14:59:54] <qartis> RikusW: just realized... last night I was powering the camera off its own batteries..
[15:00:25] <qartis> I had been working on a different part of the system
[15:03:00] <qartis> and I've got it working now using an lm2596-based regulator module and the 100uF cap
[15:11:58] <beaky> I love pwm
[15:16:40] <carabia> what don't you love?
[15:33:30] <carabia> 2596... probably smps! smps are hellish fiends
[15:34:30] <beaky> I love smps
[15:44:13] <bitd> carabia, whats wrong with smps?
[15:44:57] <carabia> i was baiting beaky
[15:45:08] <bitd> Ah, I see :P
[15:46:19] <beaky> when doing adc
[15:46:22] <beaky> should i sample 4 times
[15:46:25] <beaky> or is once enough
[15:46:39] <beaky> atmel recommends 4 samples
[15:49:42] <bitd> What are you measuring?
[15:49:50] <beaky> measuring temperature
[15:49:52] <beaky> from thermistor
[15:49:54] <bitd> Ah.
[15:50:03] <bitd> Get as much samples as you can, and average that.
[15:50:22] <beaky> what if i have multiple sensors on same "location". do I oversample each one
[15:50:44] <bitd> Sure, and average that.
[15:51:05] <bitd> And if one falls out of range of the others with a certain factor, ignore it for one cycle.
[15:51:39] <bitd> You need at least three to do that obviously.
[15:59:50] <beaky> so I do: sample sensor 1 4 times, sample sensor 2 4 times, sample sensor 3 4 times, add all readings and divide by 12?
[16:00:50] <bitd> Yes.
[16:01:22] <bitd> And if one of the sensors readings falls a factor x from the other two, exclude it that round.
[16:03:00] <beaky> ah so i need 3 registers
[16:03:05] <beaky> one per sensor
[16:03:12] <beaky> to do that kind fo exclusion
[16:07:08] <bitd> How many bits does the adc you are using supply?
[16:07:25] <beaky> only 10
[16:07:34] <carabia> only
[16:07:54] <beaky> yeah 10 seems wimpy in this age of 20-bit adcs
[16:08:04] <beaky> and where even the cheapest pic has 12
[16:08:13] <bitd> Thats a pretty nice resolution :P
[16:09:11] <bitd> Are you programming the mcu in c or asm?
[16:09:16] <beaky> c
[16:09:26] <bitd> Oooh, so no problems in storing stuff then.
[16:10:40] <bitd> Simple solution could be to store all the readings in an array, order the array to value.
[16:15:20] <bitd> Are you still around? <.<
[16:17:40] <beaky> hello
[16:18:38] <beaky> how do i get more mips
[16:20:29] <bitd> Get two mcu's? :P
[16:21:35] <carabia> :DDD
[16:21:45] <carabia> you need more power
[16:26:27] <bitd> Well, you could use asm to make the best of the amount of cycles you have :P
[16:26:54] <bitd> Doubt you will beat compiler optimization on the first go though.
[16:38:17] <jacekowski> on avr, even half brained monkey can beat gcc optimisations
[16:56:51] <bitd> jacekowski, did not know it was that bad.
[16:58:12] <specing> Im sure even a zombie monkey can beat gcc optimizations while screaming "BRAIIINZ!!!" in monkey-talk
[17:00:45] <bitd> Interesting <.<
[17:36:35] <jacekowski> specing: it's ok on x86
[17:36:45] <jacekowski> specing: but on avr it's piss poor
[17:37:10] <specing> Last time I did ARMs I looked at the disasm
[17:37:18] <specing> I was like ... WHAT?!
[17:37:47] <specing> couldn't understand where my original code was
[17:37:56] <specing> magic.
[17:38:16] <jacekowski> iirc, simple byte swap - which on AVR could be implemented in 4 instructions, avr did it in 30-ish
[17:38:19] <jacekowski> gcc*
[17:38:56] <bitd> Wow, thats some pretty neat padding.
[17:48:55] <carabia> Thank god beaky wasn't here when you said that
[19:18:49] <Casper> jacekowski: like... mov r16 r15; mov r17 r16; mov r15 r17; with a push and pop?
[19:18:58] <Casper> (so 3 or 5?)
[21:25:59] <beaky> hello
[21:26:13] <beaky> how do i wake my avr up every 10 minutes
[21:26:31] <beaky> do i use normal 16-bit timer, or should i use the watchdog
[21:28:06] <Tom_itx> alarm clock
[21:28:23] <theBear> watchdogs do not work that way
[21:30:49] <seldon> which avr are you using?
[21:31:05] <beaky> ATmega48
[21:31:22] <beaky> it wakes up every 10 minutes to run a PID, then it sleeps
[21:33:22] <seldon> Well, neither 16 bit timer nor watchdog timer can be prescaled that low, so you'll have to wake up every few seconds and count the number of interrupts to go until you have to do something.
[21:33:47] <seldon> You should be able to use whichever you like better, I think. Both should be able to wake the chip from sleep.
[21:34:01] <beaky> right
[21:34:02] <seldon> Although...hold on.
[21:34:15] <seldon> Do you have the datasheet open?
[21:34:17] <beaky> watchdog can wake from deep sleep, so maybe i will use that one
[21:34:23] <beaky> yes :D
[21:34:51] <seldon> Page 39.
[21:35:02] <seldon> Yes, watchdog can wake from power-down, so that's probably what you want.
[21:35:18] <seldon> Scale it down to wake up every 8 seconds, then count to 75.
[21:35:58] <beaky> I love watchdogs
[21:40:26] <carabia> That youngster... One day when he'll figure out girls, he'll go "I love girls". Then it's just downhill from there
[21:40:33] <carabia> suddenly watchdogs aren't that interesting
[21:42:43] <seldon> Perhaps. On the other hand, watchdogs are figured out much more easily.
[21:43:27] <carabia> this is true
[21:46:07] <seldon> What would you say if someone asked you why int Array [1920][1080][960] [2] [2] [2] [2] [2] [2] is too large?
[21:47:06] <w|zzy> holy crap.
[21:47:23] <w|zzy> Get him to multiply it all out and multiply it by the size of an int
[21:48:18] <w|zzy> is that 128MB?
[21:48:23] <w|zzy> roughly
[21:48:33] <seldon> That is ~474.6 GiB.
[21:48:44] <seldon> Assuming sizeof(int) == 4. It's not on AVR, thankfully.
[21:48:47] <w|zzy> ouch.
[21:49:01] <w|zzy> I must have missed something when i quickly calculated.
[21:49:09] <seldon> Although I suppose you could bit-bang an SSD or something. Can you bitbang SSDs?
[21:49:11] <w|zzy> I also did sizeof(int) == 1
[21:49:23] <w|zzy> Who knows...
[21:50:18] <carabia> you can bit bang everything!
[21:50:49] <carabia> anyway you could build your own controller frontending a bunch of flash chips and make your custom bit banging interface
[21:51:18] <seldon> That would work. I suspect it's somewhat more pricey than the person expects, though.
[21:51:34] <carabia> does this have something to do with um
[21:51:39] <carabia> controlling a screen or something?
[21:52:06] <seldon> Don't know. It's from a forum I frequent; he said "don't ask what this is about," which is why I didn't bother to actually answer.
[21:55:10] <seldon> I suspect video. It looks like he's storing a lot of fullhd bitmaps, which is almost certainly a silly way of going about whatever he's going about.
[22:08:11] <carabia> yup was thinking
[22:21:43] <Amadiro> seldon, most SSDs will probably speak only something like eSATA or so that you cannot bitbang.
[22:23:37] <Casper> not esata, esata isn't a protocol, it's more a... plug
[22:24:10] <Amadiro> Right.
[22:24:26] <Casper> esata is exactly sata, but with a different plug... basically the connector is longer, the pin deeper inside, and the ground pin closer to the edge... in an attempt to help against ESD
[22:24:34] <Amadiro> In any case, they'll likely speak some sort of highspeed protocol that has only a bunch of differential lines
[22:24:46] <beaky> hello
[22:24:53] <beaky> how do i find out what is taking so much memory in my avr program memory
[22:24:54] <Amadiro> with no clock line that you could control, and minimum requirements for transmit and receive speeds
[22:24:56] <seldon> So he'll have to use a hundred SD cards or so.
[22:25:14] <Amadiro> seldon, well, if he can get a chip with a usb host controller, I guess he can use USB drives.
[22:26:49] <seldon> It's not for AVR, I believe. That would be even sillier.
[23:38:08] <Sinjarek> hey guys does anyone know how to download a hex file from an arduino?
[23:38:22] <Sinjarek> without extra hardware
[23:45:18] <Tom_itx> avrdude
[23:45:59] <Sinjarek> how though?
[23:46:14] <Sinjarek> do you know the proper command with the options?