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.