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

Unwanted RS232 Echo

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



Joined: 07 Sep 2003
Posts: 8
Location: Shrewsbury, UK

View user's profile Send private message

Unwanted RS232 Echo
PostPosted: Thu Mar 24, 2011 9:12 am     Reply with quote

Hi,

I'm having problems with the CCS 'get_string' function. When I read in a series of characters (on the RX port), each character is echoed back from the TX port as they are typed. Is this usual or even expected?

I don't want the characters echoed back - is there a way of acheiving this?

Ive posted a snippet of code below, which produces the unwanted echo from the TX port.

Code:

#include <18F4423.h>
#fuses HS,NOWDT,NOLVP
#use delay(clock=16000000)
#use rs232(baud=57600,xmit=PIN_C6,rcv=PIN_C7)
#include <input.c>

char message[9]; //Input string

void main(void)
{
   while(1)
   {
      get_string(message,8);  //Get input string
     if (message[0]=='?')
      printf("Got a ?\r\n");     //send "?" if received, else do nothing
   }
}
Ttelmah



Joined: 11 Mar 2010
Posts: 19529

View user's profile Send private message

PostPosted: Thu Mar 24, 2011 9:19 am     Reply with quote

The source code for the get_string function, is in input.c.....
It is designed for 'user input'. I.e. somebody typing the string in. So it echos the string to the display.
To just read the input without echoing, just copy the code call it something like 'my_get_string', and remove the putc instructions from it (four of them).

Best Wishes
rngolding



Joined: 07 Sep 2003
Posts: 8
Location: Shrewsbury, UK

View user's profile Send private message

PostPosted: Fri Mar 25, 2011 3:16 am     Reply with quote

Thanks Ttelmah - that works fine.

Best Regards
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