vead
Full Member level 5
Hello
I have written program that show the message on LCD screen. I want to learn debugging skill to check the program.
Please help me with following example. How to check program and Where to set break point.
8051 and proteus . I have attached screen shot of program.
I have written program that show the message on LCD screen. I want to learn debugging skill to check the program.
Please help me with following example. How to check program and Where to set break point.
8051 and proteus . I have attached screen shot of program.
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 #include<reg51.h> /* Data pins connected to port P1 of 8051 */ #define Data_Port_Pins P2 sbit Register_Select_Pin = P0^0; /* Register Pin of LCD connected to Pin 0 of Port P2 */ sbit Read_Write_Pin = P0^1; /* Read/Write Pin of LCD connected to Pin 1 of Port P2 */ sbit Enable_Pin = P0^2; /* EN pin connected to pin 2 of port P2 */ /* Function for creating delay in milliseconds */ void Delay(unsigned int wait) { unsigned i, j; for(i = 0; i < wait; i++) for(j = 0; j < 1200; j++); } /* Function to send command instruction to LCD */ void LCD_Command (unsigned char command) { Data_Port_Pins = command; Register_Select_Pin =0; Read_Write_Pin=0; Enable_Pin =1; Delay (2); Enable_Pin =0; } /* Function to send display data to LCD */ void LCD_Data (unsigned char Data) { Data_Port_Pins = Data; Register_Select_Pin=1; Read_Write_Pin=0; Enable_Pin =1; Delay(2); Enable_Pin =0; } /* Function to prepare the LCD and get it ready */ void LCD_Initialization() { LCD_Command (0x38); LCD_Command (0x0e); LCD_Command (0x01); LCD_Command (0x81); } void main() { unsigned char string[15]="Great Khali"; char *pointer = string; LCD_Initialization(); while(*pointer) { LCD_Data(*pointer++); Delay(60); } }