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.

2 PIC, serial communication(16F877)

Status
Not open for further replies.

lightgreen

Newbie level 3
Joined
Sep 19, 2009
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Malaysia
Activity points
1,308
hi,good day to everyone...
I have a hard time throughout the process of learning serial communication, but gained nothing at last.
I tried with 2 PIC where each of the PIC will control the LED that connected with it.
There are 2 PIC in the drawing. Let the left PIC = A, right PIC = B.
What i want to have is....A control the LED that connected with B, and B control the LED that connected with A.
I started a bit of the coding but stuck somewhere in the middle. I don't know how to use HSERIN and HSEROUT even though I went through the manual.

I know there should be 2 sets of similar coding which i can download it into PIC while doing the simulation in Proteus Isis. But at this moment, I can't even write my coding with HSERIN and HSEROUT.

Attachment below shows the connection in Proteus. I only had problem with my coding.

So any help.....I will be so grateful....Thanks in advance...

Coding as below:

Define osc 8
define HSER_RCSTA 90H 'Enable serial port and continous receive
DEFINE HSER_TXTSTA 24H 'Enable transmit
DEFINE HSER_BAUD 9615
DEFINE HSER_CLROERR 1 'Clear overflow automatically
ADCON1 = 7


TRISB.0 = 1 'switch
TRISB.2 = 0 'LED
TRISC.6 = 0 'set TX(portC.6) to out
TRISC.7 = 1 'set RX(portC.7) to in

led1 var portb.2


Hserout [
 

mus1gazafana

Newbie level 4
Joined
Nov 29, 2010
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,302
i am working on the same problem could you please help me if you have solved your problem?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top