| ??? 12/29/01 07:06 Read: times |
#18191 - RE: problem with stringdisplay on lcd |
Rao,
Answering to the questions bellow doesn't mean you will solve the problems. Why in the initialisation function you placed these, one after another ? I assume you use HD44780 type LCD, 16 characters x 2 lines dots matrix. val=0x08 Set off entire display Set off cursor Set no blinking val=0x0E Set on entire display Set on cursor Set off blinking Don't get me wrong. If you succeed to display the three character "WEL" starting of the fifth character of the first line, that means the display was initialised properly. Looking at the delay times I assume you work with 11,0592Mhz X-tal. (0x64 multiplied with 0x0A) for 1ms. Thus I check E cycle time, the hold times for RS, EN, R/W and EN width which are fully covered. How the compiler will behave when you declare an array of 16 character and fill only either 7 or 4 of them: Reserves space only for 4 or 7 character or padded with 0x00 up to the end of 16 ? Just because I want to know when the while loop finishes, on disp_string(char *v). It will behave like in case of terminated zero strings or lovely DB assembler directive with the last character declared as 00F. That's why I preffer assembler instead C. I'm never sure what C compiler is doing for me. For example, look at formal parameter of the function disp_string. Even though the formal parameters receive the value of the arguments passed to the function (a pointer in our case), they otherwise act like local variables, which has to be initialised at function call. Since I don't know how arguments are passed to the function (ordinary C compiler do this through stack) I'm not sure if they are initialised properly or not. It will be ch1[0] the first character displaied as a first step inside while loop ? That's why I feel more comfortable with assembler and macro definitions and I'm curious regarding output hex file. Since it doesn't include library function, I'm confident it's small. Be sure that before disp_string(ch1), the cursor really goes to the fifth character position on the second line as a result of 0xC5 command. One of the missing things in polling the Ready bit is the time out procedure. If is something wrong with LCD controller your program will fail waiting a ready bit, which will never comes out. Ohh, almost I forgot the sweet and nice puppy dog. When you load the DPTR with address of data variable, you place underscore sign in front of data. Why? It's the casting C for SPJ compiler ? Just because you use xdata for storage of ch and ch1 array. But it was not declared. Not even small or large model. Or you tick a small box inside IDE ? How the compiler knows that the address of data variable is 16bits wide ? Are you sure the program succeed to get in infinite loop while(1) at the end of main() function ? Regards, Silviu |
| Topic | Author | Date |
| problem with stringdisplay on lcd | 01/01/70 00:00 | |
| RE: problem with stringdisplay on lcd | 01/01/70 00:00 | |
| RE: problem with stringdisplay on lcd | 01/01/70 00:00 | |
| RE:bruce this is the code | 01/01/70 00:00 | |
| RE: RE:bruce this is the code | 01/01/70 00:00 | |
| RE: RE:bruce this is the code | 01/01/70 00:00 | |
| RE: problem with stringdisplay on lcd | 01/01/70 00:00 | |
| RE: problem with stringdisplay on lcd | 01/01/70 00:00 | |
| RE: RE:bruce this is the code | 01/01/70 00:00 | |
| silviu : i am using spjsystems | 01/01/70 00:00 | |
RE: silviu : i am using spjsystems | 01/01/70 00:00 |



