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?
Conflicts of IOs and serial output
Re: Printf Doesn't Write To Terrminal
I found my problem. I overwrote PCB_PINSEL0 and cleared the wrong location.
Re: Printf Doesn't Write To Terrminal
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;
PCB_PINSEL1 = 0X03240000;
Re: Printf Doesn't Write To Terrminal
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.
As long as they are both inputs or both outputs, I have had no issue controlling them.
Re: Printf Doesn't Write To Terrminal
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
If P0.10 is set as MATCH, then you can't control it via FIO/GPIO