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)
Yes you can. Your processor is a champ at doing single-bit operations.
Take a look at the sample code that gets installed with the compiler. There is code showing how to flash a LED, but a lot of other useful examples too.
And the processor manufacturer will also have a number of application examples you should download and take a look at. The examples are specifically intended to get new users up and running quickly.
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..........
is there any way where we can directly assign either 0/1 to a particular port pin of the 8051 controller?? i.e., without considering the other pins into picture.
can i use something like this.....
like PORT1.3=k (where it means pin3 of port1 should be k where k is a run time variable)
Yes, the processor can support direct assign of single bits on the port. But "dude" can probably help you more.
I don't have any C51 compiler installed at home, but did do a grep and did find Keil example code that did bit assigns to individual port pins.
View all questions in Keil forum