MC9S12C32 - writing to parallel port

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MC9S12C32 - writing to parallel port

1,008 Views
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

Labels (1)
0 Kudos
1 Reply

264 Views
kef
Specialist I
PTIT (PTIT_PTIT0, PTIT_PTIT1) is read only register. Use PTT register.
0 Kudos