Rules | Recent posts | topic RSS | Search | Register  | Log in

DIY Moving Message Display
Goto page Previous  1, 2, 3, ... 16, 17, 18  Next
Jump to page:

 
Post new topic  Reply to topic    EDAboard.com Forum Index -> Microcontrollers
Author Message
glenjoy



Joined: 01 Jan 2004
Posts: 1021
Helped: 47
Location: Philippines


Post03 Jan 2004 3:37   Re: building your own moving message complete guide

Questions:

1. How many 5x7 can it support?
2. Can the scroll be controleld?
a. Can it be paused.
b. Can it Scroll from top to bottom or vice versa?
3. Can the FONT be controlled?

Thanks.
Back to top
rojo



Joined: 03 Jan 2004
Posts: 17


Post03 Jan 2004 7:06   Re: building your own moving message complete guide

glenjoy wrote:
Questions:

1. How many 5x7 can it support?
2. Can the scroll be controleld?
a. Can it be paused.
b. Can it Scroll from top to bottom or vice versa?
3. Can the FONT be controlled?

Thanks.


hello Smile)

answers:
1. at the moment ,as I said before, the prototype works with 4 characters
i.e. there are currently 23 columns on the prototype,
it can be very easily extended to any number of columns/5x7s,
the only thing that would have to be changed then is the number of columns in the software e.g. via #define directive in C , or maybe I could add a
menu option for changing numbers of columns dynamically via PC keyboard , like
some sort of a configuration mode , theres plenty of room for experimenting Smile))

2. at the moment, scrolling is happening from right to the left only, its a first version, the speed of the
scroll is controlled via #defines (software needs to be recompiled each time i change the speed ) but I can easily add few software functions so
its controlled via PC keyboard and speed /delay can be stored dynamically in the onboard EEPROM

a. not at the moment, but can be done (just need to change few lines of code).

b. see answer 2 Smile) also easily done

3. font definitions are stored together with the code in an array in the
FLASH ROM, i guess i can add few new fonts , ive got around 2 KB left in
the ROM for that, font takes up about 600 bytes, so again , easily done.
(it would take even less without special characters, at the moment all
the charachters on a PC keyboard are supported)

this is the first rough version, If u dudes are interested I can post schematics and the code and then we can work on it from there, it is
pretty good as it is but as i said theres lots of room for experimeting and
improvements.
Back to top
glenjoy



Joined: 01 Jan 2004
Posts: 1021
Helped: 47
Location: Philippines


Post03 Jan 2004 7:29   Re: building your own moving message complete guide

WOE has also a scrolling LED Display, I removed some codes in the software so that will not be confusing in using the software with stand alone micros.

I used DS89C420 with it and worked fine. But scrolling is from right to left only and can't pause/stop the display at the center.

Can someone give an idea how to pause it or scroll from top to bottom or vice versa?

Here are the softwares anyway if you don't want to visit the site.



Sorry, but you need login in to view this attachment

Back to top
rojo



Joined: 03 Jan 2004
Posts: 17


Post03 Jan 2004 8:46   Re: building your own moving message complete guide

its in assembly with german comments Smile)
no wonder you want somebody else to figure it out for you Smile)

here is my code, all i do to scroll a message is load an array
with character definitions (5 columns for each char. + 1 emtpy column
for space between chars.) and then i move the dataPtr pointer along the
array, to pause the message i would just have to keep the pointer
the same i.e. not change it, i guess this german dude is doing something
similar, scrolling from bottom to top or vice versa could be done the
same way, but before loading the array with character definitions you
would have to shift the whole array (individual bytes) up or down .

also my display part is exactly the same as the display in the first
post, i.e. i used the same Silicon chip article to build mine, it was
connected to PC parallel port originally then I removed the parallel
port connector and connected it directly to microcontroller (PIC and then
at90s8535 Smile), so the RC components that were used to clean up
noise coming out of parallel port could probably be removed, havent
tried it, anyway its just 10 resistors and capacitors , not very important
i guess.

and the keyboard interrupt service routine was written with the help
from Atmel dudes, it was in one of their application notes,
i cant remember the excact number of the note, i changed the code
a little bit, i.e. removed few lines of code from their source, if u want
to see the application notes it can be easily found on the Atmel web site.

my code: stuff im talkin about is in the main() function in the while(1) loop
Code:


#include <90s8535.h>
#include <delay.h>                 
                             

// led display
#define LED_RESET      PORTB.0
#define LED_CLOCK      PORTB.1
#define LED_DATA      PORTB.4   
#define SCROLL_DELAY   140  // multiple of 7 (use smaller numbers for faster scroll)

// keyboard
#define KBD_CLOCK      PORTD.2  // to be used for host -> keyboard communication
#define KBD_DATA           PIND.4                                 
#define BUFF_SIZE      64
           
