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

how to manipulate values at the ports

can i manipulate the values at the port pins individually,,

i.e., if i want the 6th pin of port0 to be high, can i assign 1 to that particular pin, without disturbing the other port pin values???? if yes, please tell me how

(i am a beginner)

Parents
  • dude...
    but in the example, P0=j was given where j is a hexa no. here its good that i can set/reset each and every bit individually...

    but in my program,,

    the command is ..... PORTA.0=k; (this is the command i used in CVAVR compiler, to set/reset the 0th bit of port A depending upon the value of k which is a run time variable. more specifically speaking k is actually k[1] i.e., it is an element in an array whose value changes in the program).

    so obviously i cant use k for the whole port (similar to the one used in the blinky example in the keil compiler)

    ANY SUGGESTIONS PLEASE..........

Reply
  • dude...
    but in the example, P0=j was given where j is a hexa no. here its good that i can set/reset each and every bit individually...

    but in my program,,

    the command is ..... PORTA.0=k; (this is the command i used in CVAVR compiler, to set/reset the 0th bit of port A depending upon the value of k which is a run time variable. more specifically speaking k is actually k[1] i.e., it is an element in an array whose value changes in the program).

    so obviously i cant use k for the whole port (similar to the one used in the blinky example in the keil compiler)

    ANY SUGGESTIONS PLEASE..........

Children