This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Simulator clarification

Hai
When simulating, keil IDE Skips some bit manipulating instructions.I think there is some point in that which I cannot locate.please pont out

Roy Thomas

Parents
  • Sorry for being not clear in the last post.I was off the impression that being a newcomer I may be ignorant of some very common rules of keil.
    I am just starting in C and Keil .Sorry if my code looks awkward

    
    sbit LCD_EN    	        = P0^4;
    sbit LCD_RW		= P0^5;
    sbit LCD_RS		= P0^6;
    
    void lcd_ini(void)
    
    {
    	delayUs(0x40);
    
    	LCD_RW = 0;						// write operation
    	LCD_RS = 0;						// write to command register
    
    	P0 =(P0 & 0xF0) | 0x03;
    
    
    	delayUs(0x10);
    
    LCD_EN = 0;
    LCD_EN=1;
    
    	LCD_STROBE;
    
    	delayUs(0x20);
    
    	LCD_STROBE;
    
    LCD_EN = 0;
    LCD_EN=1;
    
    
    	delayUs(0x30);
    
    	LCD_STROBE;
    
    	delayUs(0x25);
    
    LCD_EN =0;//  /These //two //instructions are skipped
    	LCD_EN=1;
    
    	delayUs(0x50);
    
    	P0	&=	0xFE;
    
    	delayUs(0x23);
    
    	LCD_STROBE;
    
    	delayUs(0x50);
    
    
    //this is my delay
    
    void delayUs(unsigned char del)
    
    {
    	unsigned char delloc;
        for(delloc=0;delloc <= del;delloc++)
    		{
    		}
    }
    

Reply
  • Sorry for being not clear in the last post.I was off the impression that being a newcomer I may be ignorant of some very common rules of keil.
    I am just starting in C and Keil .Sorry if my code looks awkward

    
    sbit LCD_EN    	        = P0^4;
    sbit LCD_RW		= P0^5;
    sbit LCD_RS		= P0^6;
    
    void lcd_ini(void)
    
    {
    	delayUs(0x40);
    
    	LCD_RW = 0;						// write operation
    	LCD_RS = 0;						// write to command register
    
    	P0 =(P0 & 0xF0) | 0x03;
    
    
    	delayUs(0x10);
    
    LCD_EN = 0;
    LCD_EN=1;
    
    	LCD_STROBE;
    
    	delayUs(0x20);
    
    	LCD_STROBE;
    
    LCD_EN = 0;
    LCD_EN=1;
    
    
    	delayUs(0x30);
    
    	LCD_STROBE;
    
    	delayUs(0x25);
    
    LCD_EN =0;//  /These //two //instructions are skipped
    	LCD_EN=1;
    
    	delayUs(0x50);
    
    	P0	&=	0xFE;
    
    	delayUs(0x23);
    
    	LCD_STROBE;
    
    	delayUs(0x50);
    
    
    //this is my delay
    
    void delayUs(unsigned char del)
    
    {
    	unsigned char delloc;
        for(delloc=0;delloc <= del;delloc++)
    		{
    		}
    }
    

Children