// lcd
#define LCD_RS         PORTD.5
#define LCD_RW       PORTD.6
#define LCD_E        PORTD.7    
#define COMMAND_MODE    0
#define DATA_MODE       1        
#define WRITE_MODE      0
#define READ_MODE       1                                                                    
#define LCD_DATA_PORT   PORTC     
                 
// functions                 
void lcd_init(void);
void lcd_clear(void);
void lcd_putc(unsigned char);
void lcd_putsf(unsigned char flash *);
void lcd_puts(unsigned char *str);
interrupt [EXT_INT0] keyboard_isr(void);
void put_char_kbbuff(unsigned char);   
void put_scancode_kbbuff(unsigned char);
int getchar(void);                 
int kbhit(void);
void decode(unsigned char);

// global variables ***************************   
unsigned char kb_buffer[BUFF_SIZE];
unsigned char bitcount;      
unsigned char *inpt, *outpt;
unsigned char buffcnt = 0;                                                                                                                   

// led character definitions
// 5 data columns + 1 space
// for each character
flash unsigned char led_chars[94][6] = { 
0x00,0x00,0x00,0x00,0x00,0x00,   // space
0x00,0x00,0xfa,0x00,0x00,0x00,   // !   
0x00,0xe0,0x00,0xe0,0x00,0x00,   // "
0x28,0xfe,0x28,0xfe,0x28,0x00,   // #
0x24,0x54,0xfe,0x54,0x48,0x00,  // $
0xc4,0xc8,0x10,0x26,0x46,0x00,  // %
0x6c,0x92,0xaa,0x44,0x0a,0x00,  // &
0x00,0xa0,0xc0,0x00,0x00,0x00,  // '
0x00,0x38,0x44,0x82,0x00,0x00,   // (
0x00,0x82,0x44,0x38,0x00,0x00,  // )
0x28,0x10,0x7c,0x10,0x28,0x00,  // *
0x10,0x10,0x7c,0x10,0x10,0x00,  // +
0x00,0x0a,0x0c,0x00,0x00,0x00,  // ,
0x10,0x10,0x10,0x10,0x10,0x00,  // -
0x00,0x06,0x06,0x00,0x00,0x00,  // .
0x04,0x08,0x10,0x20,0x40,0x00,  // / 
0x7c,0x8a,0x92,0xa2,0x7c,0x00,  // 0
0x00,0x42,0xfe,0x02,0x00,0x00,  // 1
0x42,0x86,0x8a,0x92,0x62,0x00,  // 2
0x84,0x82,0xa2,0xd2,0x8c,0x00,   // 3
0x18,0x28,0x48,0xfe,0x08,0x00,   // 4
0xe5,0xa2,0xa2,0xa2,0x9c,0x00,   // 5
0x3c,0x52,0x92,0x92,0x0c,0x00,   // 6
0x80,0x8e,0x90,0xa0,0xc0,0x00,   // 7
0x6c,0x92,0x92,0x92,0x6c,0x00,   // 8
0x60,0x92,0x92,0x94,0x78,0x00,   // 9 
0x00,0x6c,0x6c,0x00,0x00,0x00,   // :
0x00,0x6a,0x6c,0x00,0x00,0x00,   // ;
0x10,0x28,0x44,0x82,0x00,0x00,   // <
0x28,0x28,0x28,0x28,0x28,0x00,   // =
0x00,0x82,0x44,0x28,0x10,0x00,   // >
0x40,0x80,0x8a,0x90,0x60,0x00,   // ?
0x4c,0x92,0x9e,0x82,0x7c,0x00,   // @
0x7e,0x88,0x88,0x88,0x7e,0x00,   // A
0xfe,0x92,0x92,0x92,0x6c,0x00,   // B
0x7c,0x82,0x82,0x82,0x44,0x00,   // C
0xfe,0x82,0x82,0x44,0x38,0x00,   // D
0xfe,0x92,0x92,0x92,0x82,0x00,   // E
0xfe,0x90,0x90,0x90,0x80,0x00,   // F
0x7c,0x82,0x92,0x92,0x5e,0x00,   // G
0xfe,0x10,0x10,0x10,0xfe,0x00,   // H
0x00,0x82,0xfe,0x82,0x00,0x00,   // I
0x04,0x02,0x82,0xfc,0x80,0x00,   // J
0xfe,0x10,0x28,0x44,0x82,0x00,   // K
0xfe,0x02,0x02,0x02,0x02,0x00,   // L
0xfe,0x40,0x30,0x40,0xfe,0x00,   // M
0xfe,0x20,0x10,0x08,0xfe,0x00,   // N
0x7c,0x82,0x82,0x82,0x7c,0x00,   // O
0xfe,0x90,0x90,0x90,0x60,0x00,   // P
0x7c,0x82,0x8a,0x84,0x7a,0x00,   // Q
0xfe,0x90,0x98,0x94,0x62,0x00,   // R
0x62,0x92,0x92,0x92,0x8c,0x00,   // S
0x80,0x80,0xfe,0x80,0x80,0x00,   // T
0xfc,0x02,0x02,0x02,0xfc,0x00,   // U
0xf8,0x04,0x02,0x04,0xf8,0x00,   // V
0xfc,0x02,0x1c,0x02,0xfc,0x00,   // W
0xc6,0x28,0x10,0x28,0xc6,0x00,   // X
0xe0,0x10,0x0e,0x10,0xe0,0x00,   // Y
0x86,0x8b,0x92,0xa2,0xc2,0x00,   // Z
0x00,0xfe,0x82,0x82,0x00,0x00,   // [
0x00,0x00,0x00,0x00,0x00,0x00,     // *** do not remove this empty char ***
0x00,0x82,0x82,0xfe,0x00,0x00,   // ]
0x20,0x40,0x80,0x40,0x20,0x00,   // ^
0x02,0x02,0x02,0x02,0x02,0x00,   // _
0x00,0x80,0x40,0x20,0x00,0x00,   // `
0x04,0x2a,0x2a,0x2a,0x1e,0x00,   // a
0xfe,0x12,0x22,0x22,0x1c,0x00,   // b
0x1c,0x22,0x22,0x22,0x04,0x00,   // c
0x1c,0x22,0x22,0x12,0xfe,0x00,   // d
0x1c,0x2a,0x2a,0x2a,0x18,0x00,   // e
0x10,0x7e,0x90,0x80,0x40,0x00,   // f
0x30,0x4a,0x4a,0x4a,0x7c,0x00,   // g
0xfe,0x10,0x20,0x20,0x1e,0x00,   // h
0x00,0x22,0xbe,0x02,0x00,0x00,   // i
0x04,0x02,0x22,0xbc,0x00,0x00,   // j
0xfe,0x08,0x14,0x22,0x00,0x00,   // k
0x00,0x82,0xfe,0x02,0x00,0x00,   // l
0x3e,0x20,0x18,0x20,0x1e,0x00,   // m
0x3e,0x10,0x20,0x20,0x1e,0x00,   // n
0x1c,0x22,0x22,0x22,0x1c,0x00,   // o
0x3e,0x28,0x28,0x28,0x10,0x00,   // p
0x10,0x28,0x28,0x18,0x3e,0x00,   // q
0x3e,0x10,0x20,0x20,0x10,0x00,   // r
0x12,0x2a,0x2a,0x2a,0x04,0x00,   // s
0x20,0xfc,0x22,0x02,0x04,0x00,   // t
0x3c,0x02,0x02,0x04,0x3e,0x00,   // u
0x38,0x04,0x02,0x04,0x38,0x00,   // v
0x3c,0x02,0x0c,0x02,0x3c,0x00,   // w
0x22,0x14,0x08,0x14,0x22,0x00,   // x
0x30,0x0a,0x0a,0x0a,0x3c,0x00,   // y
0x22,0x26,0x2a,0x32,0x22,0x00,    // z
0x00,0x10,0x6c,0x82,0x00,0x00,   // {
0x00,0x00,0xfe,0x00,0x00,0x00,   // |
0x00,0x82,0x6c,0x10,0x00,0x00 };   // }


// keyboard scan codes (without & with shift key pressed)
flash unsigned char unshifted[67][2] = {
//0x0d,9,
0x0e,'`',0x15,'q',0x16,'1',0x1a,'z',0x1b,'s',0x1c,'a',0x1d,'w',0x1e,'2',0x21,'c',0x22,'x',0x23,'d',0x24,'e',
0x25,'4',0x26,'3',0x29,' ',0x2a,'v',0x2b,'f',0x2c,'t',0x2d,'r',0x2e,'5',0x31,'n',0x32,'b',0x33,'h',0x34,'g',
0x35,'y',0x36,'6',0x39,',',0x3a,'m',0x3b,'j',0x3c,'u',0x3d,'7',0x3e,'8',0x41,',',0x42,'k',0x43,'i',0x44,'o',
0x45,'0',0x46,'9',0x49,'.',0x4a,'/',0x4b,'l',0x4c,';',0x4d,'p',0x4e,'-',0x52,'`',0x54,'[',0x55,'=',0x5a,13,
0x5b,']',0x5d,'/',0x61,'<',0x66,8,  0x69,'1',0x6b,'4',0x6c,'7',0x70,'0',0x71,',',0x72,'2',0x73,'5',0x74,'6',
0x75,'8',0x79,'+',0x7a,'3',0x7b,'-',0x7c,'*',0x7d,'9',0,0 };


