Lisa Johnson

MC9S12C32 - writing to parallel port

Discussion created by Lisa Johnson on Feb 23, 2007
Latest reply on Feb 23, 2007 by kef
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

Outcomes