View previous topic :: View next topic |
Author |
Message |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
How to get the UART1 tab to appear in MPLAB X output window? |
Posted: Fri Aug 14, 2020 2:56 pm |
|
|
I've selected the tickbox for "Enable UART1 i/o" in the Project Properties/
Simulator window. I've selected output to a window.
Then I compile and run my program in Debug mode in MPLAB X.
It's supposed to display the UART1 tab in the Output Window and display
text from my printf statements. But it doesn't ever do it.
Is there some hidden trick to this ? Does this feature work with CCS,
or is it only with XC8 ?
MPLAB X vs. 5.35
CCS Plugin vs. 3.12
PIC 16F1847
CCS compiler vs. 5.092 |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19499
|
|
Posted: Sat Aug 15, 2020 1:33 am |
|
|
It should appear in the menu of available windows, as soon as something is
actually sent to the UART.
Just made a really basic program, set it up with this option, and simulator,
then selected debug main project. Put a halt at the first fprintf line.
Ran. No window. Then stepped over the line (so a message is sent to the
UART), and as soon as I did this, the tab 'UART 1 Output' appears.
This is what MicroChip says should happen. The window should appear as
soon as data is sent to the UART, when you run the program in the
simulator.
Double check you have got this project set as the main project (otherwise
it could be debugging something else..). |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Aug 15, 2020 1:39 am |
|
|
It didn't work for me. Can you post your basic program ?
I'll make a new project for it and test it.
What's your version of MPLAB X ? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19499
|
|
Posted: Sat Aug 15, 2020 8:18 am |
|
|
OK.
Code: |
#include <18F1320.h>
#use delay(internal=8MHz)
#FUSES NOWDT //No Watch Dog Timer
#use rs232(UART1, baud=9600, stream=DEBUG, ERRORS)
void main()
{
unsigned int16 value = 0x00000139;
fprintf(DEBUG,"%4d\r\n", value); // Outputs " 313" as expected
fprintf(DEBUG,"%4.2w\r\n", value); // Outputs " 3.13" as expected
while(TRUE)
{
delay_cycles(1);
}
}
|
5.35. Also tried with 5.30. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Aug 15, 2020 12:07 pm |
|
|
Well, nothing's going to happen anytime soon on this, because perhaps
foolishly, while waiting for your reply, I un-installed vs. 5.35 and installed
vs. 5.40.
But then vs. 5.40 says it needs JRE vs. 1.7 or higher, and of course it's
not installed by 5.40, nor does 5.40 even tell me during installation that
it needs it. But I sort of remember something like this from the past.
So then I install Oracle Java (the latest), but MPLAB X doesn't even know
it's there. Yes, I know I could go in and try to change the path, but
instead I give up. I decide to go back to vs. 5.35.
So, I look in Control Panel / List of installed programs, and MPLAB X is
not even listed. So then I go to Programs / Program Files (x86) and
find it there, and click on Un-install. Then it tells me "This App can't run
on this PC". Cute. I try running as Admin, I try compatiblity with
Windows 7, no go. At this point I am disgusted with Microchip.
I'm running Windows 10 Pro vs. 1909.
I am now going to try to re-install vs. 5.35. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19499
|
|
Posted: Sat Aug 15, 2020 12:51 pm |
|
|
Actually I'd suggest going back to 5.30.
I realise, I launched the project in 5.30, before 5.35. Wonder if this
caused the different behaviour....
I have three versions on the system at present.
In common with MPLAB-X itself, I don't 'trust' the new versions. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Aug 15, 2020 9:45 pm |
|
|
With MPLAB X vs. 5.30 it finally works.
Thank you, Ttelmah. |
|
|
|