reading 2 of DS18B20 with 8051

General discussion on mikroBasic PRO for 8051.
Post Reply
Author
Message
ttb1968
Posts: 9
Joined: 03 Feb 2010 17:39

reading 2 of DS18B20 with 8051

#1 Post by ttb1968 » 03 Feb 2010 17:43

Who can help me understanding the Ow_read, Ow_reset functions?
For other controllers this function cand be addressed directly to different pin ports. For this I can not access more than 1.
Please help.

User avatar
anikolic
mikroElektronika team
Posts: 1775
Joined: 17 Aug 2009 16:51
Location: Belgrade
Contact:

#2 Post by anikolic » 04 Feb 2010 15:09

Hi,
I think you should read more on 1-wire protocol on Wikipedia:http://en.wikipedia.org/wiki/1-Wire
Ow_Reset:
The master starts a transmission with a "reset" pulse, which pulls the wire to 0 volts for 480 µs. This resets every slave device on the bus, probably by depriving them all of power. After that, any slave device, if present, shows that it exists with a "presence" pulse: it holds the wire to ground for at least 60 µs after the master releases the bus.
Ow_read:
When receiving data, the master sends a 1-15 µs 0 volt pulse to start each bit. If the transmitting slave unit wants to send a "1", it does nothing, and the wire goes immediately up to the pulled-up voltage. If the transmitting slave wants to send a "0", it pulls the data line to ground for 60 µs. The basic sequence is a reset pulse followed by an 8-bit command, and then data is sent or received in groups of 8-bits.
Image

Best regards,
Aleksandar
Web Department Manager

ttb1968
Posts: 9
Joined: 03 Feb 2010 17:39

#3 Post by ttb1968 » 04 Feb 2010 16:23

Thank you Aleksandar,

The problem is to understand the programing.
For PIC we can use
"Ow_read(PORTE,3)"

but for 8051 I can only use
"Ow_read()" without argument

this is the problem, because I want to use more than one temperature sensor.

User avatar
anikolic
mikroElektronika team
Posts: 1775
Joined: 17 Aug 2009 16:51
Location: Belgrade
Contact:

Re: reading 2 of DS18B20 with 8051

#4 Post by anikolic » 08 Feb 2010 11:25

Hi,
I'm sorry, my answer was completely wrong, because I haven't read your question clearly. I apologize for this.
The decision was to move to external sbit declaration which makes code execution much faster, but it was obviously overlooked that users might want to use more than one 1-wire device within the same project. I apologize for this inconvenience.
I will file an enhancement report for developers to reconsider this implementation, and to return the old way this library had functioned. Execution speed and code size is not always the most important aspect of programming. You may expect this library to be changed in the following release of the compiler.

Best regards,
Aleksandar
Web Department Manager

Post Reply

Return to “mikroBasic PRO for 8051 General”