Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

rs232 serial interface pic16f877

Status
Not open for further replies.

pinky

New Member
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
 

Nigel Goodwin

Super Moderator
Most Helpful Member
pinky said:
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 https://www.winpicprog.co.uk, one of the later ones uses the USART in a 16F876.
 

Nigel Goodwin

Super Moderator
Most Helpful Member
crust said:
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.
 

Vinny123

New Member
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

New Member
Nigel Goodwin said:
pinky said:
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 https://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
 

robosat

New Member
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
 

Nigel Goodwin

Super Moderator
Most Helpful Member
Re: MAX 232 CIRCUIT

robosat said:
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.
 

bibz

New Member
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.
 

eblc1388

Active Member
.....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.
 
Last edited:

ali.mir10v

New Member
USART to USART

"......
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
 

faizshafie

New Member
hi there.
can i know,how to communcate PIC 16f877a to rs232.
how many pins do we need to connect to the PIC from rs232.
is it difficult to program it in C language?

p/s:basically:this PIC will give a command start(triggering) the keithley picoammeter using the communication of rs232 to the picoammeter
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top