Post the whole code here!
Be sure you disable ALL analog stuff on this 'unknown' S_Pin
Internal osc or external?
Did you try to connect your BS2 to your PC?
Post the whole code here!
Be sure you disable ALL analog stuff on this 'unknown' S_Pin
Internal osc or external?
Did you try to connect your BS2 to your PC?
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
ok here is the whole code:
on the stamp:
' {$STAMP BS2}
' {$PBASIC 2.5}
' {$PORT COM1}
dat VAR Byte
DO
SEROUT 10, 396, ["blink"]
SERIN 10, 396, [WAIT("t"), dat]
DEBUG "data: ", DEC dat, CR
PAUSE 1000
LOOP
on the pic:
define OSC 20
INCLUDE "modedefs.bas"
S_in var PORTC.0
S_Out var PORTC.0
Led var PORTC.3
dat var byte
Main:
SerIn2 S_in,396,[dat]
gosub blink
SEROUT s_out, T2400,["1234t", dat]
pause 50
goto main
Blink:
high led
pause 10
low led
return
this code only returns me "data: 0" in my debugwindow, if i use the codeon my pic and remove the
SerIn2 S_in,396,[wait("k")]SERIN 10, 396, [WAIT("t"), dat]on my stamp it never blinks and it keeps waiting for that "k" the osc is an external 20 mhz crystal
Last edited by chriroz; - 30th October 2006 at 09:55.
does anyone know how to fix this? the transmitting does work from stamp to pic but it doesn't from pic to stamp. please help me.
chriroz, What is the value of "dat"? I don't ever see it getting set...
Dave Purola,
N8NTA
So you didn't post the whole thing?Originally Posted by chriroz
Are you sure you properly set the config fuses for your PIC? HS_OSC?
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
OK, THIS IS THE WHOLE CODE:
on the stamp:
' {$STAMP BS2}
' {$PBASIC 2.5}
' {$PORT COM1}
dat VAR Byte
DO
SEROUT 10, 396, ["blink"]
SERIN 10, 396, [WAIT("t"), dat]
DEBUG "data: ", DEC dat, CR
PAUSE 1000
LOOP
on the pic:
define OSC 20
INCLUDE "modedefs.bas"
S_in var PORTC.0
S_Out var PORTC.0
Led var PORTC.3
dat var byte
Main:
SerIn2 S_in,396,[dat]
gosub blink
SEROUT s_out, T2400,["1234t", dat]
pause 50
goto main
Blink:
high led
pause 10
low led
return
THAT code only returns me "data: 0" in my debug window (witch is already strange.)
and if i use THIS code (the one i actually need):
on the stamp:
' {$STAMP BS2}
' {$PBASIC 2.5}
' {$PORT COM1}
dat VAR Byte
DO
SEROUT 10, 396, ["blink"]
DEBUG "data: ", DEC dat, CR
PAUSE 1000
LOOP
on the pic:
define OSC 20
INCLUDE "modedefs.bas"
S_in var PORTC.0
S_Out var PORTC.0
Led var PORTC.3
dat var byte
Main:
SerIn2 S_in,396,[wait("k")]
gosub blink
pause 50
goto main
Blink:
high led
pause 10
low led
return
than it never blinks and never sees a "k". I really need this problem solved. please post ANYTHING that might help me (i live in european time so i usely have to wait a whole night before i can read your answers and an other day before you read my posts, so post anything you got, i don't have much time left) and my config is HS (in winpic) and define OSC = 20. "dat" is the byte in witch it saves the data received from serin2, isn't it?
thanks in advance,
Chris
Last edited by chriroz; - 1st November 2006 at 08:38.
I also tried to use an FlowPin and it didn't work. but i found out something strange. after i send my data from my stamp the pin stays high. is that normal? if i give an "low 10" command after it it will get low again
Bookmarks