+ Post New Thread
Page 2 of 36 FirstFirst 123412 ... LastLast
Results 21 to 40 of 720
  1. #21
    Newbie level 5
    Points: 3,737, Level: 14

    Join Date
    Feb 2003
    Location
    Lahore, Pakistan
    Posts
    9
    Helped
    10 / 10
    Points
    3,737
    Level
    14

    8051 based moving message display

    Thanks tobb

    It is great... and thanks also for a part of software... Will you please let me have the hardware of your design... I want to study it also.


    1 members found this post helpful.

  2. #22
    Advanced Member level 4
    Points: 41,560, Level: 49
    Fragrance's Avatar
    Join Date
    Jul 2002
    Location
    East Of Earth
    Posts
    1,177
    Helped
    212 / 212
    Points
    41,560
    Level
    49

    scrolling message display project

    hi friend

    you have to look at the mcs web page to get the code and idea how to design your own instead to reqeusting some one to write down code for you such deficult task

    http://www.mcselec.com/an_128.htm


    3 members found this post helpful.

  3. #23
    Newbie level 5
    Points: 3,737, Level: 14

    Join Date
    Feb 2003
    Location
    Lahore, Pakistan
    Posts
    9
    Helped
    10 / 10
    Points
    3,737
    Level
    14

    pic16f682

    Dear Fragrance

    Thanks for advice...
    I have visited the site ... it is a good for me..

    If some one have already done this task he may help me... I can use his software for studying mime... is not it good?
    Waiting for your comments.


    1 members found this post helpful.

  4. #24
    ME
    ME is offline
    Advanced Member level 4
    Points: 21,367, Level: 35

    Join Date
    Mar 2002
    Posts
    1,312
    Helped
    56 / 56
    Points
    21,367
    Level
    35

    case study about moving message display

    Look in the newest issue of the Elektor Electronics magazine (November 2003):
    http://www.elektor-electronics.co.uk...ils/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...ils/dl1103.htm


    1 members found this post helpful.

  5. #25
    ME
    ME is offline
    Advanced Member level 4
    Points: 21,367, Level: 35

    Join Date
    Mar 2002
    Posts
    1,312
    Helped
    56 / 56
    Points
    21,367
    Level
    35

    scrolling message display circuits

    LED moving font using Atmel AT89C51 or AT89C2051 MCU:
    http://www.woe.onlinehome.de/e_projects.htm#ledfont


    1 members found this post helpful.

  6. #26
    Advanced Member level 1
    Points: 5,302, Level: 17

    Join Date
    Jul 2001
    Posts
    416
    Helped
    21 / 21
    Points
    5,302
    Level
    17

    moving message software download

    Is there a circuit based on the PIC controller also?

    bimbla.


    1 members found this post helpful.

  7. #27
    Junior Member level 3
    Points: 1,986, Level: 10

    Join Date
    Sep 2002
    Posts
    26
    Helped
    2 / 2
    Points
    1,986
    Level
    10

    project led moving message display , download

    hi friends
    I need to build an floor indicator with two 5x7 moving number
    but with pic 16f84


    2 members found this post helpful.

  8. #28
    ME
    ME is offline
    Advanced Member level 4
    Points: 21,367, Level: 35

    Join Date
    Mar 2002
    Posts
    1,312
    Helped
    56 / 56
    Points
    21,367
    Level
    35

    diy led moving message display

    Quote Originally Posted by tekton
    hi friends
    I need to build an floor indicator with two 5x7 moving number
    but with pic 16f84
    Why use the PIC16F84?
    It's obsolete and way too expensive.
    If you want to use PIC you should chosse the 16F627(A), 16F628(A) or 16F648A.
    They are pin compatible replacements for 16F84(A), but much cheaper and with more features. 16F628(A) has 2 times as much flash and PIC16F648A has 4 times as much flash, but is still much cheaper than 16F84(A).
    Please read this topic:
    http://www.elektroda.pl/eboard/searc...+16f627+16f628

    Prices for 18 pin PDIP, 1-25 units at http://buy.microchip.com:
    PIC16F84A-04/P (4 MHz): $5.05 (1024 words FLASH)
    PIC16F84A-20I/P (20 Mhz): $5.94
    PIC16F84A-20E/P (20 MHz): $6.50
    PIC16F84A-20/P (20 MHz): $5.39

    PIC16LF627A-I/P (20 MHz): $2.25 (1024 words FLASH)
    PIC16F627A-E/P (20 MHz): $2.31

    PIC16LF628A-I/P (20 MHz): $2.56 (2048 words FLASH)
    PIC16F628A-E/P (20 MHz): $2.60

    PIC16LF648A-I/P (20 MHz): $2.93 (4096 words FLASH)
    PIC16F648A-I/P (20 MHz): $2.76
    PIC16F648A-E/P (20 MHz): $2.97



    If you want to use AVR instead, you could use AT90S2313, or the new cheaper, better and faster ATtiny2313, but ATtiny2313 is only availible as samples yet.


    1 members found this post helpful.

  9. #29
    Advanced Member level 4
    Points: 41,560, Level: 49
    Fragrance's Avatar
    Join Date
    Jul 2002
    Location
    East Of Earth
    Posts
    1,177
    Helped
    212 / 212
    Points
    41,560
    Level
    49

    void main() portb=0b 74hc164 led matrix

    hi

    Here is the complete guide to building your own moving message display
    using micro controller

    This is a 89C2051 micro-controller project based and 7x16 LED matrix.


    3 members found this post helpful.

  10. #30
    Junior Member level 1
    Points: 4,374, Level: 15

    Join Date
    Jan 2004
    Posts
    18
    Helped
    9 / 9
    Points
    4,374
    Level
    15

    atmega 32 based moving message display

    hello

    just wondering if u dudes would be interested,
    i built my own moving message display with following characteristics:

    7x5 led matrix (only four characters at the moment, can be easily extended to any number of characters) connected to an at90s8535
    in system programmable controller (very simple programmer), can display around 300 character long messages (depends on the available RAM in the chip) , the controller is connected to a PC keyboard directly,
    so the message is typed in and displayed on an LCD (2x16 chars at the moment- also easily upgradable), with next version of software there will be an option for saving message in the
    onboard EEPROM (512 bytes), the code is written all in C , compiled with CodeVision C compiler, I only used
    their delay() library function so the code is easily portable to other
    compilers.compiled code takes around 800 bytes + few hundred bytes
    for the font and keyboard scancodes,
    (the chip has got 4 K rom & 512 bytes of RAM), currently im working on
    getting it to work under a small non-preemptive real time operating system. (also written in C).

    here are few pictures of it, let me know if youre interested, thanks :))


    3 members found this post helpful.

  11. #31
    Banned
    Points: 9,649, Level: 23

    Join Date
    Jan 2004
    Location
    Philippines
    Posts
    967
    Helped
    74 / 74
    Points
    9,649
    Level
    23

    moving message display panel

    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.


    1 members found this post helpful.

  12. #32
    Junior Member level 1
    Points: 4,374, Level: 15

    Join Date
    Jan 2004
    Posts
    18
    Helped
    9 / 9
    Points
    4,374
    Level
    15

    led moving message display software

    Quote Originally Posted by glenjoy
    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 :))

    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 :)))

    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 :)) 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.


    1 members found this post helpful.

  13. #33
    Banned
    Points: 9,649, Level: 23

    Join Date
    Jan 2004
    Location
    Philippines
    Posts
    967
    Helped
    74 / 74
    Points
    9,649
    Level
    23

    scrolling message display on 5by7 matrix of led

    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.



  14. #34
    Junior Member level 1
    Points: 4,374, Level: 15

    Join Date
    Jan 2004
    Posts
    18
    Helped
    9 / 9
    Points
    4,374
    Level
    15

    16x16 led moving message projects

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

    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 :)), 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++));
        }   
    }


    1 members found this post helpful.

  15. #35
    Banned
    Points: 9,649, Level: 23

    Join Date
    Jan 2004
    Location
    Philippines
    Posts
    967
    Helped
    74 / 74
    Points
    9,649
    Level
    23

    howto design with pic moving message display

    Are you also using MAX7219?


    1 members found this post helpful.

  16. #36
    Junior Member level 1
    Points: 4,374, Level: 15

    Join Date
    Jan 2004
    Posts
    18
    Helped
    9 / 9
    Points
    4,374
    Level
    15

    software moving message

    whats max7219 ?

    ok here is everything in the zip file:
    Protel schematic (also in .doc and .jpg format for those who dont have Protel)
    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 :))

    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 :))


    1 members found this post helpful.

  17. #37
    Junior Member level 1
    Points: 4,374, Level: 15

    Join Date
    Jan 2004
    Posts
    18
    Helped
    9 / 9
    Points
    4,374
    Level
    15

    hardware on scrolling message display

    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/



  18. #38
    Junior Member level 1
    Points: 4,374, Level: 15

    Join Date
    Jan 2004
    Posts
    18
    Helped
    9 / 9
    Points
    4,374
    Level
    15

    attiny2313 based moving message display

    Quote Originally Posted by glenjoy
    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 :))

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



  19. #39
    Junior Member level 1
    Points: 4,374, Level: 15

    Join Date
    Jan 2004
    Posts
    18
    Helped
    9 / 9
    Points
    4,374
    Level
    15

    74164 diy

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



  20. #40
    Advanced Member level 4
    Points: 41,560, Level: 49
    Fragrance's Avatar
    Join Date
    Jul 2002
    Location
    East Of Earth
    Posts
    1,177
    Helped
    212 / 212
    Points
    41,560
    Level
    49

    led font generator free software

    hi

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


    1 members found this post helpful.

+ Post New Thread
Please login
Page 2 of 36 FirstFirst 123412 ... LastLast

LinkBacks (?)

  1. 10th June 2013, 18:54
  2. LED
    Refback This thread
    8th February 2012, 11:33