[MB 6.0] timing problems with DS1820 example

Discuss about beta versions of mikroBasic
compiler.
Post Reply
Author
Message
bruno
Posts: 767
Joined: 10 Sep 2005 02:10
Location: Lyon, France
Contact:

[MB 6.0] timing problems with DS1820 example

#1 Post by bruno » 17 Oct 2007 09:35

Hello,

DS1820 example (PIC18F452, EP4) should be corrected like this :

Code: Select all

   while TRUE
     Ow_Reset(PORTA, 5)             ' onewire reset signal
     Ow_Write(PORTA, 5, $CC)        ' issue command to DS1820
     Ow_Write(PORTA, 5, $44)        ' issue command to DS1820
     Delay_ms(750)              ' <==============here
     i = Ow_Reset(PORTA, 5)
     Ow_Write(PORTA, 5, $CC)        ' issue command to DS1820
     Ow_Write(PORTA, 5, $BE)        ' issue command to DS1820
     Delay_us(120)                ' <================here

     j1 = Ow_Read(PORTA, 5)         ' get result
     j2 = Ow_Read(PORTA, 5)         ' get result (assuming the temperature 
is positive)
(same for C example, did not check Pascal)

also, sensor with mB is on RA5, and with mC on RE2 :roll:
Bruno
Bored with 7-segment ? Try the [url=http://www.micro-examples.com/public/microex-navig/doc/079-touchclock.html]TouchClock[/url]

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

Re: [MB 6.0] timing problems with DS1820 example

#2 Post by zristic » 17 Oct 2007 12:44

Thanks!

Post Reply

Return to “mikroBasic Beta testing”