Random outcome on multiple devices


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170


    Did you find this post helpful? Yes | No

    Default Re: Random outcome on multiple devices

    (Never done this)

    What about reading a resistor on analog pin? A high value, maybe 100K, would that produce a reasonably wide range of seeds?

    Robert

    Edit: since no 2 resistors are exactly alike, the voltage should vary.
    Last edited by Demon; - 15th October 2013 at 19:55.

  2. #2
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Random outcome on multiple devices

    It sounds like it would work.
    That would be the first thing I'd try now, nice one.
    .. and if not, then tapping the centre of a divider (two resistors from +ve to Gnd).
    Still cheaper than timing a cap discharge.

    I can't say I've tried to make two devices produce a different result,
    just one device from one launch to the next.

    Quote Originally Posted by Demon View Post
    (Never done this)

    What about reading a resistor on analog pin? A high value, maybe 100K, would that produce a reasonably wide range of seeds?

    Robert

    Edit: since no 2 resistors are exactly alike, the voltage should vary.

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170


    Did you find this post helpful? Yes | No

    Default Re: Random outcome on multiple devices

    Even better, use a LED and 330R resistor. You're bound to get different voltages and it serves as a power indicator.

    Robert

  4. #4
    Join Date
    Jan 2011
    Location
    Sydney, Australia
    Posts
    172


    Did you find this post helpful? Yes | No

    Default Re: Random outcome on multiple devices

    Hi Guys,

    All great ideas - thank you.
    I have decided to program each PIC separately making subtle differences to LED flash rates and "off-time" periods to give an overall effect of randomness.
    This is a one-off project that I am doing as a labour of love for my company. As such, I just want to get in and get out as quickly as possible

    Cheers
    Barry
    VK2XBP

  5. #5
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: Random outcome on multiple devices

    Hi,
    One possible issue with using the ADC is that the 12F508 being mentioned in the first post doesn't have one....

    /Henrik.

  6. #6
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Random outcome on multiple devices

    Still in general, it sounds like something to try.
    You get 14 bit ADC with pic if I remember,
    should be high enough resolution to vary with resistor tolerance.

    I was keen to see how it panned out without doing it myself

  7. #7
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: Random outcome on multiple devices

    As long as we stick to 8-bit PICs (which is what PBP supports) there's a quite a selection devices with 12bit ADC and two devices with 16bit ADC (18F8xJ72). All of them are enhanced 16F1xxx or 18F parts though, the smallest I could find thru a quick look is 28pin.

    /Henrik.

  8. #8
    Join Date
    Jan 2011
    Location
    Sydney, Australia
    Posts
    172


    Did you find this post helpful? Yes | No

    Default Re: Random outcome on multiple devices

    Hi All,

    So much has happened in the last week or so...
    In typical fashion, the customer (my company on this occasion) has requested "additional functions" to be included which are above and beyond the original scope of work. The degree of modification has required a complete re-design.
    I won't bore you with the trivial details but the system now requires three separate LED flash sequences AND an auto function to scroll through the three stand-alone sequences.
    No - problems, just more time and code...

    I have now moved to a PIC16F1503. I would still like to use some sort of random number generation routine to achieve a random display flash rate between the thirty two individual PIC's without having to separately programming them. I could take the easy way out and do it manually but I like the idea of coming up with something eloquent

    Here is my thought:
    I can use my MeLabs programmer to generate a unique serial number for each PIC that I program. I understand this is a straight forward process. I would like to my program to read this unique serial number and use it as the seed for the random number generation source.

    Here is my question:
    Can is this concept be taken to a reality or am I barking up the wrong tree?

    Comments and suggestions greatly appreciated.

    Cheers
    Barry
    VK2XBP

Similar Threads

  1. Programming multiple pics with multiple programs
    By Luckyborg in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 3rd April 2013, 17:47
  2. Multiple I2c Devices
    By alphaengr in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th January 2012, 04:37
  3. Multiple serial devices to one pic
    By rshaver in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th October 2011, 15:34
  4. 12F683 ADcin = binary outcome!
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 5th March 2010, 04:42
  5. Self update of devices
    By Ioannis in forum General
    Replies: 17
    Last Post: - 24th December 2009, 17:49

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts