FTDI Community

General Category => Discussion - Software => Topic started by: AndersG on October 02, 2020, 02:36:30 PM

Title: VNC1L as a keyboard controller? Polled vs interrupted?
Post by: AndersG on October 02, 2020, 02:36:30 PM
I have a design for an universal keyboard controller for a special type of equipment that use a proprietary protocol. The design is based on a PI24 microcontroller. Unfortunately does that PIC only have one USB port and the microchip libraries lack support for hubs so I thought I'd investigate using a VNC1L as I already had one from another project. The proprietary protocol part is done as is PS/2 input for both Keyboard and mouse.

I am interfacing the VNC1L through SPI and I run it at maximum speed. The docs are sketchy, but I found some examples, brief ones in the internet, but I am wondering if I am going about things the wrong way as this implementation is far from ideal, ie:

You issue an "SSU $A101000100000800"  and then loop polling "SSU $210A003D00000000" where 3D is the desired poll speed.

Sometimes, out of the blue the VNC1L will return "Command failed" in which case I have to reissue "SSU $A101000100000800" and then continue polling.

My problem is that this polling eats a lot of cpu cycles that are better needed elsewhere. Is there a more elegant way to do this with a VNC1L or with another chip?
Title: Re: VNC1L as a keyboard controller? Polled vs interrupted?
Post by: FTDI_USA on October 05, 2020, 04:26:43 PM
Hello:

You may want to consider using our newer VNC2-48L chip - we have precompiled firmware that supports USB Keyboard to SPI or UART interfaces.

VNC2 Datasheet:
https://www.ftdichip.com/Support/Documents/DataSheets/ICs/DS_Vinculum-II.pdf

SPI Slave to USB HID Device FW:
https://www.ftdichip.com/Support/Documents/AppNotes/AN_199_VNC2_SPI_SLAVE_to_HID_Class_Device_Bridge.pdf
https://www.ftdichip.com/Firmware/Precompiled/SPISlave2USBSlaveHIDKbd.zip

UART to USB HID Device FW:
https://www.ftdichip.com/Support/Documents/AppNotes/AN_194_VNC2_UART_to_HID_Class_Device_Bridge.pdf
https://www.ftdichip.com/Firmware/Precompiled/UART2USBSlaveHIDKbd.zip





Title: Re: VNC1L as a keyboard controller? Polled vs interrupted?
Post by: AndersG on October 18, 2020, 11:30:03 AM
Thanks! I will look into it. FWIW, I think I have it sorted with the VNC1L though.

The VNC2-32L1C looks tempting though.. How different is it from the VNC1 as an USB to SPI host?
Title: Re: VNC1L as a keyboard controller? Polled vs interrupted?
Post by: FTDI_USA on October 20, 2020, 04:04:21 PM
Hello:

The VNC1L SPI interface is only available as a SPI slave and uses "managed mode" SPI, which is not commonly used.

The VNC2-32L1C can be configured as a SPI slave or master, and supports "unmanaged SPI", which makes it compatible with industry standard SPI interfaces.

Feel free to contact me via  us.support@ftdichip.com  going forward.



Best Regards,

FTDI USA