EmbeddedRelated.com
Forums
Memfault Beyond the Launch

HCS12 - RNG generation

Started by "Dur...@gmail.com [68HC12]" November 29, 2016
I am trying to build Slot machine through HCS12 board without using any
external components. I want to create a prototype of slot machine for that
I need to have a working RNG code (may be in C language). give me the idea
of where and how to start?

Thank you!
I am not familiar with any RNG code.

Dave Perreault

On Tue, Nov 29, 2016 at 2:39 PM, Durga Prasad k...@gmail.com
[68HC12] <6...> wrote:

> I am trying to build Slot machine through HCS12 board without using any
> external components. I want to create a prototype of slot machine for that
> I need to have a working RNG code (may be in C language). give me the idea
> of where and how to start?
>
> Thank you!
>
Put a diode noise generator on one of the ADC channels, then read it as a random number. If you google "diode noise generator circuit" you will see it is pretty easy.
Since it is a slot machine, how about:

- At power up, create some free running counter that will count with high frequency

- When the Slot machine handle is pulled or button is pressed, read the counter value

From: 6... [mailto:6...]
Sent: Tuesday, November 29, 2016 8:40 PM
To: 6...
Subject: [68HC12] HCS12 - RNG generation

I am trying to build Slot machine through HCS12 board without using any external components. I want to create a prototype of slot machine for that I need to have a working RNG code (may be in C language). give me the idea of where and how to start?

Thank you!
Use google and look for pseudo random number generators. It is typically just some multiplies, adds, and modulos with prime numbers.

Use an ARM processor that has a true random number generator device.

Build an external RNG device.
Andrei from The Great White North
(as seen on the embedded.fm podcast and blog)
I am actually thinking about to compare the generated random numbers and
send the result to LCD screen is that possible?
The original question was how to solve the project problem “using HCS12 board without using any external components”.



So the answer to this must be “yes if the LCD is on the board and correctly connected” J





From: 6... [mailto:6...]
Sent: Wednesday, November 30, 2016 7:42 PM
To: 6...
Subject: RE: [68HC12] HCS12 - RNG generation


I am actually thinking about to compare the generated random numbers and send the result to LCD screen is that possible?
[Non-text portions of this message have been removed]


Posted by:



The HCS12 board comes itself with LCD screen so That won't be an external component right! and is there any specific commands to integrate RNG to LCD screen?
>
> The HCS12 board comes itself with LCD screen so That won't be an external component right! and is there any specific commands to integrate RNG to LCD screen?
>

You’re kidding, right? Are you just starting your final project with about a week to go in your class?
Seems reasonable (and typical of the students I had!) for a project that involves only programming (hardware is just HCS12 board).
> On Nov 30, 2016, at 12:45 PM, 'Mr. Andrei Chichak' g...@chichak.ca [68HC12] <6...> wrote:
>>
>> The HCS12 board comes itself with LCD screen so That won't be an external component right! and is there any specific commands to integrate RNG to LCD screen?
>> You’re kidding, right? Are you just starting your final project with about a week to go in your class?

Memfault Beyond the Launch