Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/14/06 19:07
Read: times


 
#112156 - Pattern Generator
Responding to: ???'s previous message
Maybe one of the members can give me help with program?
It runs pseudo random generator but not very well.

I took this out of one my books on 8051 microcontrollers.
I also ran it on simulator it runs with out errors but pseudo random generator part is really bad.

89c2051 running at 4 Mhz
power at 5v source

P1.0---7 connected to leds
P3.0---7 connected to leds

program should not repeat for about 4 hours

;Mainline

org 0 ;execution starts here
loop: ;loop here forever
mov c,p3.2;get the bits to and together
cpl psw.7;invert bit 13
anl c,p3.7;and it with bit 15
mov acc.0,c ;save it for later
mov c,p3.7;now get bit 13 * ! bit 15
cpl psw.7
anl c,p3.2
orl c,acc.0;orboth values together in carry
mov a,p1;now update the 16 led display
rlc a
mov p1,a
mov a,p3
rlc a
mov p3,a
acall dlay;leave like this for 500 msec
sjmp loop;loop around again
dlay: ;delay 263 msec
clr a
mov b,#0 ;longest delay possible
dlayloop: loop here for 500 msec
djnz acc,dlay loop ;inside loop
djnz b,dlayloop
ret


This should light 16 leds in pseudo random pattern. But I run on
simulator it looks like it know where near pseudo random pattern.


Best reguards,


Ralph Sack






List of 48 messages in thread
TopicAuthorDate
LFSR The unknown            01/01/70 00:00      
   As in a Random number generator?            01/01/70 00:00      
      Fine Tune            01/01/70 00:00      
         Did you Google?            01/01/70 00:00      
            Yes I did Google            01/01/70 00:00      
               OK            01/01/70 00:00      
               The structure of an lfsr            01/01/70 00:00      
   Random numbers            01/01/70 00:00      
   Look on Keil            01/01/70 00:00      
   LFSR testbench            01/01/70 00:00      
      trouble with LFSR's            01/01/70 00:00      
         randomness            01/01/70 00:00      
         Not Random            01/01/70 00:00      
            not pseudorandom            01/01/70 00:00      
   LFSRs            01/01/70 00:00      
   Flowchart            01/01/70 00:00      
      flowchart of implementing a pRNG???            01/01/70 00:00      
         the whole issue            01/01/70 00:00      
            what is a good pRNG            01/01/70 00:00      
               a fun story about pseudorandom            01/01/70 00:00      
                  seed            01/01/70 00:00      
                     you are forghiven, it's bedtime in slova            01/01/70 00:00      
                        you are right, time to go sleep            01/01/70 00:00      
                           Code change            01/01/70 00:00      
                              Read the App Note            01/01/70 00:00      
                  Been Done            01/01/70 00:00      
                     I don't understand            01/01/70 00:00      
                        Do it....            01/01/70 00:00      
                        It's there for you to use!            01/01/70 00:00      
               the best pseudo random number generator            01/01/70 00:00      
                  pseudo?            01/01/70 00:00      
                     well..            01/01/70 00:00      
   Pattern Generator            01/01/70 00:00      
      as has been said many times            01/01/70 00:00      
      Posting Code - Make it 3            01/01/70 00:00      
      homework            01/01/70 00:00      
         NOOB            01/01/70 00:00      
            thanks Andy...            01/01/70 00:00      
               Quite so            01/01/70 00:00      
                  "hosed"            01/01/70 00:00      
                     Gone tits up, or gone Pete Tong            01/01/70 00:00      
         Not my Homework            01/01/70 00:00      
            whoever said that the ability to write e            01/01/70 00:00      
            No problemo            01/01/70 00:00      
            What does "working" mean?            01/01/70 00:00      
      Fibonacci/Galios Generator            01/01/70 00:00      
         Thank you            01/01/70 00:00      
   the hunt for pseudo not being pseudo            01/01/70 00:00      

Back to Subject List