VNC2

Home Up VNC2 Adafruit RGB LED Matrix Visual Spin YModem Wavetable Midi Player Prop EKG Basic Window/Form System PropMonitor 1-Bit Bitmaps 6-Bit Bitmaps DAC Sparkfun Nokia LCD Cameras MP3 Wireless JuiceBox I/O Expansion Via I2C Secure Digital (SD) Card Interface Notes on Graphics_Demo.spin ADC 2-Bit Bitmap App TV Colors Interleaved Character Generator 4-Color Character Applet VGA Colors Applets

bullet

The VNC2 is a programmable USB controller.  It can be used to add USB hosts or slaves to the Propeller.

bullet

Instructions to easily add a USB keyboard or mouse to Propeller

bullet

This is a short tutorial on how to connect a USB keyboard or mouse to a Propeller chip using a serial connection.  The VNC2 also offers SPI and FIFO connections, but serial is easiest.

bullet

You'll need this hardware (in addition to a Propeller setup with PC):

bullet

V2DIP2-32 (Digikey part# 768-1055-ND). 

bullet

MOD VINCULUM-II DEV 2 PORT 32DIP | V2DIP2-32 | 768-1055-ND | Digi-Key Corp.

bullet

This board has the VNC2 chip installed in a DIP format. 

bullet

There are actually many other versions you can use, but I like this one the best for simplicity.

bullet

VNC2 Debug Module (Digikey part# 768-1052-ND).

bullet

bullet

This is needed to program the VNC2 chip.  It also allows debugging.

bullet

The first step is to install the VNC2 Toolchain.  This is the development environment that allows you to customize code and program the VNC2 chip.

bullet

Next, we'll open the USB keyboard example project.

bullet

Start the "Vinculum II IDE" and click on the round button in the top left corner and then pick "Open"->"Project" from the menu:

   

bullet

Browse to where samples are located and open the example project "USBHostHIDKbd.vproj":

bullet

Now, connect the debugger to the V2DIP2-32 module and connect your PC to the debugger with a USB cable.  Click on the "Debug" tab to see programming options.

bullet

The "Debugger Interface" pane should show the debugger module connected to the VNC2-32 pin device when properly connected.

bullet

Click the "Flash" button in the "Program" pane to build and program the device.

bullet

Click on the "Start" button in the "Debug" pane to make the program start.

bullet

Now that we have that running, we need to connect the Propeller to the VNC2 so we can see it working.  To start with, you just need to run 2 wires:  GND to GND and TX from VNC2 to the Prop.  Here's how I connected P6 on a Propeller Demo board to the TX pin of the V2DIP2-32 module and also the VSS pin to GND:

(click to enlarge)

bullet

Finally, run this propeller program "SerialMonitorVNC2" on the Propeller and then run the Propeller Serial Terminal on your PC and set it to the com port of the Propellers serial connection.  What SerialMonitor does is run 2 instances of fullduplexserial.  One instance reads data from the VNC2 and the other outputs that same data to the PC.  This allows you to quickly see what the VNC2 is outputting.

bullet

That's it!  If everything is working correctly, you should see "Waiting for enumeration" on the Serial Terminal while waiting for the USB keyboard to be plugged in.  Once the keyboard is connected you should see "Enumeration complete".  Then, when you hit a key on the keyboard you should see a "report" which tells you info on the keyboard state.

bullet

Note:  The keyboard's LEDs do not light by themselves.  You need to modify the VNC2 source code to do that.

bullet

Final Note:  If you have trouble getting the "reports" after seeing "Enumeration complete", try connecting the VNC2's RX pin to Vdd with a 10k pullup resistor and also CTS directly to GND.  FTDI swears you don't need to do this, but I found that I had to in order to get it to work every time.

bullet

See this forum thread for more details:  http://forums.parallax.com/showthread.php?135775

bullet