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

nid help on LED blinking

i have problem with the led blinking. I using the exmaple program given by keil using uVision3. When i run the program, the LED on the development board didnt blink, it just stay on! wat should i do?

thanks!

Parents
  • Yes. The formula is simple:

    a*1 + b*2 + c*4 + d*8 + e*16 + f*32 + g*64 + h*128
    

    You have eight bits. Each having a bit position, i.e. a value of 1, 2, 4, 8, 16, 32, 64 or 128. The datasheet will tell what happens if you write a one or a zero to the bit. And it will tell if the relevant port has a data direction register, or if it only supports a open-drain transistor with a weak pull-up.

    Now add together the relevant bit values. You do not post and ask how to sum the money to pay at the cafeteria. No need to ask how to sum the individual bits for the I/O ports either. And you should also be able to find a huge amount of sample code that shows how to use port pins as inputs and/or outputs. How much time have you spent reading datasheets and code in the week since this thread started? You should be quite comfortable with this by now.

Reply
  • Yes. The formula is simple:

    a*1 + b*2 + c*4 + d*8 + e*16 + f*32 + g*64 + h*128
    

    You have eight bits. Each having a bit position, i.e. a value of 1, 2, 4, 8, 16, 32, 64 or 128. The datasheet will tell what happens if you write a one or a zero to the bit. And it will tell if the relevant port has a data direction register, or if it only supports a open-drain transistor with a weak pull-up.

    Now add together the relevant bit values. You do not post and ask how to sum the money to pay at the cafeteria. No need to ask how to sum the individual bits for the I/O ports either. And you should also be able to find a huge amount of sample code that shows how to use port pins as inputs and/or outputs. How much time have you spent reading datasheets and code in the week since this thread started? You should be quite comfortable with this by now.

Children