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

rs232

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







rs232
PostPosted: Tue Apr 16, 2002 3:40 pm     Reply with quote

Hi

I am experimenting with rs232 communication.

I' ve send characters to a computer, this is easy.

Now I like to read characters from this computer(a value) into my pic. (16F877).

Is it possible with a terminal programm????
Are there free terminal programms avaliable

I'm looking for an example, how to read a value from a rs232 connection (PC) into my pic.

Thanks a lot,
___________________________
This message was ported from CCS's old forum
Original Post ID: 3824
Jay
Guest







Re: rs232
PostPosted: Wed Apr 17, 2002 1:55 am     Reply with quote

Try HyperTerminal (standard in most Windows versions)

Regards,

:=Hi
:=
:=I am experimenting with rs232 communication.
:=
:=I' ve send characters to a computer, this is easy.
:=
:=Now I like to read characters from this computer(a value) into my pic. (16F877).
:=
:=Is it possible with a terminal programm????
:=Are there free terminal programms avaliable
:=
:=I'm looking for an example, how to read a value from a rs232 connection (PC) into my pic.
:=
:=Thanks a lot,
___________________________
This message was ported from CCS's old forum
Original Post ID: 3828
Jay
Guest







Re: rs232
PostPosted: Wed Apr 17, 2002 1:56 am     Reply with quote

Try HyperTerminal (standard in most windows versions)

Regards,
Jay

:=Hi
:=
:=I am experimenting with rs232 communication.
:=
:=I' ve send characters to a computer, this is easy.
:=
:=Now I like to read characters from this computer(a value) into my pic. (16F877).
:=
:=Is it possible with a terminal programm????
:=Are there free terminal programms avaliable
:=
:=I'm looking for an example, how to read a value from a rs232 connection (PC) into my pic.
:=
:=Thanks a lot,
___________________________
This message was ported from CCS's old forum
Original Post ID: 3830
rvdbogae
Guest







Re: rs232 whats wrong
PostPosted: Wed Apr 17, 2002 5:19 am     Reply with quote

This rs232 example does not work at all,
what is wrong??

Thanks



#include <16f877.h>

#fuses HS,NOWDT,NOPROTECT

#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)


main() {
printf("start");
while(TRUE)
putc( getc()+1);

}
___________________________
This message was ported from CCS's old forum
Original Post ID: 3832
Sherpa Doug
Guest







Re: rs232 whats wrong
PostPosted: Wed Apr 17, 2002 7:59 am     Reply with quote

Are you using a software UART? I am not familliar with the 16f877). If so getc() will return what is sees in the input pin when it is called. This will probably be $00 or $ff depending on how the serial line is setup. Getc() does not wait for the next character to come along. You need to make sure the line is at Stop bit level, then wait for it to begin a Start bit, then call getc(). Look at the kbhit() function.

:=This rs232 example does not work at all,
:=what is wrong??
:=
:=Thanks
:=
:=
:=
:=#include <16f877.h>
:=
:=#fuses HS,NOWDT,NOPROTECT
:=
:=#use delay(clock=20000000)
:=#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)
:=
:=
:=main() {
:= printf("start");
:= while(TRUE)
:= putc( getc()+1);
:=
:=}

___________________________
This message was ported from CCS's old forum
Original Post ID: 3836
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