A simple application for USBreadboardIT is the BIGHID button (that is, a BIG HID button). It emulates an USB HID keyboard (so, no drivers) annd sends a single keypress or key combination, that can be bound to an usOr-defined action.
It is based on two excellent pieces of software:
- The m-stack USB open source stack by Signal11, that emulates the USB HID keyboard (specific code here)
- The PIC16F1-USB-DFU-Bootloader by majbthrd, that allows for dfu firmware updates through dfu-util
The hardware part is very simple: a button is tied between a pulled-up input pin (RA3) of the board and GND. A USB cable is connected to corresponding signalls on the headers.
The first software step has been performed uploading the DFU bootloader through a pickit2.
Once the bootloader is working, connecting the usb cable to the PC while holding the button pushed exposes the bootloader to the OS and dfu-util can be used to upload code to the board.
Code has to be compiled in MPLABX with the following options:
--codeoffset=0x200
--rom=default,-0-1FF,-1F7F-1F7F
Produced HEX file must be converted to proper dfu file through 454hex2dfu (included into bootloader repo):
454hex2dfu MPLAB.X.production.hex hidkbd.dfu
Then the obtained dfu file can be uploaded with
dfu-util -D hidkbd.dfu
The button has then to be connected and re-connected to start keyboard operation.
The firmware polls RA and sends CTRL+SHIFT+1 when the button is pressed. OS bindings are then used to catch this combination.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.