Read/Write to GPIO!

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Read/Write to GPIO!

2,334件の閲覧回数
ali_
Contributor I
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;

while(1)
{
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.
ali

The chip i'm using is 56f801 .
ラベル(1)
0 件の賞賛
2 返答(返信)

403件の閲覧回数
ali_
Contributor I
I can see 20 views but no one bothered to answer;-) Not that fun.


ali
0 件の賞賛

403件の閲覧回数
J2MEJediMaster
Specialist I
Not much here to go on.

1) Are you configuring the register for read and write operations prior to accessing it? Can you see that you read the contents of the register successfully?

2) If indeed you are incrementing the value by a factor of two, you'd probably want to perform a shift on register X0's contents, rather than use an add instruction?

---Tom
0 件の賞賛