I connected my data wire with a 10k resistor to the ground (thats pulling down right?) and tried to use any combination of boudrates but i never see my pic blinking (so no data transmission yet...)
@stamp:
Code:
DO
FOR dat = 16000 TO 20000 STEP 1
DEBUG DEC5 dat,CR
SEROUT 10,dat, ["kk"]
NEXT
@pic
Code:
serIn2 S_in ,16780,[wait("k"),dat]
gosub blink
my pic and stamp both use the same power source so that can't be the problem either. and my stamp CAN transmit to my stamp so timing must be right...
can anyone provide me a working code to make two pic16f688 communicate trough portc.1 so i can test my pics with that code.
here is my full code again:
stamp:
Code:
' {$STAMP BS2}
' {$PBASIC 2.5}
' {$PORT COM1}
dat VAR Word
DO
FOR dat = 16000 TO 20000 STEP 1
DEBUG DEC5 dat,CR
SEROUT 10,dat, ["kk"]
NEXT
LOOP
pic:
Code:
define OSC 20
S_in var PORTC.1
S_Out var PORTC.1
Led var PORTC.3
dat var byte
init:
gosub Startblink
high led
low led
pause 500
gosub blink
Main:
SerIn2 S_in ,16780,[wait("k"),dat]
gosub blink
pause 50
goto main
Blink:
high led
pause 10
low led
return
Startblink:
for dat = 1 to 16
high led
pause 10 * (16-dat)
low led
pause 10 * (16-dat)
next
return
please help me...
Bookmarks