Conflicts of IOs and serial output

Questions about the BASICtools and MakeItC
Post Reply
danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Conflicts of IOs and serial output

Post 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?



danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Re: Printf Doesn't Write To Terrminal

Post by danlee58 »

I found my problem. I overwrote PCB_PINSEL0 and cleared the wrong location.

danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Re: Printf Doesn't Write To Terrminal

Post 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;

basicchip
Posts: 1029
Joined: Fri Oct 19, 2012 2:39 am
Location: Lake Tahoe, CA
Contact:

Re: Printf Doesn't Write To Terrminal

Post 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.

danlee58
Posts: 210
Joined: Thu Jan 17, 2013 2:29 am

Re: Printf Doesn't Write To Terrminal

Post 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.

basicchip
Posts: 1029
Joined: Fri Oct 19, 2012 2:39 am
Location: Lake Tahoe, CA
Contact:

Re: Conflicts of IOs and serial output

Post by basicchip »

If P0.10 is set as MATCH, then you can't control it via FIO/GPIO

Post Reply