MC9S12C32 - writing to parallel port

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MC9S12C32 - writing to parallel port

1,466 次查看
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 回复

722 次查看
kef
Specialist I
PTIT (PTIT_PTIT0, PTIT_PTIT1) is read only register. Use PTT register.
0 项奖励
回复