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 support@ccsinfo.com

Simple question about 16F628 RS232

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



Joined: 08 Nov 2005
Posts: 28

View user's profile Send private message

Simple question about 16F628 RS232
PostPosted: Mon Nov 14, 2005 12:28 am     Reply with quote

I try to use other pins other than B1 and B2 to do RS232 but the data i m receiving is not correct. Izzit possible to use other pins to do RS232 or is there anything i should do to make it possible?

I have declared it correctly.

Thank you.
asmallri



Joined: 12 Aug 2004
Posts: 1630
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

Re: Simple question about 16F628 RS232
PostPosted: Mon Nov 14, 2005 12:54 am     Reply with quote

leesing2k3 wrote:
I try to use other pins other than B1 and B2 to do RS232 but the data i m receiving is not correct. Izzit possible to use other pins to do RS232 or is there anything i should do to make it possible?

I have declared it correctly.

Thank you.


You can use any I/O pins that are free. You have not given any clue as to what your problem is. Without a crystal ball there is nothing else I can suggest.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Nov 14, 2005 12:57 am     Reply with quote

What pins are you using ?

Try this simple program with a terminal program running on your PC.
This program just returns the same character that was sent to it.
Substitute your pins for B2 and B1. See if it works.

If it doesn't work, then post your version of the compiler.
Code:
#include <16F628.H>
#fuses XT, NOWDT, NOPROTECT, BROWNOUT, PUT, NOLVP
#use delay(clock = 4000000)
#use rs232(baud=9600, xmit=PIN_B2, rcv=PIN_B1, ERRORS)

//======================================
void main()
{
char c;

while(1)
  {
   c = getc();
   putc(c);
  }
     
}
leesing2k3



Joined: 08 Nov 2005
Posts: 28

View user's profile Send private message

PostPosted: Mon Nov 14, 2005 8:52 am     Reply with quote

thank you very much
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