Abdul Razaq

Read/Write to GPIO!

Discussion created by Abdul Razaq on Oct 13, 2006
Latest reply on Oct 16, 2006 by Tom Thompson
Folks! any thoughts for incrementing the value on GPIO_B_DR register? I want to increment the GPIO_B_DR value with factor of tow after every iteration but no luck so far;-) I'm getting the '0' value every time.

Any pointros to freescale usenet community/archive will be great help as people here don't seem that much participating for simple questions;-)

register po;

asm(move #$0002 , X:GPIO_B_DR);
po = 0;

asm(move X:GPIO_B_DR , X0);
asm(move X0 , po);

po = po + 2;

asm(move X0 , po);
asm(move X:GPIO_B_DR , X0);


Let me put elaborate my question again. I want to write some value to GPIO b port and then i want o read that value do something (say increment or decrement) before updating (writing back) the B port again.

Thanks for your time.

The chip i'm using is 56f801 .