• SYNOPSIS

The scope is highly intuitive and easy to use. The ability to use the device as a spectrum analyzer is a real plus. Please know that the device has to discover the USB port each time and if left connected, with the PC powered off, the device needs to be unplugged and plugged back in for the PC to discover it. Main Dealer for the whole Velleman product range. Stocked in the UK, the full range of Velleman Mini Kits, Kits & Modules. Also available the full range of Velleman Test Instruments, Educational Series, Arduino Shields & the VelbusĀ® Home Automation System. We can supply any product from the whole Velleman Product range for the electronics enthusiast. It is a human interface device that uses Windows driver; you should always be able to find it amongst connected devices immediately after you plug it to an USB port. Other USB devices require prior. In this project we'll use C# to find out which comm port is assigned to the FTDI UMFT234XF USB to UART module. The example code can be used with most FTDI devices and shows how to use the FTDI DLL to make the appropriate calls for information and control. The end result is a very low cost and high speed serial port that we can build upon for a.

Device::Velleman::K8055::Fuse - Communication with the Velleman K8055 USB experiment board using Fuse and K8055fs

Version 0.96

Projects

Device::Velleman::K8055::Fuse provides an object-oriented API to the k8055fs Fuse-based interface to the Velleman K8055 USB Experimental Interface Board.

Using the module, it is possible to set two 5v analog output ports, read from two 5v analog input boards, read from a 5-bit digital input stream, write to an 8-bit digital output stream, and set two digital counters with configurable gate times.

In order to work with this module, the k8055fs utility must be installed. This utility relies on Fuse, which must also be installed.

new()

The constructor. Buils the object.

Example:

New object with k8055 card initialisation

New object using initialized k8055 card

Inputs

(optional) initDevice: hash reference containing the inputs expected by InitialiseDevice. Refer to method documentation below for input specifications. If initDevice exists, then method InitialseDevice is called inside the constructor.

debug = 0 / 1 : Debug flag for outputing debugging information

pathToDevice : the name of the path where the k8055fs commands are mounted.

Returns the object on success

testHarness = 0/1 : Use a test harness rather than the card itself. This allows debugging of the applicaiton logic without relying on the hardware itself being present.

When the test harness is activated, option test => 1 is automatically passed to the InitialiseDevice method.

Furthermore, any Set functionality returns the set value or array of the value, as relevant. Any get function returns -1.

ReadAnalogChannel();

Reads the value from the analog channel indicated by (1 or 2). The input voltage of the selected 8-bit Analogue to Digital converter channel is converted to a value which lies between 0 and 255.

Returns the numeric value.

ReadAllAnalog();

ReadAllAnalog reads the values from the two analog ports into $data1 and $data2.

Inputs: None

Outputs: array of two numeric values

OutputAnalogChannel();

This outputs $value to the analog channel indicated by $channel.

The indicated 8-bit Digital to Analogue Converter channel is altered according to the new value. This means that the value corresponds to a specific voltage. The value 0 corresponds to a minimum output voltage (0 Volt) and the value 255 corresponds to a maximum output voltage (+5V). A value of $value lying in between these extremes can be translated by the following formula : $value / 255 * 5V.

See also SetAnalogChannel() and SetAllAnalog()

Drivers velleman projects port devices download

OutputAllAnalog();

This outputs $value1 to the first analog channel, and $value2 to the second analog channel. If only one argument is passed, then both channels are given the same value.

See also: SetAllAnalog()

ClearAnalogChannel();

This clears the analog channel indicated by $channel. The selected DA-channel is set to minimum output voltage (0 Volt).

Input: channel number

Output: value between 0 (min) and 255 (max)

See also OutputAnalogChannel(), ClearAllAnalog()

ClearAllAnalog();

The two DA-channels are set to the minimum output voltage (0 volt).

Returns 0 on success. returns undef if either of the analog channels failed.

SetAnalogChannel();

Sets the selected 8-bit Digital output, which in turns sets the DAC voltage. Returns the set value (255) corresponding to this voltage.

SetAllAnalog();

The two DA-channels are set to the maximum output voltage. Returns 255 on success. returns undef if either of the analog channels failed.

WriteAllDigital();

The channels of the digital output port are updated with the status of the corresponding bits in the $value parameter. A high (1) level means that the microcontroller IC1 output is set, and a low (0) level means that the output is cleared.

$value is a decimal value between 0 and 255 that is sent to the output port (8 channels).

Returns the value on success, returns undef on error.

ClearDigitalChannel();

This clears the digital output channel $channel, which can have a value between 1 and 8 that corresponds to the output channel that is to be cleared.

This is the opposite of SetDigitalChannel.

Returns 0 on success, undef on error.

ClearAllDigital();

This clears (sets to 0) all digital output channels.

Returns 0 on success, undef on error.

SetDigitalChannel();

This sets the digital output channel $channel, which can have a value between 1 and 8 that corresponds to the output channel that is to be cleared.

This is the opposite of ClearDigitalChannel.

AssignDigitalChannel();

This assigns a value todigital channel $channel to the assigned value.

SetAllDigital();

This sets all digital output channels to 1 (true).

sets all digital output channels to 1, giving '1111111'.

ReadAllDigital()

This reads all 5 digital ports at once. The 5 least significant bits correspond to the status of the input channels. A high (1) means that the channel is set, a low (0) means that the channel is cleared. Returns the decimal value of the the 8-channel interface card (0-255) unless flag 'bin' is set.

If input contains one string with content 'bin' , then returns an array of binary characters (0/1).

Returns undef on error.

ReadDigitalChannel();

The status of the selected input $channel is read.

$channel can have a value between 1 and 8 which corresponds to the input channel whose status is to be read.

The return value will be true (1) if the channel has been set, false (0) otherwise

Drivers velleman projects port devices download

returns undef on error.

Note: on the K8055, the addresses of digital inputs 1-5 are not the equivalent binary values.

Refer to the hash $dev->{I} giving the mappings between the card digital input number I and equivalent decimal and binary value, and bit number. $dev->{I} is defined in the constructor.

ReadCounter();

The function returns the status of the selected 16 bit pulse counter. The counter number 1 counts the pulses fed to the input I1 and the counter number 2 counts the pulses fed to the input I2.

returns an 16 bit count on success.

returns undef on error.

ResetCounter();

This resets the selected pulse counter.

returns undef on error.

SetCounterDebounceTime();

The counter inputs are debounced in the software to prevent false triggering when mechanical switches or relay inputs are used. The debounce time is equal for both falling and rising edges. The default debounce time is 2ms. This means the counter input must be stable for at least 2ms before it is recognised, giving the maximum count rate of about 200 counts per second. If the debounce time is set to 0, then the maximum counting rate is about 2000 counts per second.

The $deboucetime value corresponds to the debounce time in milliseconds (ms) to be set for the pulse counter. Debounce time value may vary between 0 and 5000.

returns the set time in milliseconds on success.

returns undef on error.

get()

uses IO::File to retrieve data from the FUSE files. Refer to the k8055fs readme for details.

This is a low-level call that is not particualrly intended for direct access from the API.

The path to the command is defined by hash key pathToDevice in the constructor.

Returns $value on success and undef on error.

set($file,$value)

uses IO::File to send io to the FUSE files. Refer to the k8055fs readme for details.

This is a low-level call that is not particualrly intended for direct access from the API. Using the set function could desynchronize the internal representation for the binary array held in array

The path to the command is defined by hash key pathToDevice in the constructor.

Returns $value on success and undef on error.

dec2bin($dec)

convert a decimal to a string representing a bin

The binary string is represented as a big-endian. In big-endian encoding, digits increase as the string progresses to the left:

bin2dec($bin)

convert a string representing a binary number to a decimal number.

Refer to dec2bin for information on the binary format in use.

InitDevice (%args)

Initialises the k8055 USB device by mounting the k8055 file system.

usage: $dev->InitialseDevice({-U=>1, -b=>2, pathToDevice=>'/tmp/8055'})

Input arguments

-b board number. (2-4) If skipped, default board (1) number is taken.

-U 1 0r 0 turn on USB debugging if true.

pathToDevice: Desired mount point of the k8055fs application. This directory needs to be accessible by the user.

Drivers Velleman Projects Port Devices For Sale

fuseOptions: additional options to pass to FUSE.

Drivers Velleman Projects Port Devices

test: do not run the k8055fs initialiaation. Print the command to STDOUT and return success. This is for debugging support.

See also new().

Ronan Oger, <[email protected]>

Special thanks to Jouke Visser, author of Device::Velleman::K8055 for writing the original win32-based module. I extensively copied his documentation and derived the method names from the names used by Jouke.

Likely to be many, please use http://rt.cpan.org/ for reporting bugs. The counter functionality is poorly tested and I suspect it has bugs.

For more information on this board, visit http://www.velleman.be.

For more information on the K0855fs fuse implementation of K0855, visit https://launchpad.net/k8055fs

For more information on the Fuse driver, visit the FUSE project on sourceforge: http://fuse.sourceforge.net

Drivers Velleman Projects Port Devices Download

For Win32 applications, see Jouke Visser's Device::Velleman::K8055 implementation.

Copyright 2008 Ronan Oger, All Rights Reserved.

Drivers Velleman Projects Port Devices Gigabit

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

To install Device::Velleman::K8055::Fuse, copy and paste the appropriate command in to your terminal.

For more information on module installation, please visit the detailed CPAN module installation guide.