piclist 1995\11\15\064422a >
Thread: MPSIM and Anyone have Stimulus Generators?
picon face BY : Scott Stephens email (remove spam text)

>I get strange cautions about reading an address that it says has never been
written to,
>but it certainly has. Any else seen this?

Yes, but I usualy have so many other hassles that ignoring that one hasn't
hurt (yet)

>There's another error too, but I can't recall it at the moment.

Only ONE other?!?

Anyone have Stimulus generator tools? What follows is what I use for
generating RS-232.

int bit_time=830, x=0, y=1, j=0, k=0;
unsigned long int i, n, m=1, stoptime=1000000, step=62500, start_time=10000;
unsigned char s[] = "0123TEST456789";
unsigned char b1, b2;

printf ("STEP\t\tRB0\tRB4\n");

for (i=0;i<stoptime;i+=10) {            /* Generate clock or time increments */

       if (i==n) {                     /* generate clock edge every 'step' */
               n+=step;                /* increments till 'stoptime'. 'step' */
               if (b1==0) b1=1;        /* must be multiple of i */
               else b1=0;              /* If time for new clock edge, toggle 'b
1' */
               j=1;                    /* and set 'J' to signal print function
       else j=0;

       if (i==m) {                     /* Generate RS-232 pulses */
               m+=bit_time;            /* inc bit timer */
               k=1;                    /* signal print funtion */
               switch(y++) {
               case 1: b2=1;
               case 2: b2=s[x]&1;
               case 3: b2=s[x]&2;
               case 4: b2=s[x]&4;
               case 5: b2=s[x]&8;
               case 6: b2=s[x]&16;
               case 7: b2=s[x]&32;
               case 8: b2=s[x]&64;
               case 9: b2=s[x]&128;
               case 10:b2=0;   /* If y=10 (stop bit), set data 'b2' */
                       x++;    /* variable to 0, increment char. array */
                       y=1;    /* pointer x, and reset bit pointer y */
       else k=0;
       if (b2!=0) b2=1;
       if (j||k) printf ("%ld\t\t%d\t%d\n",i,b1,b2); /* print bits */

See also: www.piclist.com/techref/index.htm?key=mpsim+anyone+stimulus
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) MPSIM and Anyone have Stimulus Generators?

month overview.

new search...