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

when i burn the hex file its not working

when i burnt the example hex file the hardware is working.
but when the code i copied and compiled using keil uVision2 and converted to hex its not working what is the problem

Parents
  • actually i have it's working now..the problem was in the for loop

    
    #include<reg52.h>
    
    void main()
    {
    
            int i;
            while (1)
            {
    
                    for (i =0;i < 32000; i++)
                    {
                            P1_0 = 0;
                    }
    
                    for (i =0;i < 32000; i++)
                    {
                            P1_0 = 1;
                    }
            }
    }
    


    when i change the no. from 32000 to some another arbitrary then it's not working
    please tell me the reason......and another thing is when i program the same code for port0 it's not working......for port 1 and 2 the light is dimmer...i dont want that

Reply
  • actually i have it's working now..the problem was in the for loop

    
    #include<reg52.h>
    
    void main()
    {
    
            int i;
            while (1)
            {
    
                    for (i =0;i < 32000; i++)
                    {
                            P1_0 = 0;
                    }
    
                    for (i =0;i < 32000; i++)
                    {
                            P1_0 = 1;
                    }
            }
    }
    


    when i change the no. from 32000 to some another arbitrary then it's not working
    please tell me the reason......and another thing is when i program the same code for port0 it's not working......for port 1 and 2 the light is dimmer...i dont want that

Children