port manipulation-turning pin on and off quickly w/o disturbing other pins

Hi!!
I am using arduino Due board and the pin number 10 and 12 are used as output pins and their states are controlled by a set of codes which check for a condition to be true.
I wanted to turn the pin number 11 on and off quickly without much pain to the board so i decided to use port manipulation and do something like this

PORTB = B00011100
PORTB = B00010100

But my question is - By doing this am i controlling the output of the pins 10 and 12 too? and if yes then how can i turn just the pin number 10 on and off w/o disturbing the functioning of other pins?

PS: The pins 10 and 12 will remain on when 10 will go from on to off.

@pranesh...

Please see the discussion "Arduino DUE How to Direrct Port Access?" which you asked the same question... Reply at bottom ... @pranesh

by using the OR/EQUALS... you can use the following technique to ensure only the pin in question is affected... and... The use of the SET register also ensures only the set bits will move to the SET position... handy... a separate CLEAR register does the same for desired clear bits...

however if you are looking for pin 11 on the DUE... according to the documentation listed per the other discussion, pin 11 on the DUE is on PORTD, pin 7...
Which means you may be accessing the the wrong port...

REG_PIOD_SODR |= (0x01 << 7) may do it for you? This shifts a one bit into the bit 7 position for use in the Set Output Data Register (SODR)
also, for turning off...
REG_PIOD_CODR |= (0x01 << 7) will turn it off... Clear Output Data Register (CODR)
For other registers (after looking up the REAL PORTS and PINS) substitute PIOx with the appropriate PORT (x=A,B,C,D,E,F)

Tim

Thank you very much for guiding me in the right direction !! :smiley:
I am almost there but one glitch is still there. Can you take a look at this code....

const int andpin = 20;
const int incremental = 3;                                            // interrupt 1
const int ledPin = 12;                                                // injector pin
const int spark = 11;
volatile int counter = 0;                                             // to count 360 degrees 
volatile int match = 0;
volatile float s_o_i = 300.0;                                             // start of injection
volatile float e_o_i = 360.0; 
volatile float sprk_time_on = 330.0;

void setup()
{
  Serial.begin(115200);   // initialize serial communication
  pinMode(incremental, INPUT);
  pinMode(ledPin, OUTPUT); 
  pinMode(spark, OUTPUT); 
  digitalWrite(ledPin,LOW);  
  digitalWrite(spark,LOW);
  attachInterrupt(20,andisr,RISING);
  attachInterrupt(3,count,RISING);
}

void count()                                                          // ISR
{
  if (match == 1)
  {
    if(counter == s_o_i)
          {
            REG_PIOD_SODR |= 0x01 << 8;
          }
    if(counter == sprk_time_on)
          {
             REG_PIOD_SODR |= 0x01 << 7;
          }
    if(counter == sprk_time_on + 5.0)
          {
             REG_PIOD_CODR |= 0x01 << 7;
          }
    if(counter == e_o_i)
          {
            REG_PIOD_CODR |= 0x01 << 8;
            counter = 0;
            match = 0;
           }
    counter++;
  }
}

void andisr()
{
  match = 1;
}
void loop()
{
}

If i run this code, every thing goes right but the PD8 and PD7 i.e pin no 12 and 11, misses one pulse in some number of pulses...like for every 10 pulses it misses one pulse and it is irregular, it may be possible that it does not miss a single pulse in 20 30 pulses but i am not able to figure out what is the cause of this.
May be if i make the code more efficient it may not miss. Please help me....