BitsIO
 
 
 Bean BitsIO
 
General Multi-Bits Input/Output (1-8 bits)

Parameters of the bean.

Properties:

  • Bean name - Name of the bean.
  • Port - Port used by this bean (1-8 bits).
  • Pins - List of the used pins from the port. You may add/delete a pin item with the +/- buttons, select a pin for each item with the roll-down menu and define a pin signal name.
    One item of the list looks like:
    Pin0 - One pin (pin name and signal)
  • Pull resistor - Setting of the pull resistor (for input mode).

    There are 6 options:

    • no pull resistor: Input without pull resistor is required
    • pull up: Input with pull-up resistor is required
    • pull down: Input with pull-down resistor is required
    • pull up or no pull: Input with pull-up resistor is preferred, but no-pull is acceptable
    • pull down or no pull: Input with pull-down resistor is preferred, but no-pull is acceptable
    • autoselected pull: There are no special requirements for pull resistors

  • Open drain - Setting of the open drain (for output mode).
  • Direction - Direction of the bean: input, output, input/output (the direction of the pins can be switched in run time - see SetDir, SetInput and SetOutput methods).
  • Initialization - Initial settings (after power-on or reset).
    • Init. direction - Initial direction - input or output (available only if Direction = input/output).
    • Init. value - Initial output value = 0 to 2width-1 (available only if the Direction = output or input/output). You can select in which notation - decimal, hexadecimal, binary - you wish to write the value by clicking the (D) / (H) / (B) button repeatedly until it shows the first letter of the right notation.
  • Safe mode - This mode prevents an unwanted output value change that might occur after the change of port direction from input to output. This setting is significant only if the Direction property is set to Input/Output.
    If the Safe mode is disabled, it is not guaranteed that the output value that appears on the output pin after changing the direction from input to output will be the same as the last state before switching direction to input or the value set by output while the pin is set to input direction. This unwanted change can be caused by modification of other pins of the same port by read-modify-write operation.
    For example the bit-manipulation methods PutBit, SetBit, ClrBit, NegBit of the bean can cause unwanted change on other pins then the pins specified by the methods parameters.
    These unwanted changes can also be caused by another IO bean methods using the same port - PutVal, ClrVal, SetVal, NegVal in case of 1-bit IO bean, or PutVal, PutBit, SetBit, ClrBit, NegBit in case of multi-bits or byte IO bean.
    If the real output value after switching pin direction is not important or it is guaranteed that such unwanted change cannot occur, set this property to 'no' to get more efficient code.
  • Optimization for - Determines whether the driver is optimized for speed or for code size. The optimization for code size takes effect on more beans in the project (all should be set for code size optimization).
  • The following items are visible only if integration of Processor Expert with Simulink supported.
    • Bean name - Name of the bean.
    • Pins - List of the used pins from the port. You may add/delete a pin item with the +/- buttons, select a pin for each item with the roll-down menu and define a pin signal name.
    • Direction - Direction of the bean: input, output, input/output (the direction of the pins can be switched in run time - see SetDir, SetInput and SetOutput methods).



Processor ExpertTM and Embedded BeansTM are registered trademarks of UNIS, Ltd.
©1997-2005, UNIS, Ltd.