flash unsigned char shifted[67][2] = {
//0x0d,9,
0x0e,'`',0x15,'Q',0x16,'!',0x1a,'Z',0x1b,'S',0x1c,'A',0x1d,'W',0x1e,'@',0x21,'C',0x22,'X',0x23,'D',0x24,'E',
0x25,'$',0x26,'#',0x29,' ',0x2a,'V',0x2b,'F',0x2c,'T',0x2d,'R',0x2e,'%',0x31,'N',0x32,'B',0x33,'H',0x34,'G',
0x35,'Y',0x36,'^',0x39,'L',0x3a,'M',0x3b,'J',0x3c,'U',0x3d,'&',0x3e,'*',0x41,'<',0x42,'K',0x43,'I',0x44,'O',
0x45,')',0x46,'(',0x49,'>',0x4a,'?',0x4b,'L',0x4c,':',0x4d,'P',0x4e,'_',0x52,'"',0x54,'{',0x55,'+',0x5a,13,
0x5b,'}',0x5d,'|',0x61,'>',0x66,8,  0x69,'1',0x6b,'4',0x6c,'7',0x70,'0',0x71,',',0x72,'2',0x73,'5',0x74,'6',
0x75,'8',0x79,'+',0x7a,'3',0x7b,'-',0x7c,'*',0x7d,'9',0,0 };
                       



//***********************************************
void main() {                                                  
   int i,j;
       unsigned char ch,row;
   flash unsigned char *dataPtr, *tmpDataPtr;
   unsigned char messageLength, currentChar, charOffset, tmpCurrentChar, tmpCharOffset, ledArray[23];   
   unsigned char message[308];  // 300 chars + 4 spaces at start and end of message                   
   
   #asm("cli");    // disable all interrupts
   // initialise ports
   DDRA = 0xff;   // port A output    
   DDRB = 0xff;   // port B output   
   DDRC = 0xff;   // port C output   
   DDRD = 0xeb;   // pins 2 & 4 inputs   
   
   // initialise keyboard variables
   inpt = kb_buffer;
   outpt = kb_buffer;
   buffcnt = 0;
   bitcount = 11;
   
   // initialise lcd
   lcd_init();                            
                                                    
   // initialise LED display (shift registers)   
   LED_RESET = 0;
      LED_CLOCK = 0;
    LED_RESET = 1;                 
                    
   // initialise interrupt registers
   GIMSK = 0x40;   // enable INT0 interrupt
   MCUCR = 0x02;   // INT0 interrupt on falling edge   
   
   
      #asm("sei");    // enable all interrupts
         
           
      while(1) {
         ch = 0x00;
          i = 0;
          // fill the array with 4 empty spaces at the start and the end of the message
      // as the screen has 4 chars
      // (it looks better if we start scrolling with empty screen and end
      // with empty screen , rather than displaying four chars immediatelly and
      // then start scrolling)
      message[i++] = ' ';   
         message[i++] = ' ';   
         message[i++] = ' ';   
         message[i++] = ' ';   

      // enter message until 300 characters entered or <enter> key pressed            
          while((ch != 13) || (i < 308)) {     
         ch = getchar();
         if ((ch != 13) && (ch != 'q')) {
            lcd_putc(ch);
            message[i++] = ch;
         }
         // if q is pressed clear the LCD
         // (code only writes to the first LCD line so
         // if the line is longer than 16 chars i cant see the rest of the chars
         // , there will be a menu system in the future software version
         // and the line on the LCD will be scrolled
         // to the left automatically as the cursor gets to the end of the line
         //, for now use this dirty solution:))
         if (ch == 'q')
            lcd_clear();                        
      }             
          message[i++] = ' ';   
         message[i++] = ' ';   
         message[i++] = ' ';   
         message[i++] = ' ';                      
   
          messageLength = i - 4;
          charOffset = 0;
          currentChar = 0;
          dataPtr = &led_chars[message[0] - 0x20][0];   
          
      // this loop is the heart of the scroll
      // message is scrolled until a key is hit on the keyboard      

          while (!kbhit()) {     
             // load led array      
             tmpDataPtr = dataPtr;
             tmpCharOffset = charOffset;
             tmpCurrentChar = currentChar;
             for (i = 0; i <= 22; i++) { 
                ledArray[i] = *tmpDataPtr++;                                  
                 if (++tmpCharOffset==0x06) { 
                     tmpCharOffset = 0;                              
                   if (++tmpCurrentChar == messageLength)
                       tmpCurrentChar = 0;
                     tmpDataPtr = &led_chars[message[tmpCurrentChar] - 0x20][0];
                }            
             }
             if (++charOffset == 0x06) {     
                charOffset = 0;               
                if (++currentChar == messageLength)
                   currentChar = 0;   
             }     
             dataPtr = &led_chars[message[currentChar] - 0x20][charOffset];
              
             // display led array
             row = 0x02;       
             for (j = 0;j <= SCROLL_DELAY; j++) { 
               for (i = 0; i <= 22; i++) {
                   LED_DATA = (ledArray[i] & row) ? 1 : 0;
                   LED_CLOCK = 1;
                   LED_CLOCK = 0;       
                }                 
                PORTA = row; 
             row <<= 1;      // next line to be switched on         
             if (!row)    // if last line go back to the first line   
                row = 0x02;              
               delay_us(800);
                 PORTA = 0x00;       
             }
          }
      lcd_clear();      
    }
   
                  
}

//***********************************************
// return 1 if a key is pressed (non blocking)
// else return 0
int kbhit(void) {
   if (buffcnt) {
      // reset buffer variables (flush the buffer)
      inpt = kb_buffer;
      outpt = kb_buffer;
      buffcnt = 0;
      bitcount = 11;
      return 1;      
   }
    return 0;
}

// puts scan code (in hex format) into keyboard buffer
// (used for debugging purposes) 
//***********************************************
void put_scancode_kbbuff(unsigned char sc) {
   unsigned char h,l;

   // convert hi and low nibbles of the scancode
   // into ascii and store them into keyboard buffer   
   h =  ((sc & 0xf0 ) >> 0x04) & 0x0f;
   if ( h > 9)
      h = h + 7;
   h = h + 0x30;
   put_char_kbbuff(h);             
   
   l = sc & 0x0f;
   if ( l > 9)
      l = l + 7;
   l = l + 0x30;
   put_char_kbbuff(l);
}       
//***********************************************
// keyboard ISR 
interrupt [EXT_INT0] keyboard_isr(void) {
   static unsigned char data;   // holds the received scan code

   // function entered at falling edge of the kbd clock signal
   // if data bit is the next bit to be read
   // (bit 3 to 10 is data, start, stop & parity bis are ignored
   if((bitcount < 11) && (bitcount > 2)) {      
      data = (data >> 1);     
      if (KBD_DATA)         // if next bit is 1   
         data = data | 0x80;   // store a '1'
      else
         data = data & 0x7f; // else store a '0'
   }      
   if(--bitcount == 0) {      // all bits received ?      
            decode(data);       // decode received byte
         bitcount = 11;      // reset bit counter                  
   } 
}               
//***********************************************
// decode scan code
void decode(unsigned char sc) {
    static unsigned char is_up=0, shift = 0, mode = 0;
   unsigned char i;
 
   if (!is_up) {
      switch (sc) {
         case 0xF0 :// The up-key identifier
            is_up = 1;
            break;
         case 0x12 :// Left SHIFT
            shift = 1;
            break;
         case 0x59 :// Right SHIFT
            shift = 1;
            break;
         case 0x05 :// F1
            if(mode == 0)
               mode = 1;// Enter scan code mode
            if(mode == 2)
               mode = 3;// Leave scan code mode
            break;
         default:
            if(mode == 0 || mode == 3) {// If ASCII mode            
               if(!shift) {// If shift not pressed, do a table look-up
                  for(i = 0; unshifted[i][0]!=sc && unshifted[i][0]; i++);
                     if (unshifted[i][0] == sc) {
                        put_char_kbbuff(unshifted[i][1]);                     
                     }                                       
               }
               else {// If shift pressed
                  for(i = 0; shifted[i][0]!=sc && shifted[i][0]; i++);
                     if (shifted[i][0] == sc) {
                        put_char_kbbuff(shifted[i][1]);
                     }
               }
            }
            else put_scancode_kbbuff(sc);   // scan code mode (debugging mode)                        
            break;
      }
   }
   else {
      is_up = 0;// Two 0xF0 in a row not allowed
      switch (sc) {
         case 0x12 :// Left SHIFT
            shift = 0;
            break;
         case 0x59 :// Right SHIFT
            shift = 0;
            break;
         case 0x05 :// F1 --  F1 puts you in debugging mode
               // pressing F1 again gets you out of debugging mode
               // in debugging mode hex code of the scan codes
               // are stored in the buffer instead of their ascii codes      
            if(mode == 1)
            mode = 2;
            if(mode == 3)
               mode = 0;
            break;      
      }
   }
}                                               
//***********************************************
// store character in the keyboard ring buffer
void put_char_kbbuff(unsigned char c) {
   if (buffcnt < BUFF_SIZE) { // if buffer is not full
      *(inpt++) = c;
      buffcnt++;
      if (inpt >= kb_buffer + BUFF_SIZE) // pointer wrapping
         inpt = kb_buffer;
   }      
}
   
