User’s manual Version: 21/12/2016
PoKeys user manual Please read the following notes 1. All information included in this document is current as of the date this document is issued. Such information, however, is subject to change without any prior notice. 2. PoLabs does not assume any liability for infringement of patents, copyrights, or other intellectual property rights of third parties by or arising from the use of PoLabs products or technical information described in this document.
PoKeys user manual Contents 1. Description ...................................................................................................................................... 8 2. Features ........................................................................................................................................... 9 2.1. PoKeys55 ................................................................................................................................. 9 2.2.
PoKeys user manual Applicable PoKeys library commands ........................................................................................... 32 8.4. Encoders ................................................................................................................................ 34 PoKeys configuration software usage ........................................................................................... 34 Applicable PoKeys library commands .................................................
PoKeys user manual Applicable PoKeys library commands ........................................................................................... 60 8.15. 1-wire................................................................................................................................. 62 Applicable PoKeys library commands ........................................................................................... 62 8.16. Sensors .......................................................................
PoKeys user manual 9. PoTLog27 firmware ....................................................................................................................... 89 10. Communicating with the USB devices using the console ......... Napaka! Zaznamek ni definiran. 10.1. 11. Supported operations........................................................ Napaka! Zaznamek ni definiran. Connecting common peripherals to PoKeys devices ................................................................ 92 12.
PoKeys user manual 16.2. 17. Putting pin 4 low on startup disables PoKeys55 device from booting. ........................... 126 Errata information ................................................................................................................... 127 Pins 5 and 6 cannot be separately set as outputs/inputs ........................................................... 127 Wrong power supply was specified for PoNET connector in the documentation ......................
PoKeys user manual 1. Description PoKeys products line consists of simple, easy-to-use USB and network devices with the extended list of features making them powerful input/output devices. PoKeys55, PoKeys56U and PoKeys57U devices also incorporate a virtual USB keyboard and joystick with a simple setup. PoKeys devices enable user to design specially built robust computer interfaces. The devices are highly adjustable and as such require no complex knowledge on device programming.
PoKeys user manual 2. Features 2.1. PoKeys55 - Compatible with USB 1.1/2.
PoKeys user manual - Support for up to 10 sensors on I2C bus, up to 10 sensors on 1-wire bus and up to 7 analog sensors (PoKeys56) or up to 100 sensors on I2C, 1-wire buses (PoKeys57) Communication compatible with PoKeys55 on application layer (data packet structure) Intuitive and user-friendly software Third-party support via communication DLL library and extensive protocol specification document that allows porting to other systems 2.3.
PoKeys user manual 3. Device comparison Number of pins on the board Digital inputs Digital outputs Analog inputs Analog ouputs PoKeys55 55 55 55 5x 10-bit 1x 10-bit PoKeys56U/57U 55 55 55 7x 12-bit 0 PoKeys56E/57E 55 55 55 7x 12-bit 0 Number of encoders (normal) Number of fast encoders Number of ultra fast encoders Number of PWM outputs Number of digital counters Pulse engine 25 3 0 6 (12 MHz clock) 0 not suported Alphanumeric up to 4x20 25 3 1 6 (25 MHz clock) 24 int. 3-axis 25 kHz ext.
PoKeys user manual 4. Device hardware description 12 www.poscope.
PoKeys user manual I = input, O = output, I/O input or output, SF = special function Pin 1 Type I/O 2 I I I/O 3 4 5 I I I/O I/O I/O 6 I I I/O 7 8 9 10 11 12 13 14 15 16 17 13 I I I/O I/O I I/O SF O I I/O O I/O SF O I I/O I I/O I I/O I/O I I I/O I I I/O O Description General purpose digital input/output pin (limited current source capability on PoKeys56E/57E) Fast encoder 1A – A channel input for the fast encoder 1 Counter 1 – Counter input signal for counter 1 (not available on PoKeys55) Gene
PoKeys user manual 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 14 I/O O I/O O I I/O O I I/O O I I/O O I I/O I/O O SF I I/O I/O O I I/O I/O O SF I I/O I/O SF I I/O I I/O O I I/O O I/O O I/O I/O I/O I/O I/O General purpose digital input/output pin PWM channel 5 output General purpose digital input/output pin PWM channel 4 output Counter 19 – Counter input signal for counter 19 (not available on PoKeys55) General purpose digital input/output pin PWM channel 3 output Counter 20 – Counter input s
PoKeys user manual 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 I/O I/O I/O I/O SF O I/O SF O I/O SF O I/O SF O I/O O I/O O I/O I I I/O I I I/O I I I/O I I I/O I I/O I I O I/O I O I/O I O O 15 LCD data 5 (secondary configuration) General purpose digital input/output pin LCD data 4 (secondary configuration) General purpose digital input/output pin External pulse generator dedicated IO connection - see Pulse engine manual PoExtBus serial clock if PoExtBus on dedicated connector is not used Gener
PoKeys user manual 49 I/O I O 50 51 52 53 54 55 O I/O O I/O SF O I/O I O I/O O O I/O I O I/O I/O O General purpose digital input/output pin (limited current source capability on PoKeys56U) Counter 49 – Counter input signal for counter 49 (not available on PoKeys55) Integrated Pulse engine STEP z - z-axis step output (requires additional 470 Ohm pull-up resistor on PoKeys56U) (not available on PoKeys55) Connection signal output General purpose digital input/output pin Connection signal output General
PoKeys user manual 4.3. Status LEDs Each PoKeys devices has the following status LEDs: - Red LED – power status: when the power is applied to PoKeys device, this LED is lit Green LED – connection/communication status: this LED reflects various operating modes of the PoKeys device o Fast blinking on startup: device has started in the recovery mode. This enables to update the firmware and clear the settings in the device.
PoKeys user manual 5. Requirements 5.1. USB devices - One available USB 1.1 or USB 2.0 port USB HID device driver enabled operating system (Windows 98 SE/ME/2000/XP/Vista/Windows 7/8/10, Linux, Mac OS) Included software requires Windows XP/Vista/Windows 7/Windows 8/Windows 10 with .NET frameworks 2.0 and 3.5 installed (ONLY FOR SYSTEMS WHERE THE DEVICES WILL BE CONFIGURED, TARGET SYSTEM NEEDS NO SOFTWARE INSTALLATION FOR THE DEVICE TO OPERATE AS A STANDARD USB KEYBOARD AND JOYSTICK). 5.2.
PoKeys user manual 6. Technical specifications 6.1. PoKeys55, PoKeys56U and PoKeys57U dimensions Measurements are in mm, all holes have 3mm diameter. 19 www.poscope.
PoKeys user manual 6.2. PoKeys56E/57E dimensions Measurements are in mm, all holes have 3mm diameter. 20 www.poscope.
PoKeys user manual 6.3. Electrical specification – limiting values Symbol Parameter Min Max Unit VIA VI Vesd analog input voltage on ADC related pins Input voltage on other pins electrostatic discharge -0.5 -0.5 -4000 3.6 5.5 4000 V V V 6.4.
PoKeys user manual 6.6. Power supply for PoKeys57E v1.2 PoKeys57E requires external 5-12 V power supply to be connected to the board. PoKeys57E uses switching power supply to power the 5 V power supply bus (also available on pin +5V for external peripherals that require +5V). If any additional peripheral is connected to PoKeys57E board, combined current of peripheral and PoKeys57E board must be taken into consideration when selecting the power supply.
PoKeys user manual 7. Installation PoKeys55 and PoKeys56U are USB 1.1/2.0 compliant devices and as such require no additional drivers for operation as a standard USB keyboard and joystick. PoKeys56E/57E is an Ethernet device that requires an Ethernet connection between host computer and the device and the external power supply. No additional drivers are required. Network firewalls must allow all traffic on TCP/UDP port 20055.
PoKeys user manual 8. PoKeys configuration options 8.1. Digital inputs and outputs Any of the 55 pins, available on the terminals on the PoKeys PCB, can be configured as digital input or output with selectable polarity. All pins have a weak pull-up resistor enabled and are 5V tollerant. At every startup, all digital input or output configured pins are preset as digital input pins (with the weak pull-up resistor pulling the state of the pin to logical 1).
PoKeys user manual Figure 1: PoKeys configuration window There are 6 main pin functions possible: inactive, digital input, triggered digital input, digital output, analog input and analog output. Inactive Any pin (except those fixly mapped to an activated peripheral) can be set as inactive. Inactive pin is put in high-Z state with internal pull-up resistors enabled. Digital input Any one of the 55 pins can be configured as digital input by selecting ‘Digital input’ option box.
PoKeys user manual Example: starting a program on Windows using PoKeys55/PoKeys56U device On a Windows operating system, users can assign a custom shortcut key to any program shortcut. Find the shortcut and then right click on it to show the context menu (Step 1). Select Properties (Step 2), and under the Shortcut tab (Step 3), click on the ‘Shortcut key’ text box. Proceed by typing in a combination that you wish to assign to a particular program (Step 4).
PoKeys user manual 5 7 6 Figure 2: Setting up PoKeys device Keyboard macro – only for USB devices PoKeys55 and PoKeys56U devices support keyboard macros – the key press combinations that can be up to 256 keys long. To define a keyboard macro, first select Keyboard macro mapping option for one of the pins. ‘Edit macros’ and ‘Get names’ command buttons become enabled. To add, change or delete macros click the ‘Edit macros’ button. The following dialog appears 27 www.poscope.
PoKeys user manual Figure 3: Macro editing dialog First select the macro you want to edit. To change macro name, enter desired macro name (up to 7 characters long) in 'Macro name' text box and click 'Change' button. This name is used only to help user differentiate between multiple macros. To set macro contents, simply enter text into 'Macro contents' text box. If there is an invalid character found, the text appears red. When finished, click Write to write macro to device.
PoKeys user manual Figure 4: Input and output status dialog There are 55 pins represented as colored squares in the dialog, organized in the rows of 8 pins. Each square contains a pin index number in the lower left corner, while the lower right corner is used to indicate a digital output (small black triangle is displayed on pins, configured as digital outputs). The color of the square resembles the current state of the pin – green for the activated (HIGH state) and white for the unactivated (LOW state).
PoKeys user manual Read or write multiple inputs and outputs BlockGetInput1 / BlockGetInput2 / BlockGetInputAll55 BlockSetOutput1/BlockSetOutput2/ BlockSetOutputAll55 Read or set multiple pin configurations GetAllPinConfiguration GetAllPinKeyCodes GetAllPinKeyMapping GetAllPinKeyModifierss SetAllPinConfiguration SetAllPinKeyCodes SetAllPinKeyMapping SetAllPinKeyModifierss Read or set automatic output initalization option GetAutoSetOutputs SetAutoSetOutputs Macro-related commands GetMacroKeys GetMacroName Ma
PoKeys user manual with PC is lost and power through USB is still available (or ethernet link is lost on PoKeys56E/57E), pin will go into low state (or high state if pin polarity is setup as inverted). This command must not be confused with Failsafe settings, which are based on the communication timeout and not only link status.
PoKeys user manual 8.3. Digital counters (only on PoKeys56 devices) Selected pins of the PoKeys56U and PoKeys56E/57E can be setup to count the number of signal transitions on those pins. Pin digital counter can be setup to be incremented/decremented on rising, falling or rising and falling edges of the input signal. If needed, additional pin can be selected to toggle between incrementing and decrementing mode.
PoKeys user manual 33 www.poscope.
PoKeys user manual 8.4. Encoders PoKeys devices can handle decoding of up to 26 (25 on PoKeys55) pairs of quadrature encoder signals. A and B signals of 25 'normal' encoders can be connected to any digital input and are intended for hand-driven rotational encoder switches with the quadrature signal frequencies up to 1 kHz.
PoKeys user manual Enabling ultra-fast encoders To enable ultra-fast encoders, go to menu 'Peripherals > Fast encoders settings’, then check ‘Enable ultra fast encoders’ option. There are additional options to enable 4x step multiplication (sampling) and inverting the encoder direction.
PoKeys user manual Applicable PoKeys library commands Read single encoder value Read current encoder value GetEncoderValue GetEncoderRAWValue Read encoder RAW value Read or set single encoder configuration Read encoder settings GetEncoderSettings SetEncoderSettings Set encoder settings Read or set single encoder keyboard mapping configuration Reads encoder mapping configuration for GetEncoderKeyMappingDirA direction A GetEncoderKeyMappingDirB Reads encoder mapping configuration for direction B SetEncoderKey
PoKeys user manual 37 www.poscope.
PoKeys user manual 8.5. Matrix keyboard Matrix keyboard is a set of buttons, connected into a mesh. All buttons in a row share one contact, same goes for each of the buttons in the column. If a button is pressed, a key press is detected with a periodic scanning of each of the rows and columns. PoKeys devices use digital outputs for setting the voltage levels on rows and read column voltage levels using digital inputs that already have internal pull-up resistors, so no external circuitry is needed.
PoKeys user manual Figure 9: Assigning row and column pins Matrix keyboard column selection Each free digital input pin can be assigned as matrix keyboard column input. Make sure the selected pin is configured as digital input, then check the ‘Matrix keyboard’ option for the pin and select the appropriate column letter from the list. Matrix keyboard row selection Each free digital output pin can be assigned as matrix keyboard row output.
PoKeys user manual Figure 10: Matrix keyboard configuration for a 4x3 matrix keyboard Applicable PoKeys library commands Read matrix keyboard status Read matrix keyboard status GetMatrixKeyboardKeyStatus Read or set basic matrix keyboard configuration Read matrix keyboard configuration GetMatrixKeyboardConfiguration SetMatrixKeyboardConfiguration Set matrix keyboard configuration Read or set matrix configuration with alternate function support GetMatrixKeyboardConfiguration_AlternateFunc Read matrix keybo
PoKeys user manual 8.6. Analog inputs Analog input function is only available for pins 43 to 47 (on PoKeys55 devices) or for pins 41 to 47 (on PoKeys56 devices). On PoKeys55 and PoKeys56U devices, these analog inputs can also be freely mapped to any of the 6 joystick axis; X, Y, Z, rotation X, rotation Y and throttle.
PoKeys user manual Applicable PoKeys library commands Read single analog input value GetAnalogInput Read or set single pin function GetPinData SetPinData Read all analog inputs GetAllAnalogInputs Read analog input maximum value GetAnalogValueMax Read or set analog low-pass filter parameter GetAnalogRCFilterValue SetAnalogRCFilterValue COM_Execute command COM_ExecuteInner with the following parameters: - GetAnalogPinValues 42 Read analog input value Reads pin function Set pin function Read all analog input
PoKeys user manual 8.7. Joystick mapping Each axis of the PoKeys virtual joystick can be assigned an analog input source. In addition, analog to digital mapping option can be enabled, which allows user to connect an analog joystick to a PoKeys devices and simulate key presses for each direction of the joystick. User can freely select dead band and saturation ranges.
PoKeys user manual Figure 12: Joystick mapping settings Applicable PoKeys library commands Read or set joystick axes and buttons mapping Read joystick mapping options GetJoystickMapping SetJoystickMapping Set joystick mapping options Read or set joystick triggered mapping Read joystick triggered mapping options GetJoystickTriggeredMapping SetJoystickTriggeredMapping Set joystick triggered mapping options Read or set analog to digital mapping Read joystick analog to digital mapping configuration GetJoystic
PoKeys user manual 8.8. PWM outputs PoKeys55, PoKeys56U and PoKeys56E/57E devices support PWM output function on 6 pins (pins 17 to 22). Different duty cycles can be assigned to each PWM output however, all outputs share the same PWM period. PWM outputs can be easily amplified using an external transistor and used for control of loads with increased current demand.
PoKeys user manual check 'Send to device on change' checkbox. Left position of a slider means 0% and right position 100% respectively. Applicable PoKeys library commands Read or set PWM outputs configuration Set PWM period and duty cycles SetPWMOutputs GetPWMOutputs Get PWM period and duty cycles Read PWM module frequency Read the PWM module base frequency GetPWMFrequency COM_Execute command COM_ExecuteInner with the following parameters: - SetPWMOutputs 46 www.poscope.
PoKeys user manual 8.9. Matrix LED output PoKeys devices support 2 additional external 8x8 LED matrix displays. Each display is based on 2 8-bit shift registers, one controlling the row and the other controlling the column signals. PoKeys refreshes the display at the rate of 2800 rows per second (which gives around 350 Hz refresh rate of the whole 8x8 display). Once enabled, PoKeys device assigns pins 9, 10 and 11 to be used with display 1, and pins 23, 24, 25 to be used with display 2.
PoKeys user manual PoKeys configuration software usage To set-up matrix LED displays, open 'Peripherals > LED displays…'. The following dialog appears Figure 16: Matrix LED setup dialog For each of the displays, number of rows and columns can be selected. On the bottom, after enabling 'Live test display x', user can test the displays in real-time by clicking on gray rectangles. Left-click turn-s selected pixel on, while right-click resets selected pixel.
PoKeys user manual 8.10. LCD PoKeys devices support connecting one alphanumeric LCD module up to a size of 4x20 (4 rows, 20 columns). The selection of the module is limited by support for HD44780 or compatible chipset. Usually these displays come in various sizes - 1/2/4 line with 8/16/20 characters and colors (black letters on green background, white letters on blue background ...).
PoKeys user manual PoKeys56U and PoKeys56E/57E devices by default function in buffered LCD mode. In this mode, any LCD-related command that is sent to PoKeys device is first buffered and when possible, PoKeys device executes the LCD refresh on its own. In this mode, some LCD operations are not operational – cursor movement is controlled by the PoKeys device and cursor move or display commands may not work as expected. If this low-level control is desirable, buffered mode must be deactivated first.
PoKeys user manual User can also set entry mode settings of LCD module. Cursor can be set-up to move either right (normally) or left after each character displayed. If 'Display' shift is enabled, whole display shifts with every new character displayed. Settings are processed after user clicks button 'Set Entry mode' and work only in ‘unbuffered’ mode described above. Display on/off settings User can set on/off switches for whole display, cursor and cursor blinking.
PoKeys user manual 8.11. PoExtBus PoExtBus bus support enables user to add additional 10 8-bit shift registers to the project based on PoKeys device. This gives additional 80 digital outputs that can be easily controlled with included dll interface or other 3rd party interface for PoKeys device. On PoKeys55, device assigns pins 35, 36 and 37 to be used with PoExtBus. On PoKeys56 series, there is a dedicated connector on the board, which serves for the PoExtBus functions.
PoKeys user manual Figure 19: PoExtBus deserialization circuit PoKeys configuration software usage To set-up and test PoExtBus, open 'Peripherals' > PoExtBus...'. The dialog below (Figure 20) appears. By using mouse left and right clicks, user can turn on or off each of the outputs. 53 www.poscope.
PoKeys user manual Figure 20: PoExtBus setup dialog Applicable PoKeys library commands Read or set PoExtBus configuration and status Read PoExtBus configuration AuxilaryBusGetData AuxilaryBusSetData Set PoExtBus configuration and data PoExtBus connector type - Female wire-side connector: Molex 22-01-2055 - Cable contacts: 08-50-0032 (5 pcs needed) - Prepared cables: 88941-0700 (5 pcs needed) 54 www.poscope.
PoKeys user manual 8.12. PoNET PoKeys56 devices support PoNET devices that extend PoKeys56 functionality. Multiple PoNET and PoExtBus devices can be linked together. While the PoNET devices and PoExtBus devices share the same ExtBus connector, found on PoKeys56 boards, user should pay attention in connecting devices of both types together (see the schematics below).
PoKeys user manual PoNET kb48CNC keyboard The device can be virually mapped to PoKeys matrix keyboard. Third party software can set the status of LEDs under the keys, read the light sensor that measure the amount of light in the environment and set the intensity of the LEDs. To map the PoNET keyboard to PoKeys matrix keyboard, initialize the PoNET bus as described above in 'Adding new devices', select the keyboard in the device list and check the checkbox 'Enable mapping to matrix keyboard'. 56 www.
PoKeys user manual PoNET/PoExtBus connection example Pay attention to the following: - PoNET device can be connected only to PoKeys56 board or other PoNET device PoExtBus device can be connected to either PoKeys board, PoNET or PoExtBus device.
PoKeys user manual Applicable PoKeys library commands Device discovery and initialization commands Starts 'Register device' procedure PoNET_AddDeviceStart PoNET_AddDeviceStatus Retrieves the status of 'Register device' procedure PoNET_AddDeviceStop Stops the 'Register device' procedure PoNET_CheckForNewDevices Checks for new devices PoNET_ReinitializePoNET_noClear Unregisters all PoExtBus Pro devices (but keeps the configuration) PoNET_ReinitializePoNET_wClear Unregisters all PoExtBus Pro devices and clears
PoKeys user manual 8.13. Failsafe settings PoKeys56U and PoKeys56E/57E devices support the configuration of the failsafe state for the digital outputs, PWM outputs, PoExtBus devices and PoKeys Pulse engine.
PoKeys user manual 8.14. I2C protocol The I2C bus was designed by Philips in the early '80s to allow easy communication between components which reside on the same circuit board. Philips Semiconductors migrated to NXP in 2006. The name I2C translates into "Inter IC". Sometimes the bus is called IIC or I²C bus. PoKeys56U and PoKeys56E/57E devices support communication with I2C slave devices, connected to the PoExtBus connector.
PoKeys user manual I2CStartWrite I2CGetWriteStatus 61 successfull Writes data to I2C bus Read status of writing to I2C bus www.poscope.
PoKeys user manual 8.15. 1-wire 1-Wire is a device communications bus system designed by Dallas Semiconductor Corp. that provides low-speed data, signaling, and power over a single signal. 1-Wire is similar in concept to I²C, but with lower data rates and longer range. It is typically used to communicate with small inexpensive devices such as digital thermometers and weather instruments.
PoKeys user manual 8.16. Sensors Note: This feature was superseded with EasySensors in PoKeys57 series devices. The content below is related to PoKeys56 series devices In order to automate the procedure of starting the measurements and reading the results, PoKeys supports up to 10 sensors on I2C bus, up to 10 1-wire sensors and up to 7 analog sensors. The configuration dialog is available through the menu Peripherals>Sensors.
PoKeys user manual button. The operation may take a few seconds to execute and a list of detected I2C device addresses is displayed. As some of the devices support I2C address reconfiguration using dedicated pins and I2C addresses are not unique for each device type, the device list displays only the most possible sensors at each detected address. When option ‘Auto add new’ is checked, detected devices that are recognized by the I2C bus address, are automatically added to the sensors list. 64 www.
PoKeys user manual 1-wire sensors To setup a 1-wire sensor, click on an empty ('Inactive') entry in the list, enter the sensor's 64-bit ID sequence and select the refresh period. If there is only one 1-wire sensor present on the 1-wire bus, the ID sequence can be read by clicking on the 'Read curent' command button. Multiple sensors can be setup this way – one sensor at a time. When all sensors are then connected to the bus, the PoKeys will identify each with the help of ID sequence.
PoKeys user manual Analog sensors In addition to I2C and 1-wire sensors, PoKeys supports also analog sensors that are connected to analog voltage inputs on the PoKeys board. For each analog sensor, a 2-parameter linear transformation is supported. The following formula is used: 𝑢 = 𝐴𝐷𝑣𝑎𝑙 ∗ 𝐴𝑔𝑎𝑖𝑛 + 𝐴𝑜𝑓𝑓𝑠𝑒𝑡 4096 Where 𝐴𝐷_𝑣𝑎𝑙 is a measurement of the analog-to-digital converter (a value between 0 and 4095), 𝐴𝑔𝑎𝑖𝑛 is gain (32-bit integer number) and 𝐴𝑜𝑓𝑓𝑠𝑒𝑡 is result offset (32-bit integer number).
PoKeys user manual Figure 29: Thermal image of a temperature sensor being connected directly to a circuit board. The thermal conductivity of the sensor's leads causes the sensor to register higher temperature than the ambient real temperature.
PoKeys user manual 8.17. EasySensors PoKeys57 series devices implement a feature called EasySensors. It is an improvement of the original support for various sensors in PoKeys56 series devices. EasySensors feature allows the user to setup up to 100 sensors on various communication buses (including I2C, 1-wire, DHTxx 1-wire and analog inputs). The feature is accessible in Peripherals > EasySensors menu.
PoKeys user manual Scan for 1-wire sensors The command opens the ‘Add 1-Wire sensor’ dialog that allows the user to select PoKeys pin, where the 1-Wire bus is connected to. By clicking ‘Scan’, PoKeys device scans the 1-Wire bus for devices. The EasySensors 1-wire bus implementation can detect multiple 1-Wire devices on the bus at once and thus simplifying the configuration process.
PoKeys user manual a) Using gain and offset: specify the gain and offset characteristics of the sensor. The gain specifies the number of sensor units per 1 V of analog voltage, while the offset specifies the sensor value of analog voltage input of zero. Figure 34: Analog sensor setup with gain / offset option b) Using two point mapping: in this mode, two sensor values with corresponding analog voltage must be entered into the fields provided. Gain and offset of the sensor are automatically calculated.
PoKeys user manual List of supported sensors - LM75 (Maxim, TI, NXP) temperature sensor for the temperature range -55 °C to +125 °C with the resolution of 0.5 °C. The sensor has configurable address and up to 8 sensors can be connected. - SHT21 (Sensirion) temperature and humidity sensor for the temperature range -40 °C to +125 °C with the resolution of 0.01 °C and air relative humidity in range 0 to 100 %.
PoKeys user manual 8.18. USB interface configuration Note: some configuration options may be limited to PoKeys57 series The operation of the USB PoKeys devices can be adjusted in the Device > USB interface', as shown on the figure below. Figure 37: Accessing USB interface options By adjusting these options, the user is given the possibility to configure how device reacts on the system start, change the communication interval and configure which interfaces are visible to the system.
PoKeys user manual Communication interval settings dialog. Communication intervals between 1 millisecond and 20 milliseconds can be configured. Enabling/disabling the interfaces Each USB PoKeys device uses 4 USB interfaces (i.e. USB devices) and thus appears as 'USB Composite Device' in the Device manager. If not needed, some (or all) interfaces can be disabled. Note: if all communication interfaces are disabled, configuration of the device will no longer be possible.
PoKeys user manual 8.19. PoKeys56E and PoKeys57E PoKeys56E/57E is a network type of PoKeys device. The device can be connected to Ethernet 10/100 network with standard RJ-45 cable. By default, the device is set to use the DHCP functionality of the network router. User can later turn on or off the DHCP support. If DHCP is not needed/wanted, fixed IP address can be defined for the device. To set the network settings of the device, go to Device menu and click Network device settings...
PoKeys user manual specification document). All PoKeys56E/57E devices that receive this packet, respond with their current IP address and serial number. Default settings DHCP: Port: Security: enabled 20055 Full access After receiveing the UDP discovery packet and if the DHCP server is not available, PoKeys56E/57E will use the temporary address of x.x.x.250, where x.x.x is the subnet address (with 255.255.255.0 subnet mask). This enables user to reconfigure the device with the proper IP address.
PoKeys user manual The security is set up in PoKeys configuration software – on the Device menu, click Set device security... The password can contain any character and can be up to 32 characters long. Figure 40: Device security settings window Applicable PoKeys library commands PoKeys56E/57E user authorization commands Authorizes user on the device - changes the security level AuthorizeUser to the specified value GetSecurityStatus Reads the current security status of network device 76 www.poscope.
PoKeys user manual Web interface PoKeys56E/57E devices can be monitored through the simple web interface (that is already enabled by default). The interface can be disabled or configured in dialog accessible via menu Device->Web interface configuration. The following dialog appears Figure 41: Web interface settings – general settings The dialog presents the following options on the 'General settings' tab: - Disable web interface: check this field to disable web interface.
PoKeys user manual On the 'Web users' tab, usernames and passwords can be configured for up to 4 users (first user is fixed and named 'Admin' with the factory set password 'root0'). Usernames (except for Admin) and passwords can be up to 8 (ASCII) characters long. Figure 43: Web interface settings – dashboard items This page of Web interface settings is used to defined which items will be displayed on the Dashboard page of web interface (see below). PoKeys supports up to 16 items on dashboard screen.
PoKeys user manual Access rights settings enables administrator to select which users will be able to display the sensor readings. This is intented mainly for display items that can change outputs. To open the interface, use your internet browser and type in the IP address of the PoKeys56E/57E board.
PoKeys user manual Modbus PoKeys56E/57E supports slave (server) operation of Modbus TCP communication protocol. Modbus TCP compatible devices on the network can read the values from the device and set the outputs. To elevate the security, user can define which peripherals are accessible via Modbus TCP. Modbus TCP uses TCP protocol on port 502 (default), which can be changed in Modbus settings (accessible from the menu Device – Modbus configuration...).
PoKeys user manual 100-154 RW 200-213 RW 200,201 202,203 ...
PoKeys user manual 15 A 14 B 13 C 12 D 11 E Device 10 10 F 9 G 8 H 7 A 6 B 5 C 4 D 3 E 2 F 1 G 0 H Modbus word bit PoExtBus device bit mapping Device 9 Figure 45: Modbus configuration Applicable PoKeys library commands Modbus configuration commands Retrieves modbus settings GetModbusSettings SetModbusSettings Set modbus settings Connecting to PoKeys56E/57E across the internet To access the PoKeys56E/57E from the internet, connect the PoKeys56 board to your router and configure the follow
PoKeys user manual IP address of PoKeys56E board Using PoKeys software with PoKeys56E/57E device across the internet Suppose that the PoKeys56E/57E is at the pokeysdemo.poscope.com (change this address to the address of your own PoKeys56E/57E device). Open PoKeys software and click on 'Network settings'. The following dialog will appear. Enter the address of the PoKeys56 board in the field on the right and click on 'Add'. pokeysdemo.poscope.com Then click on 'OK'.
PoKeys user manual 8.20. Reporting data to network server with PoKeys56E/57E device PoKeys56E/57E devices can automatically report sensor values to various network servers using the HTTP POST, HTTP PUT or text-only protocols. Figure 46: Reports server settings for Xively service To use this reporting feature, user must specify request type (HTTP POST/PUT, Xively, custom HTTP header or raw), server IP and update rate.
PoKeys user manual Content-Type: text/csv Content-Length: 010 Connection: close The 'Connection' and 'Content-length' tags are automatically inserted by PoKeys56E device MyData: Test1234,-15000.00 The above example must be specified as POST /myScript.php HTTP/1.1 Host: api.xively.com User-Agent: MyCustomDeviceAgent Content-Type: text/csv MyData: Again, an extra new line character in fifth line is essential. Total length of final header and data is limited to 350 bytes.
PoKeys user manual 4. Open Device > Web interface settings dialog and go to ‘Reports server' tab. Check ‘Xively web service’ option. 5. Enter your Xively API key and Feed ID, created in step 3, leave other fields with default values Your Xively API key Your Xively Feed ID Figure 47: Xively settings page 6. Select the update rate at the bottom. 7. Click OK and click Send to device button 8. Go back to Device > Web interface settings to page ‘Dashboard items’.
PoKeys user manual 10. Make sure the PoKeys device has properly configured network settings and that it is connected to the internet 11. After a update interval, check the status of the Xively updates in the Xively 'Develop' page 12.
PoKeys user manual 2. 3. 4. 5. 6. 7. 8. 9. Select 'Standard HTTP POST service' option Enter 'www.userdomain.com/PoKeysDataUpload.asp' in the POST destination field Enter 'text/plain' in the 'Content-type' field. Enter 'MyData: ' in the 'Data header' field Enter the server's IP address and port number in the fields below. Enter 600 in the update time field Click OK and click Send to device button. Go back to Device > Web interface settings to page ‘Dashboard items’.
PoKeys user manual 8.22. Saving current configuration to file To save the current configuration to a file, go to ‘File’ > 'Save' menu and select a new filename. To reload a saved configuration from a file, go to ‘File’ > ‘Open’ menu and select the appropriate file. To transfer new settings to the device, click on the ‘Save to device’ button. 9.
PoKeys user manual Note: the following functions are disabled in PoTLog27 mode: - Encoders Macros Triggered key mapping and delayed/repeated key actions PWM outputs Joystick analog to digital mapping Connection signal PoExtBus Additional 1-wire devices support Custom device name To access the temperature measurements, these commands are available in PoKeys communication dll: GetAllSensorValuesString Retrieves all measurements in one string. Each measurements is separated with | sign.
PoKeys user manual Retrieves all sensor 64-bit IDs in one structure. bool GetAllSensorIDs(ref sPoTLogDevice logDevice) Arguments: none Remarks: C++ alternative: COM_GetAllSensorIDs(IntPtr logDevice) Example code (C#): sPoTLogDevice logger = new sPoTLogDevice(); MyDevice.GetAllSensorValues(ref logger); MyDevice.GetAllSensorIDs(ref logger); for (int i = 0; i < 27; i++) { byte sType = logger.sensors1Wire[i].sensorID[0]; double value = (double)logger.sensors1Wire[i].
PoKeys user manual 10. Connecting common peripherals to PoKeys devices Relays LEDs High-current LEDs 92 www.poscope.
PoKeys user manual Switches Example: Setting up key mapping This example shows how easy is to set up a digital input pin for direct key mapping We will set up a Shift-Escape combination for pin 15. 1. 2. 3. 4. 5.
PoKeys user manual 7. Select ‘Direct key mapping’ and from drop-down box select Escape 8. Click on the ‘Shift’ checkbox to enable Shift modifier 94 www.poscope.
PoKeys user manual 9. Send configuration to device by clicking ‘Send to device button’. Optocoupled digital output Optocoupled digital input 95 www.poscope.
PoKeys user manual Potentiometers (variable resistors) Linear motor control Rotational encoder switch 96 www.poscope.
PoKeys user manual LED displays/arrays 97 www.poscope.
PoKeys user manual 11. Restoring factory defaults - quick resetting the device configuration (or recovering bad firmware update) If configuration editor cannot be used to reconfigure the device because of endless key presses from the device, simple reset procedure should be executed. 1. 2. 3. 4. 5. 6.
PoKeys user manual 12. Frequently asked questions What software must be installed to operate the device? On first use or when reconfiguring the device, the supplied software must be installed. There are no device drivers needed. They are already supplied with your operating system. Once the device has been configured, the settings are stored on-board. Device can then be freely used on any machine (see requirements for USB HID device driver enabled operating system) without any additional installation.
PoKeys user manual I have connected a switch to pin 4 and now PoKeys55 is not recognized by the computer anymore. You must have connected normally-closed switch to pin 4 and therefore connected pin 4 to ground. At boot (connecting PoKeys55 to USB) this means that PoKeys55 is entering system boot and therefore cannot be used from the computer. Please use another pin for normally-closed switches. Note: on PoKeys55 boards with serial number above 11500, this problem is removed.
PoKeys user manual My problem is that when I start the program, everything works good for about 3 to 5 seconds, then the CPU “lock up” and the only way to recover is to unplug the PoKeys device. The problem occurs because you are writing 'dirty' code. You create object every time you need to use it in a loop, but you forget do properly dispose it.
PoKeys user manual The connection with the PoKeys56E/57E device cannot be established with 10BASE-T router Please check that you are using proper cable that is supported by 10BASE-T standard. The following diagram shows the correct wiring for different connection standards. (source: http://www.okidensen.co.jp/en/prod/cable/lan/img/cate6_n_fig05.gif) How should PoKeys inputs be protected for the use in (electrically) noisy environments? Please use the following circuitry for the input protection.
PoKeys user manual 13. PoKeys library functions The following list contains only the most commonly used library functions. For the list and description of all library functions, open the PoKeys DLL help file found in Start Menu > PoKeys > > Development > PoKeys DLL help. 13.1. ConnectToDevice (universal for all PoKeys devices) Connect to the device with the device’s serial number specified.
PoKeys user manual bool ConnectToDevice(int deviceIndex) Arguments: deviceIndex Index of the PoKeys device Remarks: Index is not UserID of the PoKeys device and therefore can change if more than one PoKeys device is used at a time. Function returns True if connection is established or False if there were errors. 13.4. DisconnectDevice Terminate the connection with the device. void DisconnectDevice() Arguments: none Remarks: This function should be called before class disposal or changing of the device.
PoKeys user manual Arguments: none Remarks: See example section for usage example 13.7. GetNumberOfDetectedNetworkDevices Returns the number of detected PoKeys56E devices. int GetNumberOfDetectedNetworkDevices() Arguments: none Remarks: See example section for usage example 13.8. ConnectToNetworkDevice Connects to PoKeys56E device with the specified IPv4 address in format xxx.xxx.xxx.xxx (e.g., 192.168.0.105, 192.168.050.002, etc.). If connection is established successfully, returns True.
PoKeys user manual serialNumber Variable in which serial number will be saved to firmwareVersionMajor Variable in which firmware major version will be saved to firmwareVersionMinor Variable in which firmware minor version will be saved to Remarks: Returns False on error. 13.10. GetUserID Retrieve user ID. bool GetUserID(ref byte userID) Arguments: userID Variable in which user ID will be saved to Remarks: Returns False on error. 13.11. SetUserID Set user ID.
PoKeys user manual Arguments: pinID Pin ID is zero-based pin index on the device (output marked as 1 therefore has index 0) pinFunction pinFunction has the following structure Bit 7 Pin invert Bit 6 reserved Bit 5 reserved Bit 4 A output Bit 3 A input Bit 2 D output Bit 1 D input Bit 0 reserved where A stands for analog and D for digital.
PoKeys user manual where A stands for analog and D for digital. Remarks: Returns False on error. 13.14. GetPinData Get pin data – pin's function and options.
PoKeys user manual 13.15. GetPinData Get pin data – pin's function and options. bool GetPinData(byte pinID, byte pinFunction) Arguments: pinID Pin ID is zero-based pin index on the device (output marked as 1 therefore has index 0) pinFunction pinFunction has the following structure Bit 7 Pin invert Bit 6 reserved Bit 5 reserved Bit 4 A output Bit 3 A input Bit 2 D output Bit 1 D input Bit 0 reserved where A stands for analog and D for digital. Remarks: Returns False on error. 13.16.
PoKeys user manual 13.17. SetOutput Set digital output status. bool SetOutput(byte pinID, bool outputState) Arguments: pinID Pin ID is zero-based pin index on the device (output marked as 1 therefore has index 0) outputState New output state Remarks: Pin must be set as digital output before this operation will function properly. On device initialization, pins are NOT set as outputs even if they are configured so.
PoKeys user manual devices). 0 means 0 V on input, while 255, 1023, respectively 4095 means Vdd (approximately 3.3V) on input. Returns False on error. Use the command GetAnalogValueMax to get this value automatically. GetAnalogValueMax Gets the maximum value of the analog-to-digital conversion. Returns 1024 for PoKeys55 devices and 4096 for PoKeys56 devices. int GetAnalogValueMax() Arguments: none 13.19. SaveConfiguration Saves current device configuration to non-volatile flash memory.
PoKeys user manual Number of columns and rows of the matrix keyboard row_pins An array of 8 bytes, each having an index of a pin that is associated with the row. Row pins must be set as digital outputs. column_pins An array of 8 bytes, each having an index of a pin that is associated with the column. Column pins must be set as digital inputs. macro_mapping An array of 64 boolean values (see below for numbering hint). If the value is set to true, instead of key press simulation, macro is run.
PoKeys user manual 13.21. SetMatrixConfiguration Set complete matrix keyboard configuration. bool SetMatrixKeyboardConfiguration(ref byte configuration, ref byte width, ref byte height, ref byte[] row_pins, ref byte[] column_pins, ref bool[] macro_mapping, ref byte[] keycodes, ref byte[] keymodifiers); Arguments: configuration If bit 0 is set, matrix keyboard is enabled.
PoKeys user manual 1 2 3 4 5 A 0 8 16 24 32 B 1 9 17 25 33 C 2 10 18 26 ... D 3 11 19 27 E 4 12 20 28 F 5 13 21 29 G 6 14 22 30 H 7 15 23 31 Remarks: Returns False on error. 13.22. GetPWMOutputs Get complete PWM outputs configuration bool GetPWMOutputs(ref duty_values); bool[] channels, ref uint period, ref uint[] Arguments: channels An array of 6 boolean values, each representing one PWM channel. Channel is enabled if this value is set to true. period 32-bit PWM period value.
PoKeys user manual Remarks: When using PWM enabled pins, digital inputs and outputs are inactive. Returns False on error. 13.23. SetPWMOutputs Set complete PWM outputs configuration bool SetPWMOutputs(ref duty_values); bool[] channels, ref uint period, ref uint[] Arguments: channels An array of 6 boolean values, each representing one PWM channel. Channel is enabled if this value is set to true. period 32-bit PWM period value.
PoKeys user manual When using PWM enabled pins, digital inputs and outputs are inactive. Returns False on error. 116 www.poscope.
PoKeys user manual 14. Interfacing with PoKeys library – C# example Preinitialization C# 1. Add a reference to a PoKeysDevice_DLL.dll, located in installation folder 2. Use the class PoKeysDevice from the PoKeysDevice_DLL namespace Visual Basic 6.0 1. Add a reference to a PoKeysDevice_DLL.tlb, located in installation folder 2. Use the class PoKeysDevice_DLL.PoKeysDevice Class initialization PoKeysDevice_DLL.PoKeysDevice cPoKeys = new PoKeysDevice_DLL.
PoKeys user manual Connecting to Ethernet devices – PoKeys56E Enumerating the ethernet devices, connecting and retrieving basic data The example below enumerates PoKeys56E devices, connects to every one of them and displays its user ID and type in the listbox named lstEthDevices. // Enumerate and list ethernet devices MyDevice.StartEthernetDiscovery(); byte userID = 0; lstEthDevices.Items.Clear(); lstEthDevices.Items.Add("Searching...."); lstEthDevices.Enabled = false; lstEthDevices.Refresh(); Application.
PoKeys user manual In this example 0 (Pin 1) is used for a pin ID. Pin IDs are 0 based. iPinFunction has the following structure Bit 7 Pin invert Bit 6 reserved Bit 5 reserved Bit 4 A output Bit 3 A input Bit 2 D output Bit 1 D input Bit 0 reserved where A stands for analog and D for digital.
PoKeys user manual Reading analog input value Let us presume that pin 43 is configured as analog input. // Read analog value int value = 0; MyDevice.GetAnalogInput(42, ref value); MessageBox.Show("Analog value: " + (3.3 * (double)value / MyDevice.GetAnalogValueMax()).ToString("0.00") + " V"); Joystick axis mapping (only on USB PoKeys devices – PoKeys55 and PoKeys56U) This is only possible on pins 43-47. If this is used on any other pin, the function will fail or be ignored. cPoKeys.
PoKeys user manual myDevice.BlockGetAnalogInput10bit(ref channels, ref values); int value1 = values[0]; int value2 = values[1]; int value3 = values[2]; Block write - digital It is possible to set 32 output pins with one request. All 55 pins can be set with two request joined in single command. // Simple 8-bit binary counter bool[] states = new bool[32]; for (int n = 0; n < 255; n++) { for (int i = 0; i < 8; i++) { if ((n & (1 << i)) > 0) states [i] = false; else states [i] = true; } MyDevice.
PoKeys user manual Save macro configuration to flash This command saves the current macro configuration to flash. cPoKeys.MacroSaveConfiguration(); Change macro name This command changes the macro name. Name property supports up to 7 characters. byte iMacroID = 0; cPoKeys.MacroSetName(iMacroID, "Macro1"); Set macro key This command sets one macro key at the position iIndex. This index must be between 0 and iMacroLen - 1. byte iIndex = 5; byte iKeyCode = 10; byte iKeyModifier = 0; cPoKeys.
PoKeys user manual while (true) { Application.DoEvents(); System.Threading.Thread.Sleep(100); // Move cursor to home dev.LCDGotoXY(1, 1); // Print current date and time dev.LCDPrint(DateTime.Now.ToString()); } Configuring PWM outputs Configures pin 17 as PWM output with 20 ms period and 1.5 ms (7.5%) duty cycle. If a model RC servo signal input is connected to this pin, servo motor horn should position itself in the middle position.
PoKeys user manual Reading matrix keyboard status Reads all matrix keyboard keys statuses. bool[] KeyStates = new bool[128]; MyDevice.GetMatrixKeyboardKeyStatus(ref KeyStates); string status = ""; for (int row = 0; row < 4; row++) { for (int col = 0; col < 4; col++) { status += KeyStates[row * 8 + col] ? "1 " : "0 "; } status += "\n"; } MessageBox.Show("Key statuses:\n" + status); Write data to PoExtBus device Sends the byte to the first PoExtBus device.
PoKeys user manual if (stat != 1) { MessageBox.Show("Error writing"); return; } // Read temperature – read two bytes from the device at the address of 0x90 MyDevice.I2CStartRead(0x90, 2); // This operation was quite fast, so no wait is needed... MyDevice.I2CGetReadStatus(ref stat, ref data); if (stat == 1) { MessageBox.Show("Temperature: " + data[0] + "°C"); } else { MessageBox.
PoKeys user manual 15. Major changes from 1.x to 1.7: To move the PoKeys55 device to a new level some major changes to interface were imminent. Pi n function 1 was removed (this was directly key mapped pin function). Instead, key mapping functionality was added to any digital input pin. Key mapping type (none/direct/macro) can be set via changed Key mapping command as shown in above example. 15.1.
PoKeys user manual 16. Errata information This section describes special limitations of the device. Pins 5 and 6 cannot be separately set as outputs/inputs Pins 5 and 6 must be both set to either input or output Affected: PoKeys56E, PoKeys57E Wrong power supply was specified for PoNET connector in the documentation PoNET connector has 5V power available at pin 1 and not 3.3V as previously stated. Stepper motor outputs of the internal pulse generator don’t generate proper step signals for axes y and z.
PoKeys user manual 17. Grant of license The material contained in this release is licensed, not sold. PoLabs grants a license to the person who installs this software, subject to the conditions listed below. Access The licensee agrees to allow access to this software only to persons who have been informed of and agree to abide by these conditions. Usage The software in this release is for use only with PoLabs products or with data collected using PoLabs products.