Clicker and DS1820 with the one wire librar -MikroC for PIC

General discussion on mikroProg™ programmer and debugger and mikroProg Suite software as well.
Post Reply
Author
Message
stevekodos
Posts: 10
Joined: 10 Mar 2015 22:00

Clicker and DS1820 with the one wire librar -MikroC for PIC

#1 Post by stevekodos » 27 Mar 2015 03:31

One wire library help shows prototype as;-

unsigned short Ow_Reset(unsigned short *port, unsigned short pin);

The example shows no return, Why!!?

[bOw_Reset(&PORTE, 2);

My code ;-

unsigned short tempStatus;
tempStatus = Ow_Reset(&PORTE,0);


is issuing a reset and the DS1820 is responding (as seen on a scope) but the returned tempStatus is always zero, even if the DS1820 is removed and doesn't issue a response (as seen on scope), Why!!!? it should be zero if DS1820 is present and a 1 if not???

LATE UPDATE

If I run the simple code below with the Ow_Reset commented out I get the 1mS pulse on TestOut (E1), great
But if I run the Ow_Reset line I get the reset pulse on E0 but as soon as E0 goes low so does E1!!! so E0 going low is also forcing E1 Low !!!!! Obviously something I don't understand about the port bits or their access?

// This defined earlier;- sbit TestOut at LATE1_bit;

TestOut = 1;
//tempStatus = Ow_Reset(&PORTE,0); // Onewire reset signal
Delay_ms(1);
TestOut = 0;

So;- why isn't Ow_Reset returning anything and why is writing a low to E0 via the Ow_Reset instruction also forcing E1 low?

Many thanks

Steve

The library function OW_Reset is obviously working but never returns anything. why?????
Passion - Integrity - Honesty - Discovery - Inspiration - Growth

User avatar
petar.timotijevic
mikroElektronika team
Posts: 1739
Joined: 19 Feb 2014 13:46
Location: Serbia
Contact:

Re: Clicker and DS1820 with the one wire librar -MikroC for

#2 Post by petar.timotijevic » 27 Mar 2015 16:34

Hi,

I checked this with default compiler One-Wire example and Ow_Reset returns values as expected. This works fine.

0 if the device is present
1 if the device is not present

Please check your compiler version.


Best regards,
Peter

phanos77
Posts: 1
Joined: 18 May 2014 11:30

Re: Clicker and DS1820 with the one wire librar -MikroC for

#3 Post by phanos77 » 24 Apr 2015 13:50

petar.timotijevic wrote:Hi,

I checked this with default compiler One-Wire example and Ow_Reset returns values as expected. This works fine.

0 if the device is present
1 if the device is not present

Please check your compiler version.


Best regards,
Peter

User avatar
petar.timotijevic
mikroElektronika team
Posts: 1739
Joined: 19 Feb 2014 13:46
Location: Serbia
Contact:

Re: Clicker and DS1820 with the one wire librar -MikroC for

#4 Post by petar.timotijevic » 27 Apr 2015 10:50

Hi phanos77 and welcome to the MikroE forum,

Please can you tell me, do you want to ask something about this?


Best regards,
Peter

Post Reply

Return to “mikroProg™ programmer and debugger”