TOP Contributors

  1. MIKROE (2642 codes)
  2. Alcides Ramos (348 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136223 times)
  2. FAT32 Library (69492 times)
  3. Network Ethernet Library (55711 times)
  4. USB Device Library (45994 times)
  5. Network WiFi Library (41639 times)
  6. FT800 Library (40801 times)
  7. GSM click (28789 times)
  8. PID Library (26332 times)
  9. mikroSDK (26059 times)
  10. microSD click (25146 times)
Libstock prefers package manager

Package Manager

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]

< Back
Project

Clicker HID-API

Rating:

0

Author: Lucio Di Jasio

Last Updated: 2014-03-04

Package Version: 0.1.0.0

Category: Communication

Downloaded: 832 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.

No Abuse Reported

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 ".

  • Information
  • Comments (0)

Project Blog

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:

  • MPLAB X (v.2.0 and above, free)
  • MPLAB C18 compiler (free)  
  • MLA v. 2013-06-15 (previous versions ok, do not use the 2013-12 or later)
  • Python 2.6 or 2.7 
  • HIDAPI library (Python or C for the desktop platform of choice, MAC, Windows, Linux) 

 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:

  • The first byte is used to discriminate the command. Commands are grouped logically by communication interface (I2C, Serial...)
  • If recognized, after execution a response packet is returned to the PC with the same command in the first position
  • If not recognized or if execution failed, a packet with 0xFF in the first position is returned 
  •  

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

ALSO FROM THIS AUTHOR

Mikromedia HID Bootloader for OS X (and Linux)

0

HID boot loader written in Python (for portability) to support OS X and Linux users. Please refer to the blog post: http://blog.flyingpic24.com/2014/09/03/a-cross-platform-mikromedia-hid-bootloader/ To contribute to the 'live' project please refer to the repository on bitbucket: https://bitbucket.org/luciodj/pic24-mikromedia-bootloader

[Learn More]

Mikromedia QT2 display IL9341 support for legacy MLA 1306

0

Copy these two files to the MLA /Drivers and /Include/Graphcis to add support for the new Qt2 displays.

[Learn More]