//***********************************************
// get next available character from the keyboard ring buffer
// (waits until a character is available in the buffer)
int getchar(void) {
   int byte;
   
   while (buffcnt == 0); // wait for data
   byte = *outpt; // get byte
   outpt++;
   if (outpt >= kb_buffer + BUFF_SIZE) // pointer wrapping
      outpt = kb_buffer;
   buffcnt--; // decrement buffer count
   return byte;
}
//***********************************************
void lcd_init(void) {
   delay_ms(50);
   LCD_E = 0;
   LCD_RS = COMMAND_MODE;   
   LCD_RW = WRITE_MODE;      
   delay_ms(1);
   LCD_DATA_PORT = 0x38;   // 8 bit, 2 lines, 5x8 font
   LCD_E = 1;   delay_ms(1);
   LCD_E = 0;   delay_ms(1);
   LCD_DATA_PORT = 0x0f;   // display & cursor ON, blink & underlined
   LCD_E = 1;   delay_ms(1);
   LCD_E = 0;   delay_ms(2);
   lcd_clear();                
}                                         
//***********************************************
void lcd_clear(void) { 
   LCD_RS = COMMAND_MODE;
    LCD_DATA_PORT = 0x01;   // clear display
   LCD_E = 1;   delay_ms(1);
   LCD_E = 0;   delay_ms(2);
}                               
//***********************************************
// display char on lcd
void lcd_putc(unsigned char ch) {
   LCD_RS = DATA_MODE;             
   LCD_DATA_PORT = ch;
   LCD_E = 1;   delay_us(40);          
   LCD_E = 0;   delay_us(40);
}                                               
//***********************************************
// display string on lcd
// input: pointer to string stored in flash ROM
void lcd_putsf(unsigned char flash *str) {             
   while (*str!= '\0') {
       lcd_putc(*(str++));
    }   
}     
//************************************************
//  same as above except the string is in RAM
void lcd_puts(unsigned char *str) {             
   while (*str!= '\0') {
       lcd_putc(*(str++));
    }   
}     


Last edited by rojo on 05 Jan 2004 10:55; edited 4 times in total
Back to top
glenjoy



Joined: 01 Jan 2004
Posts: 1021
Helped: 47
Location: Philippines


Post05 Jan 2004 1:50   Re: building your own moving message complete guide

Are you also using MAX7219?
Back to top
rojo



Joined: 03 Jan 2004
Posts: 17


Post05 Jan 2004 5:14   Re: building your own moving message complete guide

whats max7219 ?

ok here is everything in the zip file:
P*otel schematic (also in .doc and .jpg format for those who dont have P*otel)
C source code ,
i also included the Sillicon chip article from the first post
(i used the same article to build my LED display),
application note from Atmel explaining how to interface to AT keyboard
(i used bits of the code from the note in my source code)
, three pictures of the working display (already posted few posts earlier)
as I mentioned before the source is compiled with CodeVision compiler,
which also includes programmer software for STK 200 compatible
programers (and few others) , i only used their delay() library function
so the source is easily portable to any other compiler.

possible improvements could be:

-support for more than one message
(for example 6 x 50 char long messages)

-making menu system where user could select to save message(s)
in the onboard EEPROM, change saved messages, delete messages etc.

-detection if the keyboard is plugged in/out (maybe using onchip
analog comparator) this could be used to for example automatically
power LCD up and go into configuration mode , and when the keyboard is
disconnected LCD powers down, device goes into normal scroll mode
and displays currently selected message

-controlling the scroll speed via keyboard, currently its hard coded
into the source code via #define directive

-making the whole thing wireless, i.e. communication between LED display
and the main CPU board, (and eventually using smaller keyboard Smile)

so if any of you dudes have any suggestions for improvements or
if you do any or need help with building this display please let me know Smile)



Sorry, but you need login in to view this attachment

Back to top
rojo



Joined: 03 Jan 2004
Posts: 17


Post05 Jan 2004 10:46   Re: building your own moving message complete guide

no problem, if you need any help with it let me know here,
i`ll be checking the forum regularly, the compiler I used
is CodeVisionAVR , trial version can be downloaded from:
http://www.hpinfotech.ro/
Back to top
rojo



Joined: 03 Jan 2004
Posts: 17


Post05 Jan 2004 11:15   Re: building your own moving message complete guide

glenjoy wrote:
Are you also using MAX7219?


ok I had a look at max7219 , it`s a driver for 8x8
LED matrix, I am not using it in my display but I guess
I could, it would simplify the code as I wouldnt have
to do the complicated multiplexing through software,
and the hardware would probably be much simpler i.e.
no need for all the driver transistors , I`ll have a closer
look at the chip and maybe actually use it , thanks
for the suggestion Smile)

p.s. but i prefer doing ias much as possible in software,
so i dont have to use specialised hardware, its probably cheaper too


Last edited by rojo on 06 Jan 2004 7:21; edited 2 times in total
Back to top
rojo



Joined: 03 Jan 2004
Posts: 17


Post06 Jan 2004 5:22   Re: building your own moving message complete guide

wow, 40 downloads in less than 24 hrs since I uploaded
the zip file Smile) I didnt expect so much interest Smile)
I d like to hear your opinions and sugesstions, cmon dudes wake up,
i`m talking to myself here Smile
Back to top
Fragrance



Joined: 26 Jul 2002
Posts: 1313
Helped: 23


Post19 Feb 2004 12:41   Re: building your own moving message complete guide

hi

here is the classic interface for rojo design now you can display large meesage as well



Sorry, but you need login in to view this attachment

Back to top
PigiPigi



Joined: 01 May 2002
Posts: 49


Post22 Feb 2004 6:59   Re: building your own moving message complete guide

Hi,
Would you share your PCBs please?
Back to top
ME



Joined: 14 Mar 2002
Posts: 1771
Helped: 11


Post04 Mar 2004 15:29   

