CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

printf to the mplab "UART 1 OUTPUT" simulator outp

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jujoab



Joined: 05 Aug 2017
Posts: 41
Location: brazil

View user's profile Send private message

printf to the mplab "UART 1 OUTPUT" simulator outp
PostPosted: Sat Sep 09, 2017 12:45 pm     Reply with quote

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: 19506

View user's profile Send private message

PostPosted: Sat Sep 09, 2017 1:03 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Sep 09, 2017 5:27 pm     Reply with quote

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: 9225
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Sep 09, 2017 5:40 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Sep 09, 2017 8:06 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group