Class OneWireContainer1D


  • public class OneWireContainer1D
    extends OneWireContainer

    1-Wire container for 512 byte memory with external counters, DS2423. This container encapsulates the functionality of the 1-Wire family type 1D (hex)

    This 1-Wire device is primarily used as a counter with memory.

    Each counter is associated with a memory page. The counters for pages 12 and 13 are incremented with a write to the memory on that page. The counters for pages 14 and 15 are externally triggered. See the method readCounter to read a counter directly. Note that the the counters may also be read with the PagedMemoryBank interface as 'extra' information on a page read.

    Features

    • 4096 bits (512 bytes) of read/write nonvolatile memory
    • 256-bit (32-byte) scratchpad ensures integrity of data transfer
    • Memory partitioned into 256-bit (32-byte) pages for packetizing data
    • Data integrity assured with strict read/write protocols
    • Overdrive mode boosts communication to 142 kbits per second
    • Four 32-bit read-only non rolling-over page write cycle counters
    • Active-low external trigger inputs for two of the counters with on-chip debouncing compatible with reed and Wiegand switches
    • 32 factory-preset tamper-detect bits to indicate physical intrusion
    • On-chip 16-bit CRC generator for safeguarding data transfers
    • Operating temperature range from -40 to +70
    • Over 10 years of data retention

    Memory

    The memory can be accessed through the objects that are returned from the getMemoryBanks method.

    The following is a list of the MemoryBank instances that are returned:
    • Scratchpad Ex
      • Implements MemoryBank, PagedMemoryBank
      • Size 32 starting at physical address 0
      • Features Read/Write not-general-purpose volatile
      • Pages 1 pages of length 32 bytes
      • Extra information for each page Target address, offset, length 3
    • Main Memory
      • Implements MemoryBank, PagedMemoryBank
      • Size 384 starting at physical address 0
      • Features Read/Write general-purpose non-volatile
      • Pages 12 pages of length 32 bytes giving 29 bytes Packet data payload
      • Page Features page-device-CRC
    • Memory with write cycle counter
      • Implements MemoryBank, PagedMemoryBank
      • Size 64 starting at physical address 384
      • Features Read/Write general-purpose non-volatile
      • Pages 2 pages of length 32 bytes giving 29 bytes Packet data payload
      • Page Features page-device-CRC
      • Extra information for each page Write cycle counter, length 8
    • Memory with externally triggered counter
      • Implements MemoryBank, PagedMemoryBank
      • Size 64 starting at physical address 448
      • Features Read/Write general-purpose non-volatile
      • Pages 2 pages of length 32 bytes giving 29 bytes Packet data payload
      • Page Features page-device-CRC
      • Extra information for each page Externally triggered counter, length 8

    Usage

    Example

    Read the two external counters of this containers instance 'owd':
      
      System.out.print("Counter on page 14: " + owd.readCounter(14));
      System.out.print("Counter on page 15: " + owd.readCounter(15));
     
     
    See the usage example in OneWireContainer to enumerate the MemoryBanks.
    See the usage examples in MemoryBank and PagedMemoryBank for bank specific operations.

    DataSheet

    http://pdfserv.maxim-ic.com/arpdf/DS2422-DS2423.pdf
    See Also:
    MemoryBank, PagedMemoryBank
    • Constructor Detail

      • OneWireContainer1D

        public OneWireContainer1D()
        Create an empty container that is not complete until after a call to setupContainer.

        This is one of the methods to construct a container. The others are through creating a OneWireContainer with parameters.

        See Also:
        super.setupContainer()
      • OneWireContainer1D

        public OneWireContainer1D​(DSPortAdapter sourceAdapter,
                                  byte[] newAddress)
        Create a container with the provided adapter instance and the address of the iButton or 1-Wire device.

        This is one of the methods to construct a container. The other is through creating a OneWireContainer with NO parameters.

        Parameters:
        sourceAdapter - adapter instance used to communicate with this iButton
        newAddress - Address of this 1-Wire device
        See Also:
        OneWireContainer1D, utils.Address
      • OneWireContainer1D

        public OneWireContainer1D​(DSPortAdapter sourceAdapter,
                                  long newAddress)
        Create a container with the provided adapter instance and the address of the iButton or 1-Wire device.

        This is one of the methods to construct a container. The other is through creating a OneWireContainer with NO parameters.

        Parameters:
        sourceAdapter - adapter instance used to communicate with this 1-Wire device
        newAddress - Address of this 1-Wire device
        See Also:
        OneWireContainer1D, utils.Address
      • OneWireContainer1D

        public OneWireContainer1D​(DSPortAdapter sourceAdapter,
                                  java.lang.String newAddress)
        Create a container with the provided adapter instance and the address of the iButton or 1-Wire device.

        This is one of the methods to construct a container. The other is through creating a OneWireContainer with NO parameters.

        Parameters:
        sourceAdapter - adapter instance used to communicate with this 1-Wire device
        newAddress - Address of this 1-Wire device
        See Also:
        OneWireContainer1D, utils.Address
    • Method Detail

      • getName

        public java.lang.String getName()
        Get the Maxim Integrated Products part number of the iButton or 1-Wire Device as a string. For example 'DS1992'.
        Overrides:
        getName in class OneWireContainer
        Returns:
        iButton or 1-Wire device name
      • getDescription

        public java.lang.String getDescription()
        Get a short description of the function of this iButton or 1-Wire Device type.
        Overrides:
        getDescription in class OneWireContainer
        Returns:
        device description
      • readCounter

        public long readCounter​(int counterPage)
                         throws OneWireIOException,
                                OneWireException
        Read the counter value associated with a page on this 1-Wire Device.
        Parameters:
        counterPage - page number of the counter to read
        Returns:
        4 byte value counter stored in a long integer
        Throws:
        OneWireIOException - on a 1-Wire communication error such as no 1-Wire device present. This could be caused by a physical interruption in the 1-Wire Network due to shorts or a newly arriving 1-Wire device issuing a 'presence pulse'.
        OneWireException - on a communication or setup error with the 1-Wire adapter