#avr | Logs for 2014-05-02

Back
[00:00:11] <jadew> I see
[00:00:12] <Gumboot> Or half a safe prime, depending on how you define 'safe prime'.
[00:00:43] <Gumboot> You can set pretty much an arbitrary size of state buffer, and then you hunt for a prime that is that many bits long, and ends with a lot of 1-bits.
[00:01:44] <Gumboot> Fortunately the bignumber arithmetic library as part of libcrypto has a function to do the search, so it's just one function call.
[00:02:05] <Gumboot> But some results aren't very "randomy", so you need to hunt around a bit more to find a good one.
[00:03:30] <jadew> well, if you're hardcoding it, can't you just look it up in one of those online tables?
[00:04:22] <Gumboot> I don't know if there is such a table. There are a lot of types of prime; nobody can list them all.
[00:04:46] <Gumboot> Here's a table: https://github.com/sh1boot/8bitrand/blob/master/tables.c
[00:06:27] <Gumboot> Here's (wrong chip, I know) how the function works out in assembly -- but in this case each call produces only 8 bits (all bits are usable, unlike LCG): https://github.com/sh1boot/8bitrand/blob/master/8051_snippets.c
[00:06:31] <jadew> you can use this number: http://www.math.utah.edu/~pa/math/largeprime.html
[00:07:16] <Gumboot> That's a big prime.
[00:07:32] <jadew> the question is why?
[00:07:51] <jadew> are they useful for anything?
[00:08:29] <Gumboot> PRNGs?
[00:08:53] <jadew> that's a very very big period
[00:10:05] <Gumboot> I developed it because people ask on stackoverflow "what's a good random number generator for my 8-bit MCU?" and everybody says "Mersenne Twister" because it's stack overflow and they don't know that 2500 bytes is a lot of memory.
[00:11:11] <jadew> isn't there a rand() implementation in avr gcc?
[00:12:13] <Gumboot> avr-libc?
[00:12:17] <jadew> yeah
[00:13:22] <jadew> I have to go to sleep
[00:13:24] <jadew> night
[00:14:46] <Gumboot> Looks heavyweight.
[00:14:49] <Gumboot> 'night.
[02:02:04] <anton02> can you use this as a half bridge or is it just a mosfet driver? http://www.irf.com/product-info/datasheets/data/ir2011.pdf
[05:47:13] <Lambda_Aurigae> anton02, you need 2 of them...that's a half-h-bridge.
[05:48:17] <Lambda_Aurigae> oh, wait...
[05:48:30] <Lambda_Aurigae> it is a full h-bridge...
[05:48:42] <Lambda_Aurigae> the datasheet just shows using it as half with external drivers.
[05:49:46] <Lambda_Aurigae> it looks to be kind of an odd chip.
[05:50:13] <Lambda_Aurigae> not a real h-bridge..
[05:58:16] <anton02> what does the selectable current limit of this actually mean? Does it mean if your motor wants to draw more current than that it wont let it? http://www.freetronics.com/products/hbridge-dual-channel-h-bridge-motor-driver-shield#.U2NT5VfYNLQ
[05:58:44] <anton02> Lambda_Aurigae: so the h-bridge wouldnt work?
[05:59:06] <Lambda_Aurigae> dunno.
[05:59:12] <Lambda_Aurigae> it could be tried I suppose..
[05:59:49] <Lambda_Aurigae> it looks like it is a dual half-h-bridge but one side floats so I suppose you could run it at the same potential as the other.
[06:00:18] <Lambda_Aurigae> and, yes, that is what selectable current limit means.
[06:32:45] <anton02> whats the voltage drop across this at 300mA?
[06:32:52] <anton02> and 12 volts
[06:32:55] <anton02> http://www.google.com.au/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CCwQFjAA&url=http%3A%2F%2Fwww.allegromicro.com%2F~%2FMedia%2FFiles%2FDatasheets%2FA4954-Datasheet.ashx&ei=D35jU8vuLcHWkAX9uoCACw&usg=AFQjCNFS1la0pqn0YfF6kTjtWr5xejwV0g&sig2=fEgDf0j6hr2pQ26sfgv1nQ&bvm=bv.65788261,d.dGI&cad=rja
[07:13:11] <AllinYourhead> do i need to be cautious with interfacing eeprom shortly after startup? I'm attempting to read a config from there the first thing i do after powerup but the device sometimes gets stuck and i suspect the eeprom since it doesn't even turn on the LED's which is done in the pin-init after the eeprom
[08:57:58] <rue_more> maybe your ints not firing?
[08:58:42] <AllinYourhead> hi rue. are you refering to my eeprom issue?
[08:58:49] <rue_more> yea
[09:00:39] <AllinYourhead> i'm using the eeprom_update_byte() avr function. does it use interrupts?
[09:03:47] <AllinYourhead> Applications that require interrupt-controlled
[09:03:47] <AllinYourhead> EEPROM access to ensure that no time will be wasted in spinloops
[09:03:47] <AllinYourhead> will have to deploy their own implementation.
[09:03:59] <AllinYourhead> from header docs so no interrupts in those functions
[09:07:15] <rue_more> " i suspect the eeprom since it doesn't even turn on the LED's which is done in the pin-init after the eeprom"
[09:09:50] <AllinYourhead> ye but can the eeprom be corrupted by unstable startup voltage?
[09:22:00] <megal0maniac_afk> More of a programming question than anything else, but if I want an array to be defined globally but I only get the array size in the constructor, how do I do that?
[09:36:12] <rue_more> how long does the power take to come up?
[09:36:37] <rue_more> megal0maniac_afk, make a struct that can hold the array and the size of it
[09:36:38] <rue_more> :)
[09:37:20] <AllinYourhead> not sure, but the crashes seems quite erratic
[09:40:57] <megal0maniac_afk> rue_more: I fail to see how that would help
[12:04:04] <allgood38> Buying power cables for small robotics applications, I'm looking at digikey, and they are really expensive, anyone have experience buying multi-conductor wire?
[12:11:28] <Casper> my cousin said: unless you have something that move all day long, standard wire will do the trick
[12:11:37] <Casper> ... he repair cnc
[12:17:11] <anton02> what does it mean if a DC motor has yellow plastic
[12:27:49] <Casper> anton02: it mean they used yellow plastic
[12:33:40] <megal0maniac_afk> anton02: They were probably out of blue
[12:34:06] <megal0maniac_afk> (You're going to have to put more effort into your questions if you want anyone to bother answering)
[12:37:28] <anton02> nah you guys answered fine
[12:45:45] * Casper puts duct tape on anton02's motor
[13:06:40] <antto> Casper y u so mean
[13:38:04] <Casper> antto: if I wanted to be mean, I'ld encast his motor in plastic, or coat the terminal with high temp varnish :D
[13:38:50] <antto> ;P~
[13:43:24] <Casper> friendy plastic is fun, but do not tolerate much heat
[13:43:46] <Casper> it's like hot glue, but with hard plastic instead of that soft one
[14:26:24] <LoRez> all JTAG interfaces are essentially the same right?
[14:32:07] <OndraSter> interfaces? yes
[14:32:10] <OndraSter> commands? no
[14:34:31] <ZiNC> Hey.
[15:08:58] <patrick__> hi
[15:47:33] <superware> I'm using the USI in ATtiny85 for TWI/I2C, I have a pin-change interrupt which is really time-critical, does it make sense to define ISR(USI_START_vect, ISR_NOBLOCK) and ISR(USI_OVF_vect, ISR_NOBLOCK) so that TWI communication doesn't interfere with the PC interrupt? (nested interrupts)
[15:51:09] <ZiNC> Are the 400+ pg manuals on the various chips the "complete" reference?
[16:02:10] <superware> anyone?
[16:09:01] <Fleck> tzanger: hey, I just saw a link you gave me, about op-amps... in 2014.03.28 :D
[19:22:25] <myself> "It was kinda weird to find two bad chips, two chips with verify errors, different chips from different batches on different devices in different packages, after having literally gone my entire life without having a verify error."
[19:22:36] <myself> "yeah, that's sorta.. was there like, a gamma ray burst or something?"
[19:22:49] <myself> "Right! A very directional one! Fuck this AVR in particular!"
[19:22:57] <myself> -- conversation in the i3detroit electronics lab just now
[19:23:26] <vsync_> "can we have more quotation marks" "pls"
[19:23:32] <vsync_> "--" "me"
[19:32:30] <N2TOH> myself, there was a batch of counterfit chips, and I have found that if the programer speed is off it can cause verify errors
[19:33:22] <N2TOH> IE if the ISP programer is too fast or too slow based on the AVR clock speed you can get failures to verify the flash memory
[19:51:02] <myself> N2TOH: on the counterfeits only, or is the clock super critical even on authentic ones?
[19:51:52] <N2TOH> one the real ones, the fakes are just that and do not work at all
[19:51:58] <N2TOH> one*
[19:52:04] <N2TOH> on*
[19:52:29] <Tom_itx> the clock needs to be 4x the spi rate
[19:52:33] <Tom_itx> simple as that
[19:52:57] <N2TOH> or slower
[19:53:03] <Tom_itx> or faster
[19:53:13] <Tom_itx> slower and you will get errors
[19:53:29] <N2TOH> 6 of on half dozen of the other...
[19:53:39] <N2TOH> keep adjusting it till the erros stop
[19:53:50] <Tom_itx> no, it's a documented fact
[19:54:04] * N2TOH was making a funny
[19:54:07] <Tom_itx> system clock 4x faster than the SPI programming rate
[19:54:41] <myself> yeah, no, this was "this exact avrdude commandline, with this particular chip, fails verification at byte offset 0x1234, but swap in this other chip into the socket, and it programs fine". Clock rate the same between tries.
[19:55:05] <Tom_itx> so throw the chip away
[19:57:41] <N2TOH> the chip could be marginal if the programmer speed is on the cusp of being too fast or too slow
[19:58:17] <N2TOH> what speed is the AVR closck?
[19:58:22] <N2TOH> clock*