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

  • You are obviously an idiot. I will not waste any more of my valuable time on you. Goodbye.

  • i am begginer to this microcontroller things.
    i am software developer from cs background, but i have interest in this.
    i am doing the basic led blink project same as example given with the software.
    when i copied the code and converted to hex it's not working.....what is the problem

  • If you created your own project but using same code as a working example, then it's time to check the project file options.

    Does it build for the correct processor? The correct memory regions?

  • 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

  • What other "arbitrary" value? Note that 32000 is close to the limit for a signed integer.

    Next thing - repeating the port output 32000 times isn't the way to create a delay. You really should separate the delay functionality from turning on or off the port pins. Your code would greatly change blink frequency if you add some extra lines of code inside the for loops. Having a delay function giving 100ms delay would mean that extra code together with the "port on" or "port off" would make an extremely small change in blink frequency.

  • please show me using some code..
    and please explain me about port0

  • when i am connecting my leds to port1 they are very dimm...
    and actually i am going to built led cube......so for one led it's so dimmmer how would expect dark light with so many led's....
    and please explain me how i connect npn transistors in the led cube...
    and explain the circuit diagram of transistor with simple one led connection.....i am not able to understand the concept of transistor....

  • Are you saying that you have totally failed to find that information by the use of Google?

    Both the use of transistors, and the design of LED cubes, is well described on the net. And the big difference with Google is that it can link to pages that have images and diagrams - this forum only supports text.