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?????
Clicker and DS1820 with the one wire librar -MikroC for PIC
-
- Posts: 10
- Joined: 10 Mar 2015 22:00
Clicker and DS1820 with the one wire librar -MikroC for PIC
Passion - Integrity - Honesty - Discovery - Inspiration - Growth
- 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
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
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
Re: Clicker and DS1820 with the one wire librar -MikroC for
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
- 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
Hi phanos77 and welcome to the MikroE forum,
Please can you tell me, do you want to ask something about this?
Best regards,
Peter
Please can you tell me, do you want to ask something about this?
Best regards,
Peter