ME wrote:
Look in the newest issue of the Elektor Electronics magazine (November 2003):
http://www.elektor-electronics.co.uk/ln/details/e1103u.htm
There's an article about a Running Text Display using an 89S8252 Flash MCU.

PCB layout and source & hex code can be downloaded here:
http://www.elektor-electronics.co.uk/dl/details/dl1103.htm

I have attached the article from Elektor November 2003.



Sorry, but you need login in to view this attachment

Back to top
Lucas



Joined: 28 Apr 2003
Posts: 11
Location: french


Post13 Mar 2004 2:01   Re: building your own moving message complete guide

Here you have a big LED (640) that used the LCD CHIP.
All prog that used the LCD interface can use this big display.
http://xavier.fenard.free.fr/AffGeant.htm
Back to top
RoBSki!



Joined: 25 Mar 2004
Posts: 1


Post25 Mar 2004 22:44   Re: building your own moving message complete guide

Or check my project:

http://home.wanadoo.nl/electro1/avr/dotmatrix.htm

(not finished yet... stardate: 25/03/2004, but lots of info already)

Back to top
hugo



Joined: 01 Jan 1970
Posts: 243
Helped: 21


Post05 May 2004 15:31   Re: PIC Moving display system

Hi,

This is the link for a "Moving Message Display"
with PicBasic Pro & PIC16F877 running at 20MHz & the Agilent Technologies HSDP-2112 :

http://www.rentron.com/PicBasic/Moving_Message_Display.htm

Hope it help!

Very Happy Very Happy Very Happy
Back to top
masud58



Joined: 19 May 2002
Posts: 112
Helped: 4
Location: Your Site


Post23 May 2004 12:10   Re: DIY Moving Message Display

Hi,

I am working with 8051 core like atmel, first i will say what kind of hardware ( like multiplex or shift resister based?) if u build multiplex then the brghtness will down because when u build large tipe of display scaning speed will be fast, or i f u want to build shift resister based (like 74hc164) it out put 8 led , its brightness will fine, and no matter how long u want to made, second , if u write a programme with ascii code for latter then it will so easy for u, like A=41, u also write 16 line ,32 line moving display another language.


Masud Rana
Matrix Electronics fourm
Dhaka
Bangladesh
Back to top
Codeman



Joined: 11 Jun 2001
Posts: 40


Post24 May 2004 12:20   Re: DIY Moving Message Display

I'm a begginer is this things. I had understand everything except the following: (not good at C)

How do we convert the ascii char (for instance A is 7E 88 88 88 7E 00)
that is show up in columns, into data to be shift in to the rows?

A basic code example will be apreciated. Thanks

CM.
Back to top
rojo



Joined: 03 Jan 2004
Posts: 17


Post31 May 2004 22:27   Re: DIY Moving Message Display

Codeman wrote:
I'm a begginer is this things. I had understand everything except the following: (not good at C)

How do we convert the ascii char (for instance A is 7E 88 88 88 7E 00)
that is show up in columns, into data to be shift in to the rows?

A basic code example will be apreciated. Thanks

CM.


its all explained above see the main C function,
basically all you do is shift bits in each byte up or down before
sending them to the display, (see main() function in my C code)
i keep an array with all bytes of the message stored there.

this way i can shift message up / down and left /right

the oher way of doing it would be to display one column at a time instead
of one row like i did and again to shift message up/down u do that bit
shifting with each byte of the message

hopw this helps

let me know if not Wink) ill try to explain it better
Back to top
kiks



Joined: 01 Jun 2004
Posts: 23


Post01 Jun 2004 15:42   Re: DIY Moving Message Display

Very Happy Please check out the following websites.

http://noisybox.net/electronics/LED_sign/
http://mywebpages.comcast.net/rhirsch81/
http://www.woe.onlinehome.de/e_projects.htm#ledfont
http://private.addcom.de/KeithWilson/Projects/camed.htm

Elektor published an excellent circuit in the June 2001 edition called Modular Dot Matrix Display. It uses an atmel 89C2051. I have bought the Elektor 2001 CD from Elektor. I think it will be illegal for me to put the article and circuit up here!
Back to top
Codeman



Joined: 11 Jun 2001
Posts: 40


Post01 Jun 2004 15:46   Re: DIY Moving Message Display

Well I dont understand very well C. Embarassed
If you can isolate the function that converts the "A" char ( 7E 88 88 88 7E 00 ) that is see in columns into row shifts I will be gratefull.

TIA
CM
Back to top
josiphal



Joined: 21 Apr 2004
Posts: 7


Post03 Jun 2004 20:31   Re: DIY Moving Message Display

MAX7221 for 7-seg display (8 digits) and MAX6952 for 5x7 matrix (4 digits).
Nice products, simple interface, only 4 wires to uC.

josiphal
Back to top
kiks



Joined: 01 Jun 2004
Posts: 23


Post04 Jun 2004 21:42   Re: DIY Moving Message Display

