Emulating a Windows PC USB Keyboard

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
iain wilkie
Posts: 97
Joined: Tue Jul 14, 2009 4:37 pm
Has thanked: 13 times
Been thanked: 9 times
Contact:

Emulating a Windows PC USB Keyboard

Post by iain wilkie »

Having seen that Flowcode4 for AVR (which is what I have) has no USB support, I do realise that I will probably need to purchase
a copy of Flowcode for PIC in order to do this.

What I need to do is create a piece of hardware that has 5 buttons that connect to a Windows PC USB port
and will act as if it is a PC Keyboard. The actual keys are un-important at the moment but it could be
the 4 arrow keys and the return key for instance. In other words its a USB HID device.

What is the simplest PIC I could use for this and presumably there are Flowcode modules to make this
an easy task ?. Also am I correct in that I cannot use the AVR flowcode for this ?

Iain

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: Emulating a Windows PC USB Keyboard

Post by Benj »

Hello Iain.

Flowcode AVR does not support the USB components as the AVR devices do not have the inbuilt USB hardware. However you can bit bang USB using an AVR but it is slow. There are lots of C code examples of how to do this but it may still be hard to integrate into Flowcode without a good understanding of C code.

Flowcode PIC uses USB hardware so it takes a lot of the work away from the processor allowing for full speed USB comms. A 2455 is a good little USB device or you could go for an ECIO which is basically a 18F2455 with tthe USB socket and crystal etc prefitted and a bootloader to allow easy reprogramming. The Flowcode PIC USB components take away all of the hard work and simply let you get on with designing your peripheral.

You will receive a discount if you do decide to purchase Flowcode PIC as you already have an AVR license. Please speak to our sales team and they will be able to let you know the exact cost.

iain wilkie
Posts: 97
Joined: Tue Jul 14, 2009 4:37 pm
Has thanked: 13 times
Been thanked: 9 times
Contact:

Re: Emulating a Windows PC USB Keyboard

Post by iain wilkie »

Thanks Ben,

I will contact sales about the Flowcode for PIC .... no point in making things difficult. I have never liked the PIC
architecture, but Flowcode takes the sting out of that anyway so I am happy to go the PIC route.

Is there an in-built Windows keyboard HID with Flowcode 4 ?

Iain

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: Emulating a Windows PC USB Keyboard

Post by Benj »

Hello Iain,

Yes v4 for PIC comes with a HID USB keyboard example and an example that then uses this to create a datalogger which can auto fill data into an excel table.

cantronicx
Posts: 16
Joined: Fri Jul 23, 2010 9:53 pm
Has thanked: 4 times
Been thanked: 1 time
Contact:

Re: Emulating a Windows PC USB Keyboard

Post by cantronicx »

There are AVR microcontroller that have the USB built-in but flowcode is far far behind with so many PIC and AVR microcontroller chips. The AVR microcontroller AT90USB162 for example, has been out for many years but not a supported by flowcode.

User avatar
Steve
Matrix Staff
Posts: 3424
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Re: Emulating a Windows PC USB Keyboard

Post by Steve »

Flowcode's support for the more advanced internal modules is limited. There is support for the internal CAN module for that chip - please see the articles section of the forum.

Post Reply