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

rs232 prints rubish
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
scanan



Joined: 13 Aug 2004
Posts: 69
Location: Turkey

View user's profile Send private message Visit poster's website

PostPosted: Fri May 09, 2025 7:53 am     Reply with quote

temtronic wrote:
curious....
you've made several changes so could you please post the program and the printout ?
thanks


set_tris_a(0b00001000); //0x08
set_tris_b(0b11000100); //0xC4
set_tris_c(0b10100000); //0xA0
set_tris_d(0b00000000); //0x00
set_tris_e(0b00001000); //0x08

TX and RX are situated at pinc6 and c7 respectively


#use delay(clock=64000000,RESTART_WDT)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,ERRORS)

void version(void)
{

//------------------------------------------------------------------------------
//-- firmware version
//------------------------------------------------------------------------------

printf("\r\nTelemmote Receiver\r\n");
printf("TLM-02\r\n");
printf("Firmware v1.00\r\n");
printf("Compiled on \r\n");
printf(__DATE__);
printf("\r\n");
printf(__TIME__);
printf("\r\n");

//------------------------------------------------------------------------------
}

should work flawlesly but result is

U V W $ Y YZ Y C irmware v1.00
Compiled on
07-May-25
11:20:24
_________________
Dr Suleyman CANAN
R&D Electronic Engineer
https://suleymancanan.wordpress.com

Do whatever you do with amateur spirit -
But always feel professional.
temtronic



Joined: 01 Jul 2010
Posts: 9475
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri May 09, 2025 9:13 am     Reply with quote

Hmm....you don't have the 'delay_ms(250);' just before the first print.
allenhuffman



Joined: 17 Jun 2019
Posts: 621
Location: Des Moines, Iowa, USA

View user's profile Send private message Visit poster's website

PostPosted: Fri May 09, 2025 9:54 am     Reply with quote

One of the four PIC24 boards I maintain had an issue with unreliable serial output, and it ended up being caused by a timer ISR. I had to move it to a different timer and then the output worked fine.

I have no idea why that was, but left myself a TODO in the comments to look into it... some day.
_________________
Allen C. Huffman, Sub-Etha Software (est. 1990) http://www.subethasoftware.com
Embedded C, Arduino, MSP430, ESP8266/32, BASIC Stamp and PIC24 programmer.
http://www.whywouldyouwanttodothat.com ?

Using: 24FJ256GA106, 24EP256GP202 and 24FJ64GA002.
Ttelmah



Joined: 11 Mar 2010
Posts: 19831

View user's profile Send private message

PostPosted: Fri May 09, 2025 11:38 am     Reply with quote

Show your fuses.
How is the 64MHz generated????.
Show how the main code starts, and calls 'version'.
Did PUT make no difference at all?.
temtronic



Joined: 01 Jul 2010
Posts: 9475
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri May 09, 2025 2:44 pm     Reply with quote

we really need to see the complete program !
Ttelmah



Joined: 11 Mar 2010
Posts: 19831

View user's profile Send private message

PostPosted: Fri May 09, 2025 11:54 pm     Reply with quote

More to the point, you really need to generate a basic test program that just
shows the issue. Simple main, and the code to call the version display.
Doing this then proves there isn't something hidden causing the issue as
Allen describes. Then post this.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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