USB keyboard emulation, USB USBizi Application deployement, USB application configuration

Still coming up the USBizi learning curve and looking for help / suggestions / examples to accomplish the following.

We want our product to perform USB keyboard emulation. It will receive data from a barcode scanner on a com port, process it and then send it out to the PC using USB HID keyboard (keyboard emulation). It will send various fields of data with keyboard navigation keystrokes like TAB, RIGHT ARROW, etc to autofill a form running on the PC using a user defined formula or script. Since form layout will change, we need to update this formula or script. This leads to our second requirement, USB application configuration.

Using the USB CDC virtual serial feature, we think its possible to communicate with our application or an SD card to update this formula or script. So we want to read and write configuration data. It appears the CDC - Virtual Serial feature will do this for us.

Finally, we want to be able to update our application in the field using the same USB cable. We will provide software to our customers who will run it on their local PC and this software will update or replace our application in the USBizi chip. Searching the forums/tutorials, we think the USBiziUpdater may be important and we are hoping it would work over USB using the CDC - Virtual Serial feature.

We are using USBizi chip in our design (FEZmini) and are interested in finding hardware/software examples to accomplish the above.

The questions we have now are
1.) Is the above possible?
2.) What are best practices for changing the operational modes for the USB port (i.e. using switches versus software timeout).
3.) Best way to save configuration data? Since we may be logging barcode scan data in our device, we are already considering using the SD card but are interested in using USBizi internal flash (if accessible) to save a few hundred bytes of data.

Any guidance is greatly appreciated.


I prefer switches

SD card or add flash chip

Thanks for fast reply.

What pins do I need to configure on Mini to drive hardware into one of the above states
[ulist]normal operation - keyboard emulation,
virtual serial port for updating configuration,
and firmware load? [/ulist]

Firmware Load
It seems for firmware load, the following is required for USBiziUpdater
[ol]hold down the LDR button (boot loader button on FezMini,
connect USB cord,
then press and release the RESET button (reset button on Fez Educational board) ,
then release the LDR button to get USBiziUpdater connected.[/ol]

[italic]Note: If updating device for the first time, Windows will ask for a new driver. The driver file is GHI_BootLoader_Interface.inf [/italic]

Do any other pins like RX/TX need to be set at a particular value? I’ve seen several posts about floating inputs causing issues.

Virtual serial port - read/write to SD card - app. config data
What pins are important for this mode?
Do any other pins like RX/TX need to be set at a particular value?

Normal operation - keyboard emulation,

This is the normal state the unit will be in and how its used out of the box.
What pins are important for this mode?
Do any other pins like RX/TX need to be set at a particular value?

Thanks again for your help.

I understand you are trying to figure it all out as much as you can but this will only get you lost. FEZ is easy but take it one step at a time and post one question per thread. Any answer I would give you now will only get you lost.

This will greatly help Support – GHI Electronics
specifically look at USB section

Hi Gus

Given my description above, and reviewing the link you forwarded, it appears the USBClientController needs to be switched in my application from CDC to Keyboard

[italic]USBC_Keyboard kb = USBClientController.StandardDevices.StartKeyboard();
USBC_CDC cdc = USBClientController.StandardDevices.StartCDC();[/italic]

One way would be to put a small switch in my design and the hardware would check this switch state and switch between keyboard and CDC. If we have to put in two momentary contact switches for Boot Loader and Reset, I suppose it makes sense to add a third switch that the software checks on boot and if pressed, switches on the CDC mode.

Another way would be to start in CDC mode on boot and if no data is received by the hardware in 5 seconds, switch to keyboard mode.

Which would you suggest?
I’m assuming both can not run at same time. Is this true?

I would go with a switch

Hi Gus

As I was reading about the USBClientController.StandardDevices.StartMassStorage and thinking about our design, it seems a better way to design our product is to use the Mass Storage instead of the CDC virtual com port to write configuration data and access log files…

So when booting we check the state of a hardware switch and start either
USBClientController.StandardDevices.StartMassStorage or USBClientController.StandardDevices.StartKeyboard

Then FEZmini is either a USB keyboard or a USB flash drive.

If we do this, we don’t have to develop code for the PC and the FezMini to communicate over a serial line. We can just have a PC application which writes to and reads from the SD card.

Would that be easier, faster, use less code, etc.?

The libs are made to be generic. We tried to cover most uses, for different customer, on different devices, for different markets.