MC9S12C32 - writing to parallel port

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

MC9S12C32 - writing to parallel port

1,474件の閲覧回数
LisaJ
Contributor I
Hi,

I have this simple code that doesn't work. I use port T on the HC12 to read AND write to the parallel port on my PC.

Reading goes well, but when I test writing on the same bit nothing happens.
Here is the code:
******************************************** START OF CODE *************************

// set Port T as output
DDRT_DDRT0 = 1; // set direction of Port T bit 0 as output
DDRT_DDRT1 = 1; // set direction of Port T bit 1 as output
DDRT_DDRT2 = 1; // set direction of Port T bit 2 as output

//write to parallel

PTIT_PTIT0 = 0;
PTIT_PTIT1 = 0;
PTIT_PTIT2 = 0;

*********************************** END OF CODE ******************************

As I mentioned before Port T is connected to bits 0 1 and 2 of the parallel port, and can read from them if I define its direction to be input. But writing just doesn't work even though with other methods writing is possible.

Any idea what am I doing wrong???

thanks

Message Edited by Lisa J on 2007-02-2312:31 AM

ラベル(1)
0 件の賞賛
返信
1 返信

730件の閲覧回数
kef
Specialist I
PTIT (PTIT_PTIT0, PTIT_PTIT1) is read only register. Use PTT register.
0 件の賞賛
返信