OK Folks

Here is the complete Elektor June 2001 Zip file for the Modular Dot Matrix display including the software.



Sorry, but you need login in to view this attachment

Back to top
alphi



Joined: 23 Dec 2001
Posts: 439
Helped: 1


Post05 Jun 2004 0:31   Re: DIY Moving Message Display

www.lancos.com have this project.
Back to top
ME



Joined: 14 Mar 2002
Posts: 1771
Helped: 11


Post05 Jun 2004 1:26   Re: DIY Moving Message Display

alphi wrote:
www.lancos.com have this project.


I'm sorry, I can't find this project at www.lancos.com, please post the direct link.
Back to top
kiks



Joined: 01 Jun 2004
Posts: 23


Post11 Jun 2004 15:17   Re: DIY Moving Message Display

Here is another nice circuit using a Zilog chip, circuit schematic and software included. I am not sure whether the chip is still available, but for all you experts out there, maybe you can adapt to another microcontroller.

/ PDF deleted, always search google before uploading files. Read forum rules before posting!

This is an application note from Zilog, still available at their web site:
http://www.zilog.com/docs/z8/appnotes/an0078.pdf

- ME
Back to top
lgeorge123



Joined: 13 Jun 2004
Posts: 50


Post13 Jun 2004 16:18   Re: DIY Moving Message Display

Hi rojo, I read your article ,there are somethings i do not understand.
LED_DATA = (ledArray[i] & row) ? 1 : 0;
the above code "? 1 : 0" i don't know what its means! i am a pic user.
Back to top
ME



Joined: 14 Mar 2002
Posts: 1771
Helped: 11


Post13 Jun 2004 17:23   Re: DIY Moving Message Display

lgeorge123 wrote:
Hi rojo, I read your article ,there are somethings i do not understand.
LED_DATA = (ledArray & row) ? 1 : 0;
the above code "? 1 : 0" i don't know what its means! i am a pic user.


Code:
LED_DATA = (ledArray[i] & row) ? 1 : 0;

is the same as:
Code:
if (ledArray[i] & row)
   LED_DATA = 1;
else
   LED_DATA = 0;



The following is quote from page 65-66 of my C++ book with the title "C++ How to Program, 3rd ed.":
`C++ How to Program´ wrote:
Code:
if ( grade >= 60 )
   cout << "Passed";
else
   cout << "Failed";

...
C++ provides the [i]conditional operator
(?:) that is closely related to the if/else structure. The conditional operator is C++'s only tenary operator - it takes three operands. The operands, together with the conditional operator, form a conditional expression. The first operand is a condition, the second operand is the value for the entire conditional expression if the condition is true and the third operand is the value for the entire conditional expression if the condition is false. For example, the output statement
Code:
grade >= 60 ? cout << "Passed" : cout << "Failed";

contains a conditional expression that evaluates to the string "Passed" if the condition grade >= 60 is true and evaluates to the string "Failed" if the condition is false. Thus, the statement with the conditional operator performs essentially the same as the preceding if/else statement. As we will see, the precedence of the conditional operator is low, so the parentheses in the preceding expression is required.
The values in a conditional expression can also be actions to execute. For example, the conditional expression
Code:
cout << ( grade >= 60 ? "Passed" : "Failed" );

is read, `If grade is greater than that or equal to 60, then cout << "Passed"; otherwise cout << "Failed".´ This too, is comparable to the preceding if/else structure. We will see that conditional operators can be used in some situations wheres is/else statements cannot.

This info can be found in every C and C++ programming book.
Back to top
lgeorge123



Joined: 13 Jun 2004
Posts: 50


Post14 Jun 2004 4:15   Re: DIY Moving Message Display

dataPtr=&led_chars[message[0]-0x20][0] , i don't know the meaning
of [message[0]-0x20][0], why should it -0x20??????????
Back to top
ahmad_imran



Joined: 09 Jul 2004
Posts: 10


Post09 Jul 2004 3:05   DIY Moving Message Display

Hi

I'm new here and I want to use max6952. Is there anyone know how?
Back to top
rojo



Joined: 03 Jan 2004
Posts: 17


Post30 Jul 2004 14:33   Re: DIY Moving Message Display

lgeorge123 wrote:
dataPtr=&led_chars[message[0]-0x20][0] , i don't know the meaning
of [message[0]-0x20][0], why should it -0x20??????????


ok, its very simple, each character is defined by 6 bytes (5 bytes for each column + 0x00 for the space between characters), those 6 bytes are stored in led_chars array, message[] array contains the message to be displayed i.e. ASCII codes of each character of the message is stored
in message[] array, now to get to the actual bytes that define each character from the led_chars[] array i need to get the array index that
points to the first byte of character definition in the led_chars[] array,
as ASCII codes for alphanumeric characters start at 0x20 hexadecimal
or 32 decimal, and because index of led_chars[] array starts from 0
i have to submit 32 i.e 0x20 from each character`s ASCII code.
Back to top