Sending codes with OneWireAPI.net

Forum about 1-Wire devices.

Sending codes with OneWireAPI.net

Postby maeron » Wed May 07, 2008 6:24 pm

Hi all,

I now have a new class and we are using OneWireAPI.net and C sharp to program applications for reading and writing 1-wire devices.
But when I preparing for the classes I got a little problem.
How do I read or write to a device that has no prepared container? (hat I mean is OneWireContainer10 for temp)
This LCD driver has familycode FF and has no prepared container.
How can I send 08h to this device and turn the backlight on?
Has anyone an idea how to do this?

/Martin
maeron
Starting Member
Starting Member
 
Posts: 12
Joined: February 2008
Location:

Sending codes with OneWireAPI.net

Postby Stevexyz » Wed May 07, 2008 7:35 pm

If you read this: http://pdfserv.maxim-ic.com/en/an/AN155.pdf can you then copy and modify an existing container/class?

The code for gaining control of the bus, identifying and selecting your device will be the same and you can check the data-sheet for your device to see how to read/write to it.

I think http://www.owfs.net has something for Windows too.

Cheers, Steve
Stevexyz
Member
Member
 
Posts: 87
Joined: December 2007
Location: United Kingdom

Sending codes with OneWireAPI.net

Postby maeron » Wed May 07, 2008 8:06 pm

I have seen this but I have to get my students to be able to code their own in C sharp (C#) and to help them I really must be able to handle it myself :)

After reading the PDF I suppose I can do like this:
adapter.select(IDasLong); // where IDasLong is the ID for the LCD controller
Now should it be the selected device on the network.

But how can I send the hex code "08h" to it to turn the backlight on?

Proberbly to tired or to stupid right now but I can't get it to work

/Martin
maeron
Starting Member
Starting Member
 
Posts: 12
Joined: February 2008
Location:

Sending codes with OneWireAPI.net

Postby Stevexyz » Wed May 07, 2008 9:16 pm

This looks like the datasheet for the LCD... http://www.louisswart.co.za/1-wire_lcd_100.pdf

The code in AN155.pdf example 2 looks close, but if the adapter.select() has selected (MATCH ROM) the device then all you need to do is to get the bus master to transmit a 0x08. putByte() looks as though it will do that.

If you haven't selected the device first and it's the ONLY 1-wire device on the bus you don't need to enumerate all the devices and can send a 0xcc first to SKIP ROM matching.

Cheers, Steve
Stevexyz
Member
Member
 
Posts: 87
Joined: December 2007
Location: United Kingdom

Sending codes with OneWireAPI.net

Postby maeron » Thu May 08, 2008 6:04 am

Thank you Steve,
that did the trick

all I do knoy is
adapter.select(IDasLong);
adapter.putByte(0x08);

to turn the backlight on

nce again thank you

/MArtin
maeron
Starting Member
Starting Member
 
Posts: 12
Joined: February 2008
Location:


Return to 1-Wire Forum

Who is online

Users browsing this forum: No registered users and 1 guest