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

Trouble getc() ing characters with serial
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
michellelicious



Joined: 15 Apr 2007
Posts: 3

View user's profile Send private message Send e-mail Yahoo Messenger

To PCM programmer
PostPosted: Tue May 08, 2007 8:45 pm     Reply with quote

PCM programmer wrote:
Try a simple program below, that echoes back the characters that
you type in to the terminal window. It should work.
Code:

#include <16F876A.h>
#fuses XT,NOWDT,NOPROTECT,BROWNOUT,PUT,NOLVP
#use delay(clock=4000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)

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

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

}




This does not work for me!!! But why? The code is simple. I can only receive FROM PIC but the pic itself is not getc()ing anything.

CCS 4.013

PIC16f877 and 16f877a
Max232

Hyperterminal and Serial Port monitor

Thanx for any response
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue May 08, 2007 9:40 pm     Reply with quote

I don't have 4.013, but I do have 4.014. I tested it just now with that
verison, with a 16F877 and a PicDem2-Plus board. It works. It probably
also works with 4.013, because this type of simple program is likely what
CCS used to do some sort of pass-fail test on the version.

If you built your own board, then buy a pre-made board from some company. If you're using Proteus, then buy a real hardware board.
If you built your own serial cable, then buy a cable.
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