Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

send and receive data to anthor pic16f84a

Status
Not open for further replies.

potetojb

Member level 3
Joined
Feb 25, 2006
Messages
64
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Location
Johor,Malaysia
Activity points
1,943
Need Help

I write the serout and serin command to send data from PIC to another PIC

can anyone tell me, how to solve it, thank you

i am try many way to solve it , but still cant solve it

i am using PIC16F84A model try a simple code below

TX DATA


INCLUDE "modedefs.bas"
DEFINE OSC 4

loop:
IF PORTB.0=0 Then
GoSub led_on
Else
GoSub led_off
EndIF
GoTo loop


led_on:
SerOut PORTB.1,N2400,[$FF,$FF,"OK","A"]
Return

led_off:
SerOut PORTB.1,N2400,[$FF,$FF,"OK","B"]
Return

End



RX DATA

INCLUDE "modedefs.bas"
DEFINE OSC 4
dataon VAR BYTE
led1 VAR PORTB.1
led2 VAR PORTB.2

Loop:

SerIn PORTB.0,N2400,["OK"],dataon
IF dataon="A" Then led_on
IF dataon="B" Then led_off
GoTo Loop

led_on:
High led1
Low led2
GoTo Loop

led_off:
Low led1
High led2
GoTo Loop

End

after i on the supply and push the switch the led does not light

to see the led light on/off how could be???

really need a help

thank you
 

btbass

Advanced Member level 5
Joined
Jul 20, 2001
Messages
1,897
Helped
438
Reputation
880
Reaction score
287
Trophy points
1,363
Location
Oberon
Activity points
12,861
I use c so i'm not to up on basic, but I cant see where you configure the output lines data directions?
 

coshkun

Full Member level 2
Joined
Aug 27, 2005
Messages
126
Helped
18
Reputation
36
Reaction score
10
Trophy points
1,298
Activity points
2,214
I suggest you to use PIC16f628 instead of 16f84.It has USART modul,it's much more easier to communicate.
 

potetojb

Member level 3
Joined
Feb 25, 2006
Messages
64
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Location
Johor,Malaysia
Activity points
1,943
ok coshkun..

can u give me some infomation about PIC16F628 and USART...

i am an amateur in PIC and PIC BASIC PRO
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top