View previous topic :: View next topic |
Author |
Message |
jujoab
Joined: 05 Aug 2017 Posts: 41 Location: brazil
|
printf to the mplab "UART 1 OUTPUT" simulator outp |
Posted: Sat Sep 09, 2017 12:45 pm |
|
|
I found several topics on this forum about "mplab X and ccs compiler", but in no one I was able to find the solution for getting a ccs compiled program to printf to the "UART 1 OUTPUT" of the MPLAB X.
Same program (compiled with the Microchip XC) works very nicely redirecting the usart output to the mentioned MPLAB X window.
How can do same using the CCS C ????
Thanks in advance
juan |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19553
|
|
Posted: Sat Sep 09, 2017 1:03 pm |
|
|
Provided your code has the #use rs232 setup to talk to the hardware UART, it works.
The simulator con only simulate the hardware UART, so if you have configured a soft UART, it won't work.
with:
#USE RS232(UART1, baud=9600, stream=RS2321)
fprintf(RS2321,"Test string\r");
will print to the simulator. |
|
|
jujoab
Joined: 05 Aug 2017 Posts: 41 Location: brazil
|
|
Posted: Sat Sep 09, 2017 5:27 pm |
|
|
Ttelmah wrote: | Provided your code has the #use rs232 setup to talk to the hardware UART, it works.
The simulator con only simulate the hardware UART, so if you have configured a soft UART, it won't work.
with:
#USE RS232(UART1, baud=9600, stream=RS2321)
fprintf(RS2321,"Test string\r");
will print to the simulator. |
Perfect.
Thanks very much.
I am STILL working on it because it worked ALL RIGHT with a 18F4450, but still having troubles with the chip I wanted, the 16f1709.
It has something to do with chip select.
I'll report back when finding the solution.
THANKS AGAIN
JUAN |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9246 Location: Greensville,Ontario
|
|
Posted: Sat Sep 09, 2017 5:40 pm |
|
|
You should have said what PIC in your first post.
If memory serves me right (it gets fuzzy once in awhile...), the 1709 has PPS in it, so you have to specify the pin to be the UART TX.
There is a 'sticky' up top to help with coding PICs with PPS.
Jay |
|
|
jujoab
Joined: 05 Aug 2017 Posts: 41 Location: brazil
|
|
Posted: Sat Sep 09, 2017 8:06 pm |
|
|
temtronic wrote: | You should have said what PIC in your first post.
If memory serves me right (it gets fuzzy once in awhile...), the 1709 has PPS in it, so you have to specify the pin to be the UART TX.
There is a 'sticky' up top to help with coding PICs with PPS.
Jay |
hi Jay
Thanks a lot, once again.
for the 16F1709 the following pin assignments solve the situation
#pin_select U1RX = PIN_C7
#pin_select U1TX = PIN_C6
working 100%
have a nice weekend
juan |
|
|
|