Page 1 of 1

Conflicts of IOs and serial output

Posted: Sat Nov 28, 2015 3:08 pm
by danlee58
I am debugging a C program for a SuperPro. I put in a printf statement to print the value of a variable to the terminal, so I can monitor the program. Printf doesn't print anything to the terminal from that program. If I load an older program, with the same print statement, I see the value on the terminal, as expected.

Example:
int TIME = 0XC350;
printf("%d\n", TIME );

I set SystemInit();
UART_init(0,19200);
SCB_PCONP = 0x03C8925E;

What am I doin g wrong?

Re: Printf Doesn't Write To Terrminal

Posted: Sat Nov 28, 2015 4:30 pm
by danlee58
I found my problem. I overwrote PCB_PINSEL0 and cleared the wrong location.

Re: Printf Doesn't Write To Terrminal

Posted: Sat Nov 28, 2015 6:57 pm
by danlee58
Now that printf is working, I have found that I can't read P0.29. I defined both P0.29 & P0.30 as Inputs.

PCB_PINSEL1 = 0X03240000;

Re: Printf Doesn't Write To Terrminal

Posted: Sat Nov 28, 2015 10:20 pm
by basicchip
Take a look at section 9.5.1 of the user manual which describes how P0.29 and P0.30 are linked and not completely independent.

As long as they are both inputs or both outputs, I have had no issue controlling them.

Re: Printf Doesn't Write To Terrminal

Posted: Sun Nov 29, 2015 3:17 am
by danlee58
I found that problem also. I had set PCB_PINSEL0 for Match 3.0 on P0.10, then changed P0.10 to an OUTPUT pin, but didn't delete the Match 3.0 selection. The output from P0.10 is a function of P0.29 input. P0.29 input is OK, the problem was P0.10 output.

Re: Conflicts of IOs and serial output

Posted: Sun Nov 29, 2015 9:25 pm
by basicchip
If P0.10 is set as MATCH, then you can't control it via FIO/GPIO