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

PIC 16F767 rs232 Read Problems

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



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Mar 08, 2005 3:19 pm     Reply with quote

Try a more simple test program, and also include a #fuses statement.
Try sending characters to the PIC by typing in a terminal program.
You should see them echo'ed back to the terminal.
Code:
#include <16F767.h>
#fuses HS, NOWDT, NOPROTECT, BROWNOUT, PUT
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)

void main()
{
char c;

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


Note that this PIC doesn't support Low Voltage Programming, so the
LVP and NOLVP fuses are not an issue here.
chipp



Joined: 08 Mar 2005
Posts: 2

View user's profile Send private message

It Works!
PostPosted: Thu Mar 10, 2005 11:46 am     Reply with quote

Thank you, simple as it is it works, it seems like setting the TRIS on Port C was somehow interferring, so I commented it out:

Code:

//    set_tris_c(0x10000000); // C7 rx, C6 tx

fuzzy



Joined: 26 Feb 2005
Posts: 64

View user's profile Send private message

PostPosted: Thu Mar 10, 2005 2:54 pm     Reply with quote

I had a similar problem, my pic received all what he transmitted!!

I solved setting in a correct way TrisC.

in your case 0x10000000 is a hexadecimal number not a binary one.

tri to set 0b10000000 or 0x80 in TRISC
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