A Master in I2C Studio is a function window associated with a I2C board capable to be an I2C Master. The Master Window is dedicated to manage different types of messages to be sent over the I2C/SMBus.
The Master Function Pane provides access to the master function of telos I2C adapters.
The following sections describe the features that can be used by a Master Function Pane. Some of these features might not be available in connection with certain I2C adapters.
A new Master Function Pane can be created via the main menu item File/New.
The dialog which shows up, allows selecting the master module of a certain board. By selecting the item Master of a board entry and pressing the button OK, a new Master Function Pane is opened. It is automatically added to the current workspace.
A Master Function Pane that is already included in the current workspace can be opened by a double-click on the corresponding item in the workspace tree.
A Master Function Pane that is not included in the current workspace can be opened by the menu item File/Open. The file dialog which appears allows selecting the desired file. When the selection is committed, the Master Function Pane is imported into the current workspace and appears in the main window.
A Master Function Pane is divided into a Message Explorer in the top and a result list in the bottom. The Message Explorer is divided into a message tree on the left and a command view on the right.
The message tree displays the messages and commands that are contained in the current pane. The elements may be structured in folders.
The command view displays the details of a single message or command that is selected in the message tree. Messages can be modified in this view.
The result list displays the results of the transmissions when the master has been started.
The message tree consists of folders and command elements. An empty message tree contains - at least - a root folder item. New elements can be added via a context menu. It appears when a certain element of the message tree is selected with the right mouse button or when an item is selected and the key ENTER is pressed. If the current item is a folder, the new item is added to the folder. If the current item is some kind of command, the new item is inserted after that command. The toolbar in the bottom of the message tree allows creating new items, moving a selected item up and down in the tree and deleting an existing item. The table below gives an overview of the operations:
Operation |
Context Menu |
Toolbar |
Keyboard |
Creating a new I2C item |
New I2C Message |
|
RETURN
(opens context menu)
|
Creating a new SMB item |
New SMB Command |
|
RETURN
(opens context menu)
|
Creating a new IRD item |
New IRD Command |
|
RETURN
(opens context menu)
|
Creating a new pause |
New Pause |
|
RETURN
(opens context menu)
|
Creating a new testpin output item |
New Testpin Output |
|
RETURN
(opens context menu)
|
Creating a new testpin input item |
New Testpin Input |
|
RETURN
(opens context menu)
|
Creating a new folder |
New Folder |
|
RETURN
(opens context menu)
|
Moving an item up in the message tree |
- |
|
SHIFT+UP |
Moving an item down in the message tree |
- |
|
SHIFT+DOWN |
Deleting an item |
Delete |
|
DEL |
Copying an item |
Copy |
- |
CTRL+C |
Pasting an item into a folder |
Paste Into |
- |
CTRL+V |
Pasting an item below the current item |
Paste After This |
- |
RETURN
(opens context menu)
|
Renaming an item |
Rename |
- |
RETURN
(opens context menu)
|
The message tree can contain different types of items:
Item Type | Icon | Brief Description |
Folder Item |
| Folders can provide a visual structure of the message tree. This allows moving the collected items at once instead of moving single messages or commands. This allows selecting- and deselecting the contained items for execution at once instead of selecting- or deselecting single messages or commands. |
I2C Message |
| I2C message items allows defining I2C messages that may consist of a single transfer or of multiple transfers (combined messages). |
SMB Message |
| SMB message items allows sending and receiving information using the one of the formats being defined in the SMB protocol. |
IRD Message |
| IRD items allows accessing well-known slave devices. |
Pause Command |
| The command Pause allows inserting a minimum delay between the execution of two commands. |
Testpin Output Command |
| The output command provides access to output testpins of the I2C adapter. |
Testpin Input Command |
| The input command provides access to input testpins. |
When a new I2C message item is created or a given I2C message item is selected in the message tree, an I2C form appears in the command view.
In this view, RX- and TX-items can be added in an arbitrary order. All items in a single I2C message item are treated as a single combined message: During transmission, each item starts with a START condition. A STOP condition follows the last item only.
The RX items represent a receive message. The user is asked to define the slave address and the number of bytes that are requested.
The TX items represent a transmit message. The user is asked to define the slave address and the byte sequence to be transmitted. A byte sequence can be entered in the input field.
It is also possible to select a file whose content is to be transferred. Once, the file type is selected in the combo box, an input field appears that allows selecting a certain file name.
If a byte sequence is inserted directly and a file is also selected, the byte sequence is transmitted first and the file content next in the same message. In the result list, only a single chunk of data is displayed.
When a new SMB message item is created or a given SMB message item is selected in the message tree, a SMB form appears in the command view. The user has to select a command type first:
Depending on the selected command type, one of the following input fields appear in the form:
Address | Target address. SMBus messages always use 7-bit addresses. 10-bit addresses are only supported by raw I2C messages. |
Direction Bit | Value of the last bit of the transmitted address byte. |
Enable PEC | Enables/Disables Packet Error Checking Transmission: When this feature is selected, a checksum is appended. Reception: When this feature is selected, the master requests the PEC byte from the slave and evaluates it. |
Command Byte | Command Code of the message |
Data | Data to be transferred |
Data Bytes | Data to be transferred |
Data Word | Data to be transferred |
Note: Before IRD items can be added to the message tree, the desired devices must be added to the IRD map. This is done via the IRD & Plugin Manager Dialog which opens the the menu item Options/IRD & Plugin Manager is selected.
Note: Once, an IRD item is added to the message tree, the referenced device cannot be removed, replaced or changed in the IRD map until the message item has been removed again.
When a new IRD message item is created or an existing IRD item is selected, the value to be accessed can be selected from the menu in the header of the IRD form.
The menu has three levels. In the first level, the devices are listed. In the second level, the value of a certain device are shown and in the third level, the access direction is shown. Only the items in the third level can be selected!
Possible directions are GET and SET. The direction GET means to read a value from a device. The direction SET means to modify a value in the device.
Values such as single bit flags may be part of a value group. Then, modifying a single value is not possible without writing the values of the other members of that group too. If a selected value is part of a value group, the IRD form displays input fields for all these members and the user has to define all values of that group.
The command Pause allows for defining a minimum delay between two message tree items.
When a Testpin Output Command is created in the message tree or such an item is selected in the message tree, the testpin output form shows up in the command view.
The form allows for setting the given output testpins of the I2C adapter.
Icon | Descroption |
| Leave the testpin unchanged. |
| Set testpin high. |
| Set testpin low. |
When a Testpin Input Command is created in the message tree or such an item is selected in the message tree, the testpin input form shows up in the command view.
Icon | Descroption |
| Don't Care |
| Expected Value: High |
| Expected Value: Low |
Additionally, a timeout can be selected.
If the timeout is disabled, the application samples the input testpins repeadetly until the values match the defined pattern.
If the timeout is enabled, the application terminates the command after the specified time even if the samples don't match the defined pattern.
Once, the desired messages and commands have been specified, the content of the message tree can be executed.
Details concerning the execution of the commands and messages can be set up in the Master Configuration Dialog which shows up when the menu item Options/Master... is selected.
The dialog allows for setting up the following parameters:
Parameter | Description |
Bitrate | Specification of the maximum bitrate that should be applied when transmitting data. The actual bitrate during the execution can be lower. |
Send Loop | When this option is selected, the message list is executed repeatedly until the user stops the execution manually. |
Stop Transmission on Arbitration Lost | When this option is selected, the execution is terminated as soon as the master loses the bus arbitration. |
Stop on Error | When this option is selected, the execution is terminated as soon as an error occurs. Errors in this context also cover not-acknowledges of addresses or data bytes. When this option is disabled, the application continues with the following command if a certain command fails. Even if this option is selected, the application stops if certain errors occurr that may not be caused by the slave devices itself. |
When the execution is started, the application creates a list of messages from the message tree and processes the list items consecutively.
The items in the message tree can be checked or unchecked.
The list is created according to the following rules:
By pressing the menu item Run/Start, the execution of the messages is started.
By pressing the menu item Run/Stop, the execution of the messages is terminated.
If the option Send Loop is disabled, the execution is stopped automatically as soon as the last item has been processed.
The execution may also stop if errors occur.
The results of the execution are shown in the result list. Each item in this list corresponds to one item of the message tree.
If the option Send Loop is enabled, the result list still doesn't grow but the corresponding item in the result list is updated, if the execution passes that command again. The value in the column Execution Count is incremented each time, the command or message is processed.