Olympic timer Scroll Text


Closed Thread
Results 1 to 9 of 9
  1. #1
    Patrick's Avatar
    Patrick Guest

    Cool Olympic timer Scroll Text

    I have programmed the pic and the timer is working fine
    The problem is with the scrolling message at the beginning of the program
    I use a 40 car LCD as the example is only 32
    I asume it should make no difference
    Im only getting black cursors and no scrolling text
    Im trying to understand what Melanie have done but she is to clever for me
    Any help will do

  2. #2
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default how to...

    Hi Patrick,

    Hope this helps. It is ment to work with a 16 digit display.

    Code:
    ' Variable definition
    CounterA     var byte
    CounterB     var byte
    CounterC     var byte
    DataA        var byte
    
    ' String to be displayed
    '              1         2         3         4
    '     12345678901234567890123456789012345678901234
    Data "Olympic Timer Powered by MeLabs PICBasic Pro" 'length = 44 charaters
    
    ' Start program
    BANNER:
        lcdout $FE, 1                              'Clear LCD
        pause 1000                                 'Time to initialise LCD
        
        ' This loop displays the first 16 characters of the string during 1 second = "Olympic Timer Po"
        for countera = 0 to 15                     'Setup a counter for 16 steps
            read Countera, dataa                   'Goto to memory location and read the character of the string
            LCDOut DataA                           'Display the current character
        next
        pause 1000                                 'Pause the first 16 characters to make them visible
        
        ' These two following loops make the text shift effect for 28 times (string is 44 character - 16 first characters already displayed = 28 characters to go)
        '  When CounterA is 0, we will display "lympic Timer Pow"
        '  When CounterA is 1, we will display "ympic Timer Powe"
        '  When CounterA is 2, we will display "mpic Timer Power"
        '  ....
        For CounterA = 0 to 28                     'This loop will shift the text for 28 times (44 - 16 = 28)
            CounterC = CounterA + 15               'CounterC indicates the position of the first next character to be displayed
            LCDOut $FE, $80                        'Set the cursor Home (you can try "LCDOUT $FE, 1" or "LCDOUT $FE, 2" too)
            
            ' This loop reads the 16 characters to be displayed at that time
            For CounterB = CounterA to CounterC    'CounterB will read 16 characters starting at character position "CounterC"
                Read CounterB, DataA               'Goto to memory location and read the character of the string
                LCDOut DataA                       'Display the current character
            Next                                    
    
            Pause 200                              'Speed of display shift
        Next                                       
            
        Pause 1000                                 'Keep the last 16 characters of the text ON during 1 second before restart
        
        goto BANNER
        
        end
    Roger

  3. #3
    Patrick's Avatar
    Patrick Guest


    Did you find this post helpful? Yes | No

    Talking Scroll

    Thanks a mil
    I will try to get it working

    Patrick

  4. #4
    Patrick's Avatar
    Patrick Guest


    Did you find this post helpful? Yes | No

    Unhappy Scroll text

    I have tried it an get similar behaviour to the orig program
    Im using a bootloader,can his have influance as it might occupy the Data codespace
    Im now more determant to get to the bottom of this
    See include photo
    Attached Images Attached Images  

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    If you're using a Bootloader, be sure you place the following line at the top of your code

    DEFINE LOADER_USED 1

    if it doesn't work, post your whole code here, and tell us your PIC #, OSC speed, AND config fuses list you set when you loaded your bootloader firmware in your PIC.

    One thing is sure, your LCD is not initialised properly.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Patrick's Avatar
    Patrick Guest


    Did you find this post helpful? Yes | No

    Red face Scroll Text

    The code is as posted by flotulopex with the next as top of file:

    @ DEVICE pic16F876, XT_OSC ' System Clock Options
    @ DEVICE pic16F876, WDT_ON ' Watchdog Timer
    @ DEVICE pic16F876, PWRT_ON ' Power-On Timer
    @ DEVICE pic16F876, BOD_ON ' Brown-Out Detect
    @ DEVICE pic16F876, LVP_OFF ' Low-Voltage Programming
    @ DEVICE pic16F876, CPD_OFF ' Data Memory Code Protect
    @ DEVICE pic16F876, PROTECT_OFF
    ' Program Code Protection
    @ DEVICE pic16F876, WRT_OFF ' Flash Memory Word Enable

    DEFINE LOADER_USED 1 ' If using bootloader to program pic
    DEFINE LCD_DREG PORTC 'Define PIC port used for LCD Data lines
    DEFINE LCD_DBIT 0 'Define first pin of portc connected to LCD DC4
    DEFINE LCD_RSREG PORTC 'Define PIC port used for RS line of LCD
    DEFINE LCD_RSBIT 4 'Define Portc pin used for RS connection
    DEFINE LCD_EREG PORTC 'Define PIC port used for E line of LCD
    DEFINE LCD_EBIT 5 'Define PortC pin used for E connection
    DEFINE LCD_BITS 4 'Define the 4 bit communication mode to LCD
    DEFINE LCD_LINES 2 'Define using a 2 line LCD
    DEFINE LCD_COMMANDUS 2000 'Define delay time between sending LCD commands
    DEFINE LCD_DATAUS 50 'Define delay time between data sent.

  7. #7
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Talking Try this out

    Hi,

    If you can get your lcd to respond atleast then please tryout the following code. You will be surprised.

    I post a little program here and would like you guys to try it out U N-E D I T E D. Please use the LCD Defines as your config. You can use a 16/20 characters display if you wish. Steve would you mind explaining I am a little too drunk.

    Code:
    MAIN:
    LCDOUT $FE,1
    LCDOUT "MERRY CHRISTMAS AND HAPPY NEW YEAR 2007 "
    LCDOUT $FE,$C0
    LCDOUT "***FROM YOUR FRIEND SOUGATA IN INDIA****"
    PAUSE 1000
    LOOP:
    LCDOUT $FE, $18
    PAUSE 500
    GOTO LOOP
    Regards

    Sougata

  8. #8
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    891


    Did you find this post helpful? Yes | No

    Default Cool!

    Wow! Well done.

    In the "LOOP:", let's go the other way: "LCDOUT $FE, $1C" - from the LEFT to the Right.
    Roger

  9. #9
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    LMAO! Well even drunk you got it Take one of those...

    Well explanation is easy, but i will make it simple and skip some information.

    LCDOUT $FE,1
    LCDOUT "MERRY CHRISTMAS AND HAPPY NEW YEAR 2007 "
    LCDOUT $FE,$C0
    LCDOUT "***FROM YOUR FRIEND SOUGATA IN INDIA****"

    There you fill the LCD memory/buffer...plahplahplah

    LOOP:
    LCDOUT $FE, $18
    PAUSE 500
    GOTO LOOP

    For this one, open a HD44780 LCD datasheet, and find the 'Cursor or display shift' Register. Now, read the S/C bit information. You don't like the way it move, set the R/L bit.

    EDIT: Yup Flotulopex, you got it!
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. About olympic timer..
    By Eng4444 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 4th June 2006, 09:16
  2. Melanie's Olympic Timer
    By nedtron in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 11th January 2006, 14:41
  3. Olympic Timer MPH readout
    By Macgman2000 in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 19th August 2005, 17:56
  4. Help with scroll text in Melanie Olympic Timer
    By jorge in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 9th November 2004, 14:52
  5. Melanie Olympic Timer -> Banner....scroll text...
    By jorge in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 8th November 2004, 22:11

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts