Hello there I am trying to display a message on the lcd of this custom designed Microcontroller kit (www.nskelectronics.in/.../8051_project_board.pdf) using P89V51RD2N. I have tried to burn the following program but it just doesn't work.Can someone help me with this ..where am I going wrong.??....
Please note the LCD used in this board is JHD162A
#include <REG51.H> char check = 0x80; sbit EN = P3^4 ; sbit RS = P3^5; //sbit RW = ; //not mentioned on the schematic void delay(); unsigned char array[3]; sfr dat = 0x90; //data lines are connected to LCD from port P1 - as per the circuit void delay(void); void cmd() { RS = 0; //RW = 0; EN = 1; EN = 0; delay(); } void write_lcd() { RS = 1; //RW = 0; EN = 1; EN = 0; delay(); } void init_lcd() { dat = 0x38; cmd(); dat = 0x01; cmd(); dat = 0x0c; cmd(); dat = 0x86; cmd(); dat = 0xdf; write_lcd(); dat = 0x51 ; write_lcd(); } void delay() { int i,j; for(i = 0; i< 75 ; i++) for(j = 0; j < 75 ; j++); } void main() { for(;;) init_lcd(); }
Also I would like to know the purpose of the startup code in a Keil project...Is it obligatory to use the startup code?.
Thanks
Sorry Moderator the earlier post I made didt have the make of the LCD.I have mentioned it in this latest post please delete the older one ...thanks
Sorry Moderator the earlier post I made didt have the make of the LCD would it not be possible to have entered that as a "reply"?
any reason you persist in posting scribbles instead of code? code is commented.
Erik
Sorry about this Erik ..I guess I just followed the posting rules heres one such rule for the code posting
Place source code source code between "pre and /pre"
the code isn't commented I have placed it in these tags "pre & /pre" ...hope its not scribbles and readable to you
thanks
the code isn't commented I have placed it in these tags "pre & /pre" ...hope its not scribbles and readable to you readable, yes, clear no.
is this purloined scribbles or did you scratch it down it yourself
Hello Erik code isn't purloined ..I coded it myself after referring the datasheet ...I got across this one link iamsuhasm.wordpress.com/.../ after googling and analyzed ...and then coded ...