How are you assessing correct initialisation of the LCD? By "can't send" you mean the data is not displayed despite your program sending it? Have you evidence, external to the PIC, to prove data is being sent? Probe the lines using whatever you have. I don't recall what instruments you have, but I would use a logic sniffer, storage oscilloscope, or LEDs. That will help you isolate likely causes. I also wonder if the LCD is busy after initialise, and how you are checking if it is busy, and whether you are delaying the data until the LCD says it is not busy. Yes, I've used LCDs with PICs before. On Thu, Oct 22, 2015 at 08:57:38PM -0500, Richard R. Pope wrote: > David, > This is how they are defined. It is LATxn, where x is the port=20 > and n is the bit number. Such as: LATA0 for RA0. I still can't send data= =20 > to the LCD but all of my warnings went away and the LCD does initialize=20 > correctly. > Thanks, > rich! >=20 > On 10/22/2015 8:47 PM, David Duffy (AVD) wrote: > > Shouldn't those defines be: > > > > #define LCD_rs LATAbits.RA0 //Pin 2 LCD pin 4 > > #define LCD_rw LATAbits.RA1 //Pin 3 LCD pin 5 > > #define LCD_e LATAbits.RA2 //Pin 4 LCD pin 6 > > > > David... > > > > On 23/10/2015 11:32 AM, Richard R. Pope wrote: > >> David, > >> Sure. Here is the cmd and the data routines: > >> extern void LCD_Send_cmd(unsigned char = value) > >> { > >> LCD_data =3D value; > >> LCD_rs =3D 0; > >> LCD_rw =3D 0; > >> LCD_e =3D 1; > >> wait_ms(30); > >> LCD_e =3D 0; > >> } > >> > >> extern void LCD_Send_data(unsigned char = value) > >> { > >> LCD_data =3D value; > >> LCD_rs =3D 1; > >> LCD_rw =3D 0; > >> LCD_e =3D 1; > >> wait_ms(30); > >> LCD_e =3D 0; > >> } > >> You call them for sending either cmds or data to the LCD. The > >> initialize routine uses the cmd routine. Feel free to ask whatever > >> questions you think are necessary. I appreciate the help! > >> Thanks, > >> rich! > >> > >> On 10/22/2015 8:18 PM, David Duffy (AVD) wrote: > >>> Can you give me a few lines of how you're using them in the code? > >>> > >>> On 23/10/2015 11:01 AM, Richard R. Pope wrote: > >>>> David, > >>>> Here are the pins used. > >>>> #define LCD_rs RA0 //Pin 2 LC= D pin 4 > >>>> #define LCD_rw RA1 //Pin 3 LCD= pin 5 > >>>> #define LCD_e RA2 //Pin 4 LC= D pin 6 > >>>> #define LCD_data LATAD 19-22 and pins 27-30 > >>>> Notice that LATAD works with the LCD_data definition! I don= 't get it. > >>>> Thanks, > >>>> rich! > >>>> > >>>> On 10/22/2015 7:45 PM, David Duffy (AVD) wrote: > >>>>> Ah.... I hadn't been playing along. :) > >>>>> > >>>>> So, what actual port pin is RS on ? > >>>>> David... > >>>>> > >>>>> On 23/10/2015 10:08 AM, Richard R. Pope wrote: > >>>>>> David, > >>>>>> Let's try this again. I decided to use a 18f4550 instea= d of the > >>>>>> 16f877a. Sorry about that. The PIC and LCD initialize but I can't = get > >>>>>> the LCD to accept and display any data such as a or b or hello the= re and > >>>>>> so forth. I have been discussing the 4550 all along and you were u= nder > >>>>>> the impression that I was using a 877. My fault. > >>>>>> > > >=20 >=20 > --=20 > Richard R. Pope > President > Reedsburg Area Model Railroad Club, RAMRC > 1230 19th Street #5 > Reedsburg, WI 53959 > 608-768-7448 > mechanic_2@charter.net >=20 > --=20 > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist --=20 James Cameron http://quozl.linux.org.au/ --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .