Continue to Site

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.

PIC to PC serial problem....

Status
Not open for further replies.

hhhsssmmm

New Member
Hello

Im trying to network a multidrop RS-485 network. Please see the enclosed diagram of how i have made the wiring arrangement.


- Board A represents the PC with RS-232 to RS-485 convertor

- Board B represents PIC board 1 with MAX488 line driver

- Board C represents PIC board 2 with MAX488 line driver


Both PIC boards B and C are the same using PIC18F4220 with 4MHz crystal.

Now i can get one way communication (from PC to PICs only) and my string of characters are successfully received by the PICs. The data is sent from the PC in packets and each packet is uniquely addressed to each PIC board.

Now when I attempt to do the reverse, that is send a reply back from PIC board C....& not simultaneously with board B, the packet successfully reachs the PC. However now when the same is attempted with PIC board B only, again making sure not simultaneously with PIC board C, then the packet never reaches the PC.

It appears only PIC board C is able to send packets to the PC.

Im also making each TX pin on the PIC an input pin when NOT transmitting. I only make it output direction, when Im getting ready to transmit.

As a simple test program, Im only sending out a packet when I press a button on the PIC boards (B or C). Therefore im in control of when a packet should be transmitted. Therefore, i can not understand this puzzle of why the packet failure from PIC board B.

Please can someone help me to achieve sending packets successfully from both PIC boards (B and C) back to the PC (each board taking turns in TXing and NOT simultaneously TXing)....using the same wiring connection is shown in my diagram. If there needs to be any change made, then please also let me know.

Thank you

Haseeb
 

Attachments

  • RS-485.JPG
    RS-485.JPG
    24.5 KB · Views: 1,233
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top