Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Interface 2 PICS 16F877A use MAX485

Status
Not open for further replies.

NamNQ

Newbie level 2
Newbie level 2
Joined
Jan 31, 2013
Messages
2
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,283
Visit site
Activity points
1,295
Dear all!
I am a noob of PIC! and now i have a problem!
I want to connect two PICS. I use Proteus and C CSS.
I try connect them directly by connect RC6/TX(1) <-> RC7/RX(2) and RC7(1) <->RC6(2). It working corectly. (I 've read a example and i can understand it).
Then, i want to connect them via max487 instead of max485. Sorry, i can't find max485 in proteus.
Now, i dont understand how to interface and code them!
Could you teach me how to resole this problem!
Thank you, thank so much!
Best regards !
 

Hi there, have you read the datasheet for MAX485. It is a simple IC to ineterface. All you have to do is to select DE or RE to Read and write data. But before using read some material from the following link.
**broken link removed**

enjoy!
 
Hi there, have you read the datasheet for MAX485. It is a simple IC to ineterface. All you have to do is to select DE or RE to Read and write data. But before using read some material from the following link.
**broken link removed**

enjoy!

Thank Babar_Ali. I know RS485 use half-duplex trans. I 've been reading RS485.c and EX_RS485.c in CCS library.
I think, i must read about interrupt first (sorry for my noob).
Anyway, to save time, could you send me a easy example for RS485 (init, send and receive data...)?
My datagram :
rs485dg_zpsee1b8e3f.png

Best regards!
 
Hi there,

I never used CCS compiler. I have done work with HITEC PICC compiler.
You are right you must read about the serial interrupt. One thing that i noticed is that you have not used pull up resistors to the diffrential pair data lines. Find the attached image for details.

Also here is a chunk of code that I used to transmit data from one device to another.
Code:
unsigned char SerIn()
{
   DIR = 0;   // RS485 chip to Rx mode
   /* your code goes here*/
    return  UARTDATA; // Read Data if there is no parity or framing error.
}

void SendSerial(char data485)
{
DIR = 1;   // RS485 chip to TX mode
TX = data485;
}
 

Attachments

  • RS485.jpg
    RS485.jpg
    76.3 KB · Views: 197

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top