
#define MAX_LINES          3
#define MAXCHARS_ON_LINE   10
#define CHAR_MASK          0xBF

#define high 1          //sets logic value of true
#define low  0          //sets logic value of false

sbit clear = P3^0;      //sets port bit for functino control
sbit write = P3^1;      //sets port bit for functino control

#define uint unsigned int
#define uchar unsigned char

void msec(uint x) //  Time delay variable passed function to control time each word
    {
    uchar j;
    while (x-->0)
        {for(j=0;j<125;j++);
        }
    }


void code clear_display() // Active low used to clear the display for startup and next phrase
    {
    clear=high;
    clear=low;
    clear=high;
    }

void code write_enable() // Active low used to enable write sequence to the 7243 for each char
    {
    write=high;
    write=low;
    write=high;
    }

void code word_delay()
    {
    msec(3500); // USER DELAY ADJUSTMENT => approximately a 5 second delay, moving value higher increase time delay
    }

unsigned char code phrases[] =  // Enter phrases here

  {
  "ABC"                    // phrase  1 <<<<< NEEDS PADDING OR JUNK SHOWS UP ON DISPLAY
  "DEF......."             // phrase  2 <<<<< WORKS FINE, I guess just have DP on display
  "XYZ......."             // phrase  3               
  };
void put_phrase( unsigned char line_no )
{
   unsigned char x;
                             
   for ( x = 0; x < MAXCHARS_ON_LINE; x++ ) // Parse the data array for 10 array elements
    {
      P0 = phrases[ x + line_no * MAXCHARS_ON_LINE ] & CHAR_MASK;
                             // Must strobe the write pin on the rising edge
                             // to latch char into memory position
                             // for each char in array
      write_enable();
   }
   
}

void main( void )            // Main program
{
                             
   clear_display();

   for(;;)                   // Loop this process forever
   {
      unsigned char line_no;
      for ( line_no = 0; line_no < MAX_LINES; line_no++ )
      
       {         
         put_phrase( line_no );
         word_delay();
         clear_display();
         
      }
   }

}

