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

HELP ON RS232 AND PIC16F877

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



Joined: 23 Mar 2004
Posts: 7

View user's profile Send private message Yahoo Messenger MSN Messenger

HELP ON RS232 AND PIC16F877
PostPosted: Tue Mar 23, 2004 6:11 am     Reply with quote

hi, i'm blur with this microcontroller. i need to read an 8-bit data from memory buffer (external hardware) and send it through serial port into a PC. i don't know how to setup the PIC16F877 so i can transmit 8 bit data serially to the PC using Tx and Rx pin. i'm using C++ programming, but i stuck about how to send the reading 8 bit data to the PC and i can read data. (the memory buffer contains the information from the CMOS camera).

hope anyone can help me with this thing. thanks.
Haplo



Joined: 06 Sep 2003
Posts: 659
Location: Sydney, Australia

View user's profile Send private message

PostPosted: Tue Mar 23, 2004 7:00 am     Reply with quote

You are using C++? So you are not using CCS?
If you are using CCS, you can use the #use RS232 statement to define a serial port and then communicate using the built-in functions (such as printf(), getc() and putc()). PIC16F877 has a hardware serial port on pins C6 and C7 so you can use this:
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)

Refer to compiler manual for more information.
mizi_suichiro



Joined: 23 Mar 2004
Posts: 7

View user's profile Send private message Yahoo Messenger MSN Messenger

PostPosted: Tue Mar 23, 2004 7:08 am     Reply with quote

i'm using CCS, and using C languange to make the microcontroller work. if i set the RS232 function like you says, so i just using function printf() to send the data to PC? is it right? can you give me a little bit example of the programming. thanks.
Haplo



Joined: 06 Sep 2003
Posts: 659
Location: Sydney, Australia

View user's profile Send private message

PostPosted: Tue Mar 23, 2004 4:30 pm     Reply with quote

That is right. Look at the EX_SQW.C file in your \Examples directory. It explaines things pretty well.
Guest








PostPosted: Wed Mar 24, 2004 4:07 am     Reply with quote

thanks!!
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