OWOUT pin,mode,(variable,variable...)

Pin - is a variable/constant which specifies the pin to use.

Mode - is a variable/ constant which selects the mode.

Each bit of 'mode' has a separate function:

Each bit of 'mode' has a separate function:

Bit 0 reset pulse sent before data
Bit 1 reset pulse sent after data
Bit 2 bit mode (receive 1 bit rather than 8 bits (1 byte))
Bit 3 apply strong pullup after data

For convenience these predefined constants may be used:

0 ownoreset 4 ownoreset_bit
1 owresetbefore 5 owresetbefore_bit
2 owresetafter 6 owresetafter_bit
3 owresetboth 7 owresetboth_bit

Variables(s) - contain the data to be sent.


This command is used to write data to a one-wire device.

Write data to one-wire device connected to an input pin, with optional reset pulses before and after the write. Use of one-wire parts is covered in more detail in the separate 'One-Wire Tutorial' datasheet.

Some devices, such as the DS18B20 temperature sensor, may require a strong pullup after a byte is written.

This command cannot be used on the following pins due to silicon restrictions:

20X2 C.6 = fixed input
Applies To:
20X2, 28X1, 28X2, 40X1, 40X2
See Also:
Related Create:

Read raw temperature value from DS18B20

This achieves a similar function to the readtemp12 command

Code Example:
main:	owout C.1,%1001,($CC,$44)	; send ‘reset’ then ‘skip ROM’ then ‘convert’ then apply ‘pullup’
	pause 750			; wait 750ms with strong pullup
	owout C.1,%0001,($CC,$BE)	; send ‘reset’ then ‘skip ROM’ then ‘read temp’ command
	owin C.1,%0000,(b0,b1)		; read in result
	sertxd (#w0,CR,LF) 		; transmit value
	goto main
Copy Code Submit an Example

Submit Your Own Code!

You must be logged in to submit code examples. Login now.