Sending codes with OneWireAPI.net

Forum about 1-Wire devices.
Post Reply
maeron
Starting Member
Starting Member
Posts: 12
Joined: Tue Feb 19, 2008 12:50 pm

Sending codes with OneWireAPI.net

Post by maeron »

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
Stevexyz
Member
Member
Posts: 87
Joined: Fri Dec 14, 2007 1:45 am
Location: United Kingdom
Contact:

Sending codes with OneWireAPI.net

Post by Stevexyz »

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
maeron
Starting Member
Starting Member
Posts: 12
Joined: Tue Feb 19, 2008 12:50 pm

Sending codes with OneWireAPI.net

Post by maeron »

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
Stevexyz
Member
Member
Posts: 87
Joined: Fri Dec 14, 2007 1:45 am
Location: United Kingdom
Contact:

Sending codes with OneWireAPI.net

Post by Stevexyz »

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
maeron
Starting Member
Starting Member
Posts: 12
Joined: Tue Feb 19, 2008 12:50 pm

Sending codes with OneWireAPI.net

Post by maeron »

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
Post Reply

Return to “1-Wire Forum”