PDA

View Full Version : PIC to PIC , 16F867



DhesanR
- 11th January 2008, 11:16
Hi all,

I'm trying to send data to another pic and read it off and LCD, but with no luck, i have tried all combos of serial commands...can somebody please point out the error, sorry its the 16F87

TX:-

DEFINE OSC 10

include "modedefs.bas"

output portA.0
output PortA.1

LED1 var PORTA.1 ' Set Data to PortA

B0 var byte

let b0 = 200

seroutpin var porta.0

loop:

Serout2 seroutpin,3313,[$55,$55,$66,B0]

High LED1 '
Pause 200

Low LED1
Pause 200

goto loop

************************************************** ******

RX:-

******************LCD init

define osc 4

TRISA = %11111111

output PortA.0

LED1 var PORTA.0 ' Set Data to PortA

input portA.1

SerinPin var PortA.1

B0 var Byte

pause 1000 ' LCD startup

Lcdout $fe, 1 ' Clear LCD screen
pause 600
Lcdout "hello world" '
Pause 300 ' Wait .5 second
b0 = 2


Main:
Serin2 serinpin,3313,[wait ($66),B0] ' preamble
lcdout dec B0
pause 300

High LED1
Pause 200
Low LED1
Pause 200
goto main

End

does it make a diff is the both pics are working off differenct osc speeds?

Thanks,
DhesanR

mackrackit
- 11th January 2008, 11:42
16F87x chips have ANALOG on PortA. ADC will need to be disabled.

http://www.picbasic.co.uk/forum/showthread.php?t=561
http://www.picbasic.co.uk/forum/showthread.php?t=562



does it make a diff is the both pics are working off differenct osc speeds?

It does not make a Difference.

skimask
- 11th January 2008, 15:00
16F87x chips have ANALOG on PortA. ADC will need to be disabled.


Says it's a PIC16F87...
Same thing still applies though...

Also, internal oscillators suck for serial comm's, for the most part. Not saying that they never work, but most of the time, there's problems.
Use a crystal at both ends.