We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: Lucio Di Jasio
Last Updated: 2014-03-04
Package Version: 0.1.0.0
Category: Communication
Downloaded: 851 times
Not followed.
License: MIT license
A simple HID class API for the Clicker.
Connect to the Clicker via USB-HID and using a simple (expandable) set of commands, control click boards using the I2C, SPI, UART or direct I/O control.
Do you want to subscribe in order to receive notifications regarding "Clicker HID-API " changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Clicker HID-API " changes.
Do you want to report abuse regarding "Clicker HID-API ".
DOWNLOAD LINK | RELATED COMPILER | CONTAINS |
---|---|---|
1393931685_clicker_hid_api__other_pic.zip [43.15KB] | Other PIC Compilers |
|
1393931596_clicker_hid_api__other_other.zip [7.31KB] | Other Compiler |
|
INTRO The Clicker board is a perfect "XS size" development board to play with the large and intriguing array of Click boards. There is only one thing that it is missing (to be perfect) and that is a simple communication interface to enable experimenting to begin from the desktop. I wanted it to be cross-platform and easily extensible, ideally interactive from a command line. I want to experiment with the features of each specific click board without having to develop a complete embedded control project each time, compile, program load, debug (and repeat). A faster development cycle can truly unleash creativity. So my primary goal was to access the Clicker communication interfaces (I2C, SPI, UART and I/Os) from a simple USB-HID class command protocol. Once the command interpreter firmware is loaded on the PIC18F47J53, Python scripts, but also Visual Basic and of course C/C++ applications (using the cross platrform HIDAPI open source library) can access directly the mikro-bus. Some example scripts have been included in this project to demonstrate how in a few lines of code (Python) we can control one of the LED matrix click boards (see testRED.py), build a GUI and/or activate 10 PWM outputs (see testPWM.py).
REQUIREMENTS The main firmware project requires:
Enjoy and feel free to suggest and/or implement your improvements!
PROTOCOL The communication protocol adopted is extremely simple and based on a Full Speed HID class link established during enumeration of the Clicker board. Subsequently for each received packet of 64 bytes received by the clicker board:
INSTALLATION
There are several components that are required to get a complete demo working, here the short version:
Building the executable from the MPLAB X project source
(Note: you can bypass this step by loading directly the hex file, second attachment, onto the Clicker board)
1- Install the MLA release 2013-06-15 or prior(!),
2- Copy the /Microchip folder (or create a simlink on MAC/Linux) inside the same working directory where you unzipped the project package (.zip) as in:
/working_directory
..../Click-API
..../Microchip
3- Build and program the resulting .Hex file into the PIC18
Installing the HIDAPI libraries for your OS and language of choice
If you have never used the HIDAPI libraries (this is an open source project created and maintained by Signal 11) you will need to obtain the correct version for you programming language of choice:
- Obtain the Python HIDAPI library from: https://pypi.python.org/pypi/hidapi and follow the instructions contained to build and install on your OS.
- Obtain the C/C++ HIDAPI library from: https://github.com/signal11/hidapi/downloads