Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

help in scrolling the text on lcd

Status
Not open for further replies.

muza1988

Newbie level 5
Joined
Jun 11, 2010
Messages
8
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
Malaysia
Activity points
1,337
hi

im using pic16f877A and 2x16 lcd. i programmed the pic to scroll the text across lcd. it is scrolling perfectly but the problem is that i want that when the text in row 1 of the lcd scrolls, another text shud scroll on the same row . can u plz help.

Code:
int i;


void main()
{



  LCD_Config(&PORTD,1,0,2,7,6,5,4);           // LCD pins that are connected to PIC at PORTD
  LCD_Cmd(LCD_CLEAR);
  while(1)
  {
   for(i =0; i<16; i++)


   {
  Lcd_Cmd(Lcd_CURSOR_OFF);
  Lcd_Cmd(Lcd_Clear);
  LCD_Out(1,i,"DINNAR BOX");
  delay_ms(700);
  LCD_Out(1,i,"FOR HAJJ!");
  delay_ms(700);

  


  
  
  }
 

Hi. I couldn't really understand your problem.
Is it that only '1' character from each message scrolled across the screen?
 
  • Like
Reactions: vet

    vet

    Points: 2
    Helpful Answer Positive Rating
hi,

the problem is that i want to scroll the text like news updates scroll in news channels.
in my program, the first text "dinnar box" scrolls across the lcd but another text "for hajj" shuld follow the first text but it doesnt.

hope i made my problem clear
 
  • Like
Reactions: vet

    vet

    Points: 2
    Helpful Answer Positive Rating
Hi,
I think your problem is the first text "dinnar box" and another text "for hajj" are starting in same position.
If you want to let second follow the first, you should move the second text position in lcd, like this:
LCD_Out(1,i-9,"FOR HAJJ!");
 

    muza1988

    Points: 2
    Helpful Answer Positive Rating
hi,

i have problem with my code again:(
i made a program in which, when switch at B0 is pressed it will display count and when switch B0 is off it will display welcome text. the problem is that for my coin counter hardware to run correctly i have to reduce the delay to 20ms in the if statement(the welcome text display ).as i do so the welcome display runs very fast and cant be seen. is there any way to reduce the delay so that it can count coins and display the welcome text...
plz help ...its my project


Code:
int i;
int j;
char txt[2];
void main()

{

  i = 1;
  PORTD = 0;
  LCD_Config(&PORTD,1,0,2,7,6,5,4);
  PORTB = 0;
  TRISB = 0b00000001;

 {
 do
 {
   if(PORTB.F0 == 0)
   {
     for(j=0;j<16;j++)
   {
  LCD_Cmd(LCD_CLEAR);
  Lcd_Cmd(Lcd_CURSOR_OFF);
  LCD_Out(1,j,"WELCOME TO");
  LCD_Out(1,j-8,"GOLD DINNAR BOX");
  Delay_ms(20);
  }


  }


  else
  {

  LCD_Cmd(LCD_CLEAR);
  Lcd_Cmd(Lcd_CURSOR_OFF);
  IntToStr(i, txt);
  Lcd_Out(2,2 ,txt);
  delay_ms(500);
  i=i+1;

  }


  }while(1);

  }


  }
 

Hi, this is not an answer but a question as we seam to be doing same thing, I have a problem with PIC16f873 that when I send two Binary string to Port A or Port b as in B'11111111' and load with MOVWF the last 4 bit of Port B oscillate, have you had anything like this??

Regards
 

Hi, muza1988:
I am not very understand your second problem.
But if you mean runing to fast and can't delay in main. You can just let some ting be done in interrupt.
Just connect to int port in your singlechip.
If you have more question, you can email to me:
ruixuedz@gmail.com.
I think I can help you.
 

hi bikerbiker can plz post ur code here..i will try to help
 

Hi, as asked for here my code, you will see I have moved onto using the PORTC, but again the output port are oscillating, funny though it do work and print AAAAAA on the LCD, but if you look at the PORT C pin they are oscillating using a DVM???

;**************************************************************************
;* LCD Driver *
;**************************************************************************
;**************************************************************************
;* Hardw. Rev: P8048'x ß1 Softw. Rev: 1.00ß *
;* OSC.......: XT 4MHz Max. POWER.....: 15V DC *
;**************************************************************************


;==========================================================================
;
; Register Definitions
;
;==========================================================================




;==========================================================================
;
; Configuration
;
;==========================================================================

LIST P=16F873
INCLUDE "P16f873.inc"
ERRORLEVEL -302


__CONFIG _CP_OFF & _DEBUG_OFF & _LVP_OFF & _WRT_ENABLE_ON & _PWRTE_ON & _WDT_OFF & _BODEN_OFF & _XT_OSC



;==========================================================================
;
; Variable Definition
;
;==========================================================================


TIMER1 EQU H'20' ;Timer 1, Used for general delay.
TIMER2 EQU H'21' ;Timer 2, used for delay !
EFFECT EQU H'22'
LCD_E_BIT EQU D'4' ;E_BIT ON LCD
LCD_RS_BIT EQU D'5' ;RS BIT LCD

ORG 0
goto finish

; **************************
; * delay routine: *
; **************************
DELAY ;CLRWDT
MOVLW D'255' ;*
MOVWF TIMER1 ;*
;
DELAY2 MOVLW D'255'
MOVWF TIMER2
DECFSZ TIMER2,F ;*
GOTO $-1 ;*

DECFSZ TIMER1,F
GOTO DELAY2
return

; **************************
; * main routine: *
; **************************

initports ;BSF STATUS,RP0
;MOVLW B'00000000' ; 1 equal input 0 equals output
;MOVWF TRISB
;MOVLW B'00000000'
;MOVWF TRISC
;BCF STATUS,RP0

CLRF PORTB
CLRF PORTC

banksel TRISA
movlw b'00111111'
movwf TRISA

banksel ADCON1 ;select bank for ADCON1
movlw b'00000110' ;Define all ports pins as Digital
movwf ADCON1

movlw 0x00 ;Define PortB and PortC as Outputs.
movwf TRISB
movwf TRISC
return






enablepulse BCF PORTB,1 ;clear portB bit 1 (Enable)
NOP
NOP
BSF PORTB,1 ;set PORTB bit1 (enable)
NOP
NOP
BCF PORTB,1 ;clear portB bit 1 (Enable)
NOP
NOP
return


initlcd ;BANKSEL PORTB
call DELAY
call DELAY
BCF PORTB,0
MOVLW B'00001111'
MOVWF PORTC
call enablepulse
BSF PORTB,0
call DELAY
return

putchar MOVWF PORTC
call enablepulse
call DELAY
return

finish call initports
nop
BANKSEL PORTB
call initlcd
MOVLW b'01000001' ;Display A on LCD
call putchar
call DELAY

END ;End of source code.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top