Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

Scrolling text 2x16 LCD PIC16F887

Status
Not open for further replies.

gabriemrc89

Newbie level 4
Joined
Feb 16, 2011
Messages
7
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,321
hy i want to scroll some text on my lcd 2x16.
on first line i want my name end on the second line some data collect from senzors( collecting data from senzos is done).
i just need some code lines to scroll that information whit diferent speeds on the two lines if can help me please tell me

---------- Post added at 23:10 ---------- Previous post was at 22:54 ----------

an example YouTube - ‪scrolling text with LCD 2X16 PIC18F452 microchip mcu‬‏
i want the 1st line scroll like second line but diferent speed
 

bigdogguru

Administrator
Joined
Mar 12, 2010
Messages
9,831
Helped
2,348
Reputation
4,690
Reaction score
2,274
Trophy points
1,413
Location
Southwest, USA
Activity points
62,508
What development software are you using? MPLAB, MPASM, Hi-Tech C, CCS, MikoC, etc?
 
  • Like
Reactions: vet

    vet

    points: 2
    Helpful Answer Positive Rating

bigdogguru

Administrator
Joined
Mar 12, 2010
Messages
9,831
Helped
2,348
Reputation
4,690
Reaction score
2,274
Trophy points
1,413
Location
Southwest, USA
Activity points
62,508
Here's a PIC project using MikroC which scrolls text across LCD remotely controlled via serial port to PC:

A PIC Serial LCD project

You should be able to download the project code and use it as a template for your program.
 
  • Like
Reactions: vet

    vet

    points: 2
    Helpful Answer Positive Rating

gabriemrc89

Newbie level 4
Joined
Feb 16, 2011
Messages
7
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,321
Here's a PIC project using MikroC which scrolls text across LCD remotely controlled via serial port to PC:

A PIC Serial LCD project

You should be able to download the project code and use it as a template for your program.
i start to read now i hope this information resolve my problem. i don't need to use comunication whit pc
 

bigdogguru

Administrator
Joined
Mar 12, 2010
Messages
9,831
Helped
2,348
Reputation
4,690
Reaction score
2,274
Trophy points
1,413
Location
Southwest, USA
Activity points
62,508
If you have a similar PIC as was used in the project, make any modifications you need and run it to see the features.

Running the program as a demo with give you some incite into the code routines you are interested in.

I would also check the MikroC libraries, I thought I saw scrolling text routines last time I looked.

I own MikroC Pro, but rarely use it. I prefer other compilers.
 

bigdogguru

Administrator
Joined
Mar 12, 2010
Messages
9,831
Helped
2,348
Reputation
4,690
Reaction score
2,274
Trophy points
1,413
Location
Southwest, USA
Activity points
62,508
Well that disappointing.

The good news is I checked MikroC's libraries and they support scrolling text:


Code:
// LCD module connections
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D4 at RB0_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D7 at RB3_bit;

sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D4_Direction at TRISB0_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D7_Direction at TRISB3_bit;
// End LCD module connections

char txt1[] = "mikroElektronika";    
char txt2[] = "EasyPIC6";
char txt3[] = "Lcd4bit";
char txt4[] = "example";

char i;                              // Loop variable

void Move_Delay() {                  // Function used for text moving
  Delay_ms(500);                     // You can change the moving speed here
}

void main(){
  ANSEL  = 0;                        // Configure AN pins as digital I/O
  ANSELH = 0;
  C1ON_bit = 0;                      // Disable comparators
  C2ON_bit = 0;

  Lcd_Init();                        // Initialize LCD

  Lcd_Cmd(_LCD_CLEAR);               // Clear display
  Lcd_Cmd(_LCD_CURSOR_OFF);          // Cursor off
  Lcd_Out(1,6,txt3);                 // Write text in first row

  Lcd_Out(2,6,txt4);                 // Write text in second row
  Delay_ms(2000);
  Lcd_Cmd(_LCD_CLEAR);               // Clear display

  Lcd_Out(1,1,txt1);                 // Write text in first row
  Lcd_Out(2,5,txt2);                 // Write text in second row

  Delay_ms(2000);

  // Moving text
  for(i=0; i<4; i++) {               // Move text to the right 4 times
    Lcd_Cmd(_LCD_SHIFT_RIGHT);
    Move_Delay();
  }

  while(1) {                         // Endless loop
    for(i=0; i<8; i++) {             // Move text to the left 7 times
      Lcd_Cmd(_LCD_SHIFT_LEFT);
      Move_Delay();
    }

    for(i=0; i<8; i++) {             // Move text to the right 7 times
      Lcd_Cmd(_LCD_SHIFT_RIGHT);
      Move_Delay();
    }
  }
}
The code above is an example of move text left and right. Checkout their LCD library documentation in the IDE.

Let me know if you have any more problems implementing your project.
 

gabriemrc89

Newbie level 4
Joined
Feb 16, 2011
Messages
7
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,321
the code work very fine i use that for start i can't figure out how to scroll the bought lines in the same time but with diferent speeds
 

veed_bits

Newbie level 1
Joined
Jun 17, 2011
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,284
I'm a beginner. Can anyone provide a CCS C Compiler code for the same function???:-|
 

gabriemrc89

Newbie level 4
Joined
Feb 16, 2011
Messages
7
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,321
hi, can is use this code?? i use mickro c
Lcd_Custom_Config(&PORTB,0,1,2,3, &PORTC,4,5,6);
LCD_Custom_Cmd(LCD_CURSOR_off);// Turn cursor off
LCD_Custom_Cmd(LCD_CLEAR);
can i use 2 diferent ports(B for data and C for lcd command)???
is much simple to proiect the hardware. i did some tests but the answear "controller received data whilst busy"
 
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top