• AVR Freaks

Hot!True Random Number in Range For a PIC24 Chip ??

Page: 12 > Showing page 1 of 2
Author
Abraxas
Super Member
  • Total Posts : 370
  • Reward points : 0
  • Joined: 2009/08/27 17:21:14
  • Location: 0
  • Status: offline
2020/06/28 08:27:02 (permalink)
0

True Random Number in Range For a PIC24 Chip ??

I'm doing some optical grinding work and I need a true random number to drive a stepper motor for true random movements. I saw some archived post on one of the forums but the suggestions were a bit vague. Someone said there are chips that can generate these true randoms but didn't say which. I'm hoping one of the DIP packaged 24's can do this ?
 
Thanks gang !!
#1

30 Replies Related Threads

    WeHongKongers
    Super Member
    • Total Posts : 227
    • Reward points : 0
    • Status: offline
    Re: True Random Number in Range For a PIC24 Chip ?? 2020/06/28 10:47:51 (permalink)
    4 (1)
    PIC24FJ128GA204
    PIC24FJ128GA202
     
    #2
    GoEk
    Senior Member
    • Total Posts : 123
    • Reward points : 0
    • Joined: 2012/09/27 00:32:28
    • Location: Sweden
    • Status: offline
    Re: True Random Number in Range For a PIC24 Chip ?? 2020/06/28 11:03:18 (permalink)
    0
    White noise on an A/D input?
    #3
    GlennP
    Super Member
    • Total Posts : 759
    • Reward points : 0
    • Joined: 2009/03/29 15:04:55
    • Location: El Paso County, CO, USA
    • Status: offline
    Re: True Random Number in Range For a PIC24 Chip ?? 2020/06/28 11:12:32 (permalink)
    4 (1)
    "Anyone who attempts to generate random numbers by deterministic means is, of course, living in a state of sin." ~ John von Neumann
     
    It just can't be done digitally.
     
    There are web services that claim to generate truly random numbers.  Try Random.org - the claimed source is atmospheric noise.
     
    But do you really need "True Random Number"?
    post edited by GlennP - 2020/06/28 11:13:48
    #4
    dan1138
    Super Member
    • Total Posts : 3633
    • Reward points : 0
    • Joined: 2007/02/21 23:04:16
    • Location: 0
    • Status: offline
    Re: True Random Number in Range For a PIC24 Chip ?? 2020/06/28 11:37:06 (permalink)
    0
    glennp17321
    "Anyone who attempts to generate random numbers by deterministic means is, of course, living in a state of sin." ~ John von Neumann
     
    It just can't be done digitally.

     
    With respect to Johnny von Neumann the understanding of quantum mechanics and its uses was not as well developed in his day.
     
    I agree with his statement.
     
    True random numbers can only be realized by observing quantum scale events.
     
    Today there are controllers that integrate function block that can provide cryptographically secure random numbers using circuit that make observations of quantum scale events.
     
    As you say:
    glennp17321
    But do you really need "True Random Number"?

    For successful lens grinding.
     
    Would something like a Mersenne Twister be as useful?
    #5
    WeHongKongers
    Super Member
    • Total Posts : 227
    • Reward points : 0
    • Status: offline
    Re: True Random Number in Range For a PIC24 Chip ?? 2020/06/28 12:15:31 (permalink)
    2.5 (2)
    Quantum mechanical events are not very random. They have a statistical distribution.
     
    Markov Chain is random.  Catch an ant and let it crawl on your skin.  mr green: mr green
    #6
    Abraxas
    Super Member
    • Total Posts : 370
    • Reward points : 0
    • Joined: 2009/08/27 17:21:14
    • Location: 0
    • Status: offline
    Re: True Random Number in Range For a PIC24 Chip ?? 2020/06/28 13:22:29 (permalink)
    0
    Gort2015, in this thread claimed that there were some PICs capable of generating true random numbers.
    https://www.microchip.com/forums/m1002371.aspx
    #7
    ric
    Super Member
    • Total Posts : 27657
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: True Random Number in Range For a PIC24 Chip ?? 2020/06/28 13:27:32 (permalink)
    4.5 (2)
    I suspect there's some misunderstanding between what is a "true random" number, as opposed to just a "pretty good random number".
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #8
    Abraxas
    Super Member
    • Total Posts : 370
    • Reward points : 0
    • Joined: 2009/08/27 17:21:14
    • Location: 0
    • Status: offline
    Re: True Random Number in Range For a PIC24 Chip ?? 2020/06/28 13:37:46 (permalink)
    0
    I'm grinding a telescope mirror and the story (or perhaps myth) is that all great telescope mirrors are finished by hand because machines cannot make random movements via their control algorithms. 
     
    So what was Gort talking about above ?
    #9
    GlennP
    Super Member
    • Total Posts : 759
    • Reward points : 0
    • Joined: 2009/03/29 15:04:55
    • Location: El Paso County, CO, USA
    • Status: offline
    Re: True Random Number in Range For a PIC24 Chip ?? 2020/06/28 13:48:42 (permalink)
    0
    Abraxas ...
    So what was Gort talking about above ?

     
    You'd have to get Gort's take on that, but I suspect he was referring to the function in the crypto engine where MCHP claims to generate a random number.  I read the datasheet referred to above and I didn't find a good explanation of how the number was generated.
     
    GP
    #10
    marcov
    Super Member
    • Total Posts : 275
    • Reward points : 0
    • Joined: 2006/10/08 01:59:40
    • Location: Eindhoven, NL.
    • Status: offline
    Re: True Random Number in Range For a PIC24 Chip ?? 2020/06/28 14:07:04 (permalink)
    4 (1)
    Goran Ekstrom
    White noise on an A/D input?



    Actually the legacy MLA library uses that to get entropy to seed the random generator, e.g. for the random retry periods of its DHCP client. But it takes up to iirc 400ms to get enough entropy.
     
    Hardware entropy generators are most importantly a fast source of entropy.
    post edited by marcov - 2020/06/28 14:10:44
    #11
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3950
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: online
    Re: True Random Number in Range For a PIC24 Chip ?? 2020/06/28 15:22:33 (permalink)
    4 (1)
    Random numbers and expectation.
     
    The chip you are looking for will have this module:
    Hardware Crypto Engine, probably why you can't find it.
     
    PIC24FJ128GB204 is one such chip.
     
    I am currently using a timer.
    It fits that app.
     
     
     
     
     
     
     
     

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #12
    dan1138
    Super Member
    • Total Posts : 3633
    • Reward points : 0
    • Joined: 2007/02/21 23:04:16
    • Location: 0
    • Status: offline
    Re: True Random Number in Range For a PIC24 Chip ?? 2020/06/28 15:30:53 (permalink)
    0
    Abraxas
    I'm grinding a telescope mirror and the story (or perhaps myth) is that all great telescope mirrors are finished by hand because machines cannot make random movements via their control algorithms.



    I believe you will find that to to use random movement position selection in automated polishing equipment would require extreme resolution in the position controls. Perhaps something better than 1/4 wavelength of light. It seems that the randomness of using humans to achieve the required finish would costs less.
    #13
    Beau Schwabe
    Starting Member
    • Total Posts : 26
    • Reward points : 0
    • Joined: 2019/09/23 21:16:53
    • Location: 0
    • Status: offline
    Re: True Random Number in Range For a PIC24 Chip ?? 2020/06/28 15:31:14 (permalink)
    0
    Is there any human interaction at all? .... For example we have a kiosk that has a 16 bit counter that is allowed to count and rollover ... when a person interacts with the kiosk (i.e. press a button)  the Program grabs whatever value the 16-Bit counter happens to be on and uses that as a SEED for the pseudo random feature built into the micro for any hashing that needs to be done during that transaction.
    #14
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3950
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: online
    Re: True Random Number in Range For a PIC24 Chip ?? 2020/06/28 15:39:11 (permalink)
    0
    It is something to do with capacitor charge and discharge.
    They can never hold the same charge.
     
    It's a whole subject itself.
     
     
     
     
     
     
     
     

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #15
    dan1138
    Super Member
    • Total Posts : 3633
    • Reward points : 0
    • Joined: 2007/02/21 23:04:16
    • Location: 0
    • Status: offline
    Re: True Random Number in Range For a PIC24 Chip ?? 2020/06/28 16:30:01 (permalink)
    5 (1)
    WeHongKongers (aka, HKPhysicist)
    Quantum mechanical events are not very random. They have a statistical distribution.



    I believe you are misunderstanding what I mean by observing a quantum event.
     
    When a quantum system is observed over enough events it will have just one statistical distribution. This is called the Normal distribution. This is the behavior of a random system. Any other distribution would show the observed system is not random.
     
    When a quantum system is observed on a fine enough scale the outcome of that observation approaches random.
     
    For example the switching threshold of a silicon MOSFET transistor is dependent on the temperature, thermal motion of atoms, of that transistor.
     
    The thermal motion of an atom is a quantum event, that is its direction and velocity (vector) of that motion is fundamentally uncertain. As far as anyone knows this is a property of this universe. If you know this to not be the case you are probably not from around here. :)
     
    One possible way to observe thermal motion as a quantum event is to build two resistor-capacitor oscillator circuits. Keep each circuit in thermal, electric and magnetic isolation so the do not interact on any macro scale.
     
    Then measure the time one circuit switches until the other circuit switches.
     
    The measurement of that time is the difference in temperature between the two circuits.
     
    When the time is measure at a small scale it approaches the measurement of a quantum event.
     
    As long at the circuit are isolated enough. When they can interact with each other then the system will become either synchronized or chaotic. A chaotic system is not random but is complex enough to appear random.
    post edited by dan1138 - 2020/06/28 16:42:04
    #16
    NorthGuy
    Super Member
    • Total Posts : 6176
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: offline
    Re: True Random Number in Range For a PIC24 Chip ?? 2020/06/28 16:39:58 (permalink)
    5 (5)
    You do not need a true random number for your application. Pseudo-random numbers are easy to obtain and will meet your needs.
     
    Pseudo-random numbers are not good for cryptography, but not because they have a bad distribution, but because a malicious attacker can reproduce the whole sequence. But this is not a problem for glass polishing - who cares if someone can guess the exact trajectory your motor took to polish the glass?
    #17
    dan1138
    Super Member
    • Total Posts : 3633
    • Reward points : 0
    • Joined: 2007/02/21 23:04:16
    • Location: 0
    • Status: offline
    Re: True Random Number in Range For a PIC24 Chip ?? 2020/06/28 17:23:27 (permalink)
    5 (1)
    NorthGuy
    You do not need a true random number for your application. Pseudo-random numbers are easy to obtain and will meet your needs.

    I agree, but suspect the issue with automated polishing machines is one of insufficient degrees of motion to approximate random movement.
     
    Even if the OP can apply true random variation to the movement controls that stepper motors are used suggests that the available range of motions may be limited to discrete intervals.
    #18
    WeHongKongers
    Super Member
    • Total Posts : 227
    • Reward points : 0
    • Status: offline
    Re: True Random Number in Range For a PIC24 Chip ?? 2020/06/29 10:41:49 (permalink)
    0
    dan1138
     A chaotic system is not random but is complex enough to appear random.

    You are a paranoid if you refuse that throwing a Dice cannot get a Random natural number between 1 to 6.  LoL: LoL
    post edited by WeHongKongers - 2020/06/29 10:45:22
    #19
    WeHongKongers
    Super Member
    • Total Posts : 227
    • Reward points : 0
    • Status: offline
    Re: True Random Number in Range For a PIC24 Chip ?? 2020/06/29 10:44:50 (permalink)
    0
    Abraxas
    I'm grinding a telescope mirror and the story (or perhaps myth) is that all great telescope mirrors are finished by hand because machines cannot make random movements via their control algorithms. 
     
    So what was Gort talking about above ?




    How did they grind the Hubble Telescope's main mirror?  Did they throw 1 billion of ants on the prototype and let them polish the mirror?  LoL: LoL
    #20
    Page: 12 > Showing page 1 of 2
    Jump to:
    © 2020 APG vNext Commercial Version 4.5