Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 8th January 2004, 08:41 AM   #1
Default rs232 serial interface pic16f877

i want to interface rs232 of pc with pic16f877.
in pic side i like to use inbuilt serial ports
how can use the serial ports of pic16f877
give me some examples for initilize pins,configure serial port,baud rate settingsand everything
pinky is offline  
Old 8th January 2004, 09:04 AM   #2
Default Re: rs232 serial interface pic16f877

Quote:
Originally Posted by pinky
i want to interface rs232 of pc with pic16f877.
in pic side i like to use inbuilt serial ports
how can use the serial ports of pic16f877
give me some examples for initilize pins,configure serial port,baud rate settingsand everything
Look at my RS232 tutorial at http://www.winpicprog.co.uk, one of the later ones uses the USART in a 16F876.
Nigel Goodwin is offline  
Old 8th January 2004, 05:32 PM   #3
Default

Do you need to use a MAX232 or equivalent on this PIC?
crust is offline  
Old 8th January 2004, 07:44 PM   #4
Default

Quote:
Originally Posted by crust
Do you need to use a MAX232 or equivalent on this PIC?
If you want to use the hardware USART you have to have inverters on the input and output (which is what a MAX232 does, and what it's designed to operate with), but if you do software RS232 you can use a simple (crude!) resistor - like the BASIC STAMP does.
Nigel Goodwin is offline  
Old 9th January 2004, 04:52 PM   #5
Default rs232 serial interface pic16f877

To set up the 232 in the pic16f877.h add :
#use rs232(baud=9600 ,xmit=PIN_C6,rcv=PIN_C7)

also youll want to define:
#define puts(s) {printf(s); putchar(13); putchar(10);}

#use fixed_io(C_OUTPUTS=PIN_C6)
#byte port_C=7


in the .c code i used: printf(" hello world");
to sent the string to the serial buffer on the p.c. to my v.b program

hope this helps
Vinny123 is offline  
Old 9th January 2004, 04:53 PM   #6
Default Re: rs232 serial interface pic16f877

Quote:
Originally Posted by Nigel Goodwin
Quote:
Originally Posted by pinky
i want to interface rs232 of pc with pic16f877.
in pic side i like to use inbuilt serial ports
how can use the serial ports of pic16f877
give me some examples for initilize pins,configure serial port,baud rate settingsand everything
Look at my RS232 tutorial at http://www.winpicprog.co.uk, one of the later ones uses the USART in a 16F876.
To set up the 232 in the pic16f877.h add :
#use rs232(baud=9600 ,xmit=PIN_C6,rcv=PIN_C7)

also youll want to define:
#define puts(s) {printf(s); putchar(13); putchar(10);}

#use fixed_io(C_OUTPUTS=PIN_C6)
#byte port_C=7


in the .c code i used: printf(" hello world");
to sent the string to the serial buffer on the p.c. to my v.b program

hope this helps
Vinny123 is offline  
Old 21st January 2004, 06:28 PM   #7
Default rs232 code

I hope this can help you if you still stuck
jjegarcia is offline  
Old 9th February 2004, 03:38 PM   #8
Default MAX 232 CIRCUIT

hai any one there , please provide me with a working ckt dig of max232

which can transmit data from a serial port to something(transmitter)

which can receive data from something(receiver) to serial port
__________________
robosat
9884282216(india-chennai)
robosat is offline  
Old 9th February 2004, 10:30 PM   #9
Default Re: MAX 232 CIRCUIT

Quote:
Originally Posted by robosat
hai any one there , please provide me with a working ckt dig of max232

which can transmit data from a serial port to something(transmitter)

which can receive data from something(receiver) to serial port
Go to the link above to my tutorials, they give all the hardware details as well - including a MAX232 interface.
Nigel Goodwin is offline  
Old 7th August 2008, 01:32 PM   #10
Default

I need help interfacing max232 to pic16f877. what should i do first and the sample code if you can help me how to initialized it so that i can transmit data between two PIC.
bibz is offline  
Old 7th August 2008, 02:08 PM   #11
Default

Quote:
Originally Posted by bibz View Post
.....so that i can transmit data between two PIC.
For two PICs, one don't need to use MAX232.

If both PICs are on same power supply voltages level, e.g. +5V, and both has hardware USART feature, then just simply connect RX pin of one PIC to the TX pin of another and you are done regarding hardware.
__________________
L.Chung

Last edited by eblc1388; 7th August 2008 at 02:09 PM.
eblc1388 is offline  
Old 27th January 2009, 05:13 AM   #12
Default USART to USART

"......
Quote:
Originally Posted by eblc1388 View Post
For two PICs, one don't need to use MAX232.

If both PICs are on same power supply voltages level, e.g. +5V, and both has hardware USART feature, then just simply connect RX pin of one PIC to the TX pin of another and you are done regarding hardware.
...."


And can any one help me in software for this my amail id is ali.mir10v@gmail.com
ali.mir10v is offline  
Old 28th January 2009, 04:12 PM   #13
Default

I have heard, often, that most PC's do not need level translation. Have not tried it.
You can get the translators in a cable or very small board. There is a short list at:
PC-Microcontroller Communications - Open Circuits
russ_hensel is offline  
Reply

Tags
interface, pic, rs232, serial

Thread Tools
Display Modes




All times are GMT. The time now is 07:07 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker