PDA

View Full Version : can i slowdown owin and owout



Eugen
- 27th January 2005, 22:05
i have a problem i am using 3 ds18b20 and if i use a 8mhz crystal and use DEFINE OSC 8 it dosent work but if i change DEFINE OSC 8 to DEFINE OSC 16 then it works. can i slow down the owin and owout? i am using 3*15 meter cat5 cabel this is the program or what sould i do?

DEFINE OSC 8
ADCON1 = 7
DEFINE LCD_EREG PORTA
DEFINE LCD_EBIT 5

TRISB = %11111111
TRISC = %11111111

DQ VAR PortC.0

Stat VAR BIT
S1 Var byte
S2 Var byte
S3 Var byte
A VAR WORD
B VAR WORD

start:

S1 = $E5
S2 = $93
S3 = $1E
gosub Temp
A=B

S1 = $86
S2 = $81
S3 = $7B
gosub Temp

A=A >> 3
B=B >> 3

Lcdout $fe, 1
Lcdout dec (A >> 1),".",dec(A.0 * 5)

Lcdout $fe, $C0
Lcdout dec (B >> 1),".",dec(B.0 * 5)

pause 2000
goto start

Temp:
OWOUT DQ, 1, [$55,$28,S1,S2,$79,$00,$00,$00,S3,$44]
Pause 1000
OWOUT DQ, 1,[$55,$28,S1,S2,$79,$00,$00,$00,S3,$BE]
OWIN DQ, 2, [B.LOWBYTE,B.HIGHBYTE]' Read two bytes, then end communications
Return

Dwayne
- 27th January 2005, 22:56
Hello Eugen,

E>>i have a problem i am using 3 ds18b20 and if i use a 8mhz crystal and use DEFINE OSC 8 it dosent work but if i change DEFINE OSC 8 to DEFINE OSC 16 then it works. can i slow down the owin and owout? i am using 3*15 meter cat5 cabel this is the program or what sould i do?<<

My knowledge has not been in this area, but one BIG question would rise in my head...

Baudrate... is the Baudrate accurate and stable at OSC 8 at the speed you are going? OSC 8 may be too slow to use a baud that will produce a guaranteed stable communication. Its like attempting to use 9600 baude with a 4mhz Crystal...Flakey, if not worthless.

Dwayne

NavMicroSystems
- 28th January 2005, 00:10
Dwayne

good to see you back on the forum !

OWIN and OWOUT has nothing to do with Baudrate.

Eugen

I think there is only one way to control 1wire comms speed:

Write your own 1wire routines and don't use OWIN and OWOUT.

(I had to do this with I2C on one of my projects, but I haven't tried it with 1wire yet)

Eugen
- 29th January 2005, 11:02
I change the pull-up to a smaller then its works

NavMicroSystems
- 29th January 2005, 11:42
Eugen,

what value were you using initially for the pullup and what value are you using now ?

Eugen
- 29th January 2005, 22:17
i was using 4.7k and now i use 4.7 and a 10k pot so i dont know what i have now