USB HID Keyboard

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
TedO
Posts: 79
Joined: Sat Mar 14, 2015 7:52 am
Has thanked: 46 times
Been thanked: 26 times
Contact:

USB HID Keyboard

Post by TedO »

Hi all,

I have modified the example program to generate a letter on the PC screen, have not tested it as I do not have the ECIO-40 module. Which is the smallest and most simplest of PIC's I can use with this USB_HID component to generate a single letter on the screen of a PC when a button is pressed? The second question is: can one send this data via any output pin on the pic? The USB has a Data + and a Data- connection, how does one connect this to the PIC that is used?

As I have never used this component before, I would really appreciate some help.

Regards
Ted

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: USB HID Keyboard

Post by Benj »

Hi Ted,

It's been a while since I looked at these, I believe the 18F14K50 is quite cheap and supports USB, the 18F24K50 might also be a good one.

The USB enabled chips have dedicated D+ and D- pins when using the USB functionality.

There are some 16F USB enabled devices now but I haven't personally played with these so don't know for sure that they will work.

The ECIO device will save you the pain of configuration settings etc and wiring up, e.g. it will simply work.

TedO
Posts: 79
Joined: Sat Mar 14, 2015 7:52 am
Has thanked: 46 times
Been thanked: 26 times
Contact:

Re: USB HID Keyboard

Post by TedO »

Hi Ben
Thanks for the help, it is greatly appreciated. The reason that I am not using the ECIO-40 module is because I need to incorporate this design into another project for a customer, so I need to keep size and price to a minimum.

Will get hold of a few samples of the PIC18F14K50 chip and try the program out with it, I see that FC6 does support this chip.

The chip does not have a function in the configure section where one can select an external or internal clock, so I take it that it is automatically set for internal clock? What should the clock speed be set at for USB operation?

Many thanks
Ted

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: USB HID Keyboard

Post by Benj »

Hi Ted,

The project clock speed needs to be set to 48000000.

You can use the internal oscillator or you can use an external crystal. I'd recommend a 12MHz crystal and the config settings as shown below.
Config.jpg
(287.45 KiB) Downloaded 734 times

TedO
Posts: 79
Joined: Sat Mar 14, 2015 7:52 am
Has thanked: 46 times
Been thanked: 26 times
Contact:

Re: USB HID Keyboard

Post by TedO »

Thanks for the help Ben,

Will check the results when I have received my chips.

Regards
Ted

Post Reply