#avr | Logs for 2016-06-17

Back
[00:25:52] <phinxy> this ds3231 RTC module is low power but is it safe to assume its good to not talk with it trough I2C too often?
[00:26:21] <phinxy> because I2C takes power..?
[00:26:29] <phinxy> there is no sleep mode afaik
[00:27:37] <Casper> depend on how much power you want to save
[02:02:09] <evil_dan2wik> Do I need the oscillator connected to program through spi?
[02:02:29] <evil_dan2wik> Current fuze bit is set to an external oscillator
[02:54:07] <rue_shop3> depends if the clock source was screwed up
[02:54:19] <rue_shop3> if its set to external, then yes, you do
[02:54:43] <rue_shop3> toms programmers have a pin that outputs a clock signal so you can recover avrs in that situation
[02:55:13] <rue_shop3> but you bought a nice cheap ASP from ebay didn't you?
[02:56:04] <rue_shop3> it wont program a tiny10 for ya...
[03:03:47] <FrankD> anyone here interested in working on any collaborative projects? (ill happily work on yours first)
[03:05:01] <rue_shop3> you do me and I'll do you?
[03:05:55] <rue_shop3> want to work on foundation stuff for a 12' biped omnimech?
[03:06:22] <rue_shop3> you show me your project and I'll show you mine.
[03:06:25] <FrankD> haha yeah, but i dont know if AVRs are the way to go for that :p
[03:06:36] <rue_shop3> io controllers
[03:06:52] <rue_shop3> airmuscle servos
[03:07:07] <rue_shop3> I have a hx711 infornt of me that I need to get code working for
[03:07:17] <rue_shop3> there are examples, just needs to be converted
[03:07:42] <rue_shop3> the hx711 is the adc for reading the pressure sensors for the muscles to determine the pressure balance
[03:08:17] <FrankD> SAR or Sigma-Delta?
[03:08:31] <rue_shop3> https://www.youtube.com/watch?v=A-WgzH-UZgM
[03:08:36] <rue_shop3> I think that is the right video
[03:09:20] <rue_shop3> dosn't matter, its got the built in diff amp
[03:09:34] <FrankD> well SAR tends to sample much quicker than Sigma-Delta
[03:09:50] <rue_shop3> dosn't matter, its just a screwie serial interface
[03:09:56] <rue_shop3> and the boards are really cheap
[03:10:29] <rue_shop3> the hx711 has two channels, so I only need one per muscle
[03:10:39] <FrankD> ah you have a breakout board with some support circuitry on it?
[03:10:46] <rue_shop3> the resolutions are screwball, but whatever
[03:10:56] <rue_shop3> FrankD, yea, china, the baords are cheap
[03:11:24] <rue_shop3> http://www.ebay.com/itm/2PCS-Weighing-Sensor-AD-Module-Dual-channel-24-bit-A-D-Conversion-HX711-Shieding-/381374894963
[03:11:28] <FrankD> ive been using LTC2439/LTC2418 myself.. usually with TL072 as high impedance input buffers
[03:11:40] <rue_shop3> differential
[03:11:45] <rue_shop3> evil,
[03:12:32] <FrankD> they can do differential 8 channel or 16 single ended
[03:12:47] <rue_shop3> are they less than $2 ea with 24 bits?
[03:15:33] <rue_shop3> 10 of those boards cost me less than $6
[03:15:34] <FrankD> eh more like $9/ea, but they are 16 SE/8 diff channels
[03:15:40] <FrankD> :D
[03:15:52] <rue_shop3> well the mecha has 94 actuators and a $200 budget
[03:16:20] <rue_shop3> or 47, I get the numbers mixed up
[03:16:46] <rue_shop3> I have single acting servo control working,
[03:17:05] <rue_shop3> to get doubleacting I need to know the muscle pressures
[03:17:15] <rue_shop3> the rest of the math is worked out
[03:17:54] <FrankD> so whats your issue with reading the inputs/
[03:17:55] <rue_shop3> another project is to write code to make a tiny26 into a 11 channel low-latency adc
[03:18:23] <rue_shop3> cause the tiny26 is THE cheapest /channel ADC
[03:19:03] <rue_shop3> low latency streaming adc
[03:19:43] <rue_shop3> the serial on the 711 is screwie, I need to convert the code to run on ... hmm, mega32 is a good start
[03:20:06] <FrankD> its only 2 pins for you to bit-bang
[03:20:25] <rue_shop3> yea, there is already example code, iirc its from the datasheet
[03:21:06] <FrankD> its all in the timing diagram in the datasheet
[03:21:06] <rue_shop3> its a minor task I was going to do it today, but the town is threatening to sieze my mothers home, so I been working on other things
[03:21:29] <rue_shop3> I'v just soldered a force sensor to one, channel A
[03:21:47] <rue_shop3> need to make up a cable...
[03:22:02] <FrankD> but it doesnt clock data out fast
[03:22:10] <FrankD> so youre going to have to put some NOPs in
[03:22:28] <FrankD> at >10MHz
[03:23:37] <rue_shop3> is clock more of a brown or white signal?
[03:23:47] <rue_shop3> hmmm
[03:24:13] <rue_shop3> these are questions that keep me up at night
[03:24:52] <FrankD> lol
[03:26:31] <rue_shop3> damn its 1am
[05:25:49] <skz81> <l9> do i need too get an bench power supply? >> Not done it yet, but I plan to recycle a PC tower power supply into a lab one. Most deliver 12V and 5V, and with a bit of voltage regulation.... :)
[05:26:49] <skz81> Power supply are, AFAIK and generally speaking, often size to last way longer than the powered device
[05:27:50] <skz81> For instance, the set-to-box i work on has a lifetime period of 100.000h and its power supply, 1.000.000h :p
[06:00:17] <Lambda_Aurigae> skz81, all depends on what you want and/or need for power on your bench.
[06:00:35] <Lambda_Aurigae> most of the time I get away with a 7805 based regulator circuit and a few batteries.
[06:01:06] <Lambda_Aurigae> and a good atx supply should give you +12, -12, 5, and 3.3
[06:04:05] <skz81> yes, I agree. Was just to point out this alternative, the base material being commonly available for cheap or even free... And it's a kind of "DIY" solution (if you had some monitoring/regulation). And I like DIY :p
[06:04:26] <skz81> s/had/add/
[06:04:52] <Lambda_Aurigae> well, a decent atx power supply regulates ok.
[06:06:51] <Lambda_Aurigae> biggest thing to watch out for is noise.
[06:10:40] <skz81> By "regulating" I meant "transforming" the voltage, to provide let's say 8.4V to a specific circuit... AFAIK atx doesn't feature this... Only some standard voltage like 12, 5 (and yeah, 3.3, thanks for pointing it out)
[06:11:10] <skz81> But 5V and 3.3 are the most often used, so :)
[06:11:20] <Lambda_Aurigae> by regulating, I mean keep the voltage output stable under varied current draws.
[06:11:32] <Lambda_Aurigae> you mean variable voltage output with regulation.
[06:11:39] <skz81> yes exactly
[06:12:02] <Lambda_Aurigae> it is possible to modify an atx supply for variable voltage.
[06:12:19] <Lambda_Aurigae> you just have to trace down the circuit and figure it out.
[06:13:33] <skz81> Okay. I'll try it one day. But I have other stuff to do right now. So far, my variable voltage wall wart was enought or my needs.
[06:14:00] <Lambda_Aurigae> I have a small atx supply that I might put a variable regulator on, attached to the 12V output.
[06:14:29] <Lambda_Aurigae> so I can get 1V to 9V output
[06:17:57] <liwakura> i also considered using an ATX power supply for that
[06:18:17] <liwakura> since there are usually huge amounts of leftovers at IT departments
[06:27:17] <LeoNerd> I don't think ATX supplies in general are happy down to no-load
[06:27:37] <LeoNerd> Especially not no-load on all but one output
[06:27:46] <Lambda_Aurigae> nope, they aren't
[06:27:53] <Lambda_Aurigae> that's why you put a load resistor on the 12V
[06:28:53] <Lambda_Aurigae> http://dangerousprototypes.com/blog/2012/06/28/new-prototype-atx-breakout-board/
[06:29:59] <Lambda_Aurigae> oops..on 5V
[07:23:26] <liwakura> i think "to get some load onto my power supply" is a great excuse for some impressive LED toys
[07:49:21] <evil_dan2wik> Can I change the fuse bits on a atmega328p without it being connected to the external oscillator?
[07:49:45] <LeoNerd> "depends"
[07:50:06] <LeoNerd> You need the CPU clock to be running in order to operate ISP, including fuse control
[07:50:22] <evil_dan2wik> Ok.
[07:50:22] <LeoNerd> Default fuse settings when shipped from Atmel are to use the internal oscillator anyway
[07:51:10] <evil_dan2wik> The supplier I got these from had them programmed to use an oscillator that I can't replicate
[07:51:15] <LeoNerd> So it depends what those fuse settings are, as to whether you can do that over ISP without the osc.
[07:51:40] <LeoNerd> If it's set to use a crystal, put a crystal on it. Or attach a siggen of about the right frequency to the XTALIN pin anyway and ignore it :)
[07:51:47] <LeoNerd> Or give up on the lot and use HVPP if you have one
[07:52:04] <LeoNerd> HVPP will always work, because it supplies its own clock independent of the CKcpu
[07:52:13] <evil_dan2wik> I don't have a HVPP and I don't know the current settings
[07:52:28] <LeoNerd> Then you sound like you're a little stuck
[07:52:42] <evil_dan2wik> Could I generate a useable clock signal from another atmega?
[07:53:14] <LeoNerd> Yup
[07:53:42] <evil_dan2wik> Would I just turn a pin on and off rapidly?
[07:53:59] <evil_dan2wik> or do I use something else?
[07:54:14] <LeoNerd> Yes but it'll have to be sufficiently fast. You probably want to use either the CKOUT pin, or have a PWM pin outputting the fastest possible rate
[07:54:39] <evil_dan2wik> ok
[07:54:46] <LeoNerd> all prescalers set to 1, OCnx set to 1 in CTC mode
[07:54:47] <LeoNerd> Then you'll get fCPU/2 on the appropriate pin
[07:55:10] <evil_dan2wik> ok
[08:11:06] <evil_dan2wik> Thanks, it is working, I had to set it to clk/32 for it to be stable
[08:11:38] <evil_dan2wik> I am just setting to to internal oscillator for now
[11:29:09] <_ami_> how do we calculate how much asm volatile("nop") gonna waste time?
[11:29:17] <_ami_> say for 1Mhz MCU
[11:32:30] <_ami_> nevermind, got it
[11:35:43] <skz81> _ami_, i bet... about 1 cycle :)
[11:36:54] <_ami_> so for 1MHz, if i want 500 ns, i just need to call asm("nop") 1 time only ( T * C = 10^-6 * 1 = 1 us = 1000 ns > 500 ns)
[11:37:09] <_ami_> for Faster MCU, more "nop" calls
[11:37:14] <_ami_> skz81: yeha
[11:39:11] <skz81> _ami_, exactly. @2Mhz, your NOP will last exactly the wanted 500ns
[11:39:31] <skz81> @4MHz, 250ns, so you need 2 NOPs
[11:39:57] <skz81> And so on (3 NOPs @ 6MHz, etc)
[11:39:58] <_ami_> yup, make sense.
[11:40:41] <_ami_> skz81: i was following this LCD article. author did pretty well to explain things. https://newbiehack.com/MicrocontrollersABeginnersGuideOurFirstLCDProgram.aspx
[11:41:23] <_ami_> Check_IF_MrLCD_isBusy(), this function does not seem to work well on real hw.
[11:41:51] <_ami_> i needed to put _delay_us(1000); atleast to print the multiple characters.
[11:42:05] <_ami_> any pointers on what went wrong?
[11:43:31] <skz81> _ami_, where did you had to add this 1 second sleep ?
[11:43:59] <skz81> where in the code i mean ?
[11:44:12] <_ami_> between each Send_A_Character()
[11:45:16] <_ami_> skz81: ^
[11:45:17] <Jartza> evening
[11:46:33] <Jartza> _ami_: some displays have "busy" flag that you can check. others don't, then you just have to adjust the wait for the display in action.
[11:47:27] <_ami_> Jartza: where to find that in DS?
[11:48:05] <Jartza> DS?
[11:48:13] <_ami_> i got RG1602A char lcd
[11:48:21] <_ami_> Jartza: Datasheet.
[11:49:59] <Jartza> if it doesn't mention anything about "busy signal", then usually there's something like "command time" or "description time" for each command you send to LCD
[11:50:08] <Jartza> which means, you need to wait that long after specific command
[11:50:33] <Jartza> usually other commands are pretty quick, except screen clearing
[11:50:39] <Jartza> in displays I have it takes 2-4ms
[11:50:47] <Jartza> and most other commands <40us
[11:51:10] <_ami_> hmm, ok
[11:52:38] <Jartza> and some seem to call it "execution time"
[11:53:37] <Jartza> https://youtu.be/hmDcT91-jac
[11:55:14] <_ami_> Jartza: nice
[12:11:22] <skz81> _ami_, sorry my boss came in the office :p
[12:11:32] <skz81> and now its week-end time !
[12:11:50] <_ami_> skz81: oh, okay.
[12:11:57] <skz81> I has a look, saw nothing obvious in the page you linked
[12:12:01] <_ami_> my weekend is already started :) night here.
[12:12:03] <skz81> had*
[12:13:24] <skz81> _ami_, so good week-end to you. I'll try to reconnect from home, but unsure
[12:13:29] <skz81> ++
[12:26:01] <_ami_> Jartza: hv you started working on that audio bootloader thing? :)
[12:26:50] <Jartza> the generic, nope
[12:27:00] <Jartza> my electronic namebadge does have it though
[12:27:07] <Jartza> it has audio-updateable firmware :)
[12:28:56] <_ami_> nice
[12:29:09] <_ami_> did you put it public?
[12:29:13] <_ami_> github?
[13:10:01] <superware> isn't this "too" cheap? any experience? http://www.dx.com/en/p/sim800l-quad-band-network-gprs-gsm-breakout-module-3g-3dbi-pcb-antenna-with-ipex-interface-406905