<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://rtime.felk.cvut.cz/hw/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Calvi</id>
	<title>HW wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://rtime.felk.cvut.cz/hw/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Calvi"/>
	<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php/Special:Contributions/Calvi"/>
	<updated>2026-05-19T05:27:43Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3090</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3090"/>
		<updated>2007-08-31T08:59:50Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Project definition */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host giving the possibility to connect any USB device (Flash Disc, web camera, etc) to microprocessors which have not integrated USB. The library will be programmed by connecting USB data disc and VNC1L to ATmega microprocessor with SPI and UART interface.&lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections to reprogram VNC1L Flash memory]]&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_Cabling2.jpg|thumb|Fig.3: Connections for SPI communication]]&lt;br /&gt;
[[Image:UART_Connections.jpg|thumb|Fig.4: Connections for UART communication]]&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Communication through SPI protocol:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Communication through UART protocol:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Both devices exchange data through a UART protocol. They are linked to each other as shown beside on &#039;Fig.4&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in UART mode using J3 and J4 three way jumper pin headers (J3 pull up ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication with MSP430 microcontroler:&#039;&#039;&#039;&lt;br /&gt;
[[Image:MSP430_Schematic.jpg|thumb|Fig.5: Schematic of connections for MSP430 module]]&lt;br /&gt;
&lt;br /&gt;
In order to communicate with VNC1L from MSP430 microcontroler, I had to create the following module adding a 4 MHz oscillator and giving access to all I/O port pins:&lt;br /&gt;
&lt;br /&gt;
[[Image:MSP430 module1.jpg]]&lt;br /&gt;
&lt;br /&gt;
ORCAD schematic of the MSP430 module&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init (unsigned int ubrr)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI or UART protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char receive ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receive a byte from VNC1L via SPI or UART and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receive several bytes from VNC1L and write them into the ‘char’ chain given&lt;br /&gt;
 as parameter until a single carriage return (0x0D) or a null value (0x00) &lt;br /&gt;
 is received or until the ‘char’ chain is full.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receive sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int transmit (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI or UART protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_one (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_two (char My_Command1[], char My_Command2[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given with the two parameters and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[], char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the second given parameter (or created if it did not exist yet) and &lt;br /&gt;
 write the &#039;char&#039; chain given as first parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read_file (char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the given parameter and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute_one (&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can write more data into the same file without overwriting the previous ones&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read_file(&amp;quot;NEW.TXT&amp;quot;);)&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://focus.ti.com/lit/ds/slas368e/slas368e.pdf MSP430F169 Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://focus.ti.com/mcu/docs/mcutechdocs.tsp?sectionId=96&amp;amp;tabId=1502&amp;amp;techDoc=6&amp;amp;familyId=342&amp;amp;documentCategoryId=6 Texas Instrument_MSP430_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3089</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3089"/>
		<updated>2007-08-31T08:58:45Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host giving the possibility to connect any USB device (Flash Disc, web camera, etc) to microprocessors which have not integrated USB. The library will be programmed by connecting USB data disc and VNC1L to ATmega microprocessor with SPI and RS232 interface.&lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections to reprogram VNC1L Flash memory]]&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_Cabling2.jpg|thumb|Fig.3: Connections for SPI communication]]&lt;br /&gt;
[[Image:UART_Connections.jpg|thumb|Fig.4: Connections for UART communication]]&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Communication through SPI protocol:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Communication through UART protocol:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Both devices exchange data through a UART protocol. They are linked to each other as shown beside on &#039;Fig.4&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in UART mode using J3 and J4 three way jumper pin headers (J3 pull up ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication with MSP430 microcontroler:&#039;&#039;&#039;&lt;br /&gt;
[[Image:MSP430_Schematic.jpg|thumb|Fig.5: Schematic of connections for MSP430 module]]&lt;br /&gt;
&lt;br /&gt;
In order to communicate with VNC1L from MSP430 microcontroler, I had to create the following module adding a 4 MHz oscillator and giving access to all I/O port pins:&lt;br /&gt;
&lt;br /&gt;
[[Image:MSP430 module1.jpg]]&lt;br /&gt;
&lt;br /&gt;
ORCAD schematic of the MSP430 module&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init (unsigned int ubrr)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI or UART protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char receive ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receive a byte from VNC1L via SPI or UART and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receive several bytes from VNC1L and write them into the ‘char’ chain given&lt;br /&gt;
 as parameter until a single carriage return (0x0D) or a null value (0x00) &lt;br /&gt;
 is received or until the ‘char’ chain is full.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receive sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int transmit (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI or UART protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_one (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_two (char My_Command1[], char My_Command2[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given with the two parameters and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[], char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the second given parameter (or created if it did not exist yet) and &lt;br /&gt;
 write the &#039;char&#039; chain given as first parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read_file (char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the given parameter and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute_one (&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can write more data into the same file without overwriting the previous ones&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read_file(&amp;quot;NEW.TXT&amp;quot;);)&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://focus.ti.com/lit/ds/slas368e/slas368e.pdf MSP430F169 Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://focus.ti.com/mcu/docs/mcutechdocs.tsp?sectionId=96&amp;amp;tabId=1502&amp;amp;techDoc=6&amp;amp;familyId=342&amp;amp;documentCategoryId=6 Texas Instrument_MSP430_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3088</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3088"/>
		<updated>2007-08-31T08:58:21Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Documentation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host giving the possibility to connect any USB device (Flash Disc, web camera, etc) to microprocessors which have not integrated USB. The library will be programmed by connecting USB data disc and VNC1L to ATmega microprocessor with SPI and RS232 interface.&lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections to reprogram VNC1L Flash memory]]&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_Cabling2.jpg|thumb|Fig.3: Connections for SPI communication]]&lt;br /&gt;
[[Image:UART_Connections.jpg|thumb|Fig.4: Connections for UART communication]]&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Communication through SPI protocol:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Communication through UART protocol:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Both devices exchange data through a UART protocol. They are linked to each other as shown beside on &#039;Fig.4&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in UART mode using J3 and J4 three way jumper pin headers (J3 pull up ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication with MSP430 microcontroler:&#039;&#039;&#039;&lt;br /&gt;
[[Image:MSP430_Schematic.jpg|thumb|Fig.5: Schematic of connections for MSP430 module]]&lt;br /&gt;
&lt;br /&gt;
In order to communicate with VNC1L from MSP430 microcontroler, I had to create the following module adding a 4 MHz oscillator and giving access to all I/O port pins:&lt;br /&gt;
&lt;br /&gt;
[[Image:MSP430 module1.jpg]]&lt;br /&gt;
&lt;br /&gt;
ORCAD schematic of the MSP430 module&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init (unsigned int ubrr)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI or UART protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char receive ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receive a byte from VNC1L via SPI or UART and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receive several bytes from VNC1L and write them into the ‘char’ chain given&lt;br /&gt;
 as parameter until a single carriage return (0x0D) or a null value (0x00) &lt;br /&gt;
 is received or until the ‘char’ chain is full.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receive sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int transmit (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI or UART protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_one (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_two (char My_Command1[], char My_Command2[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given with the two parameters and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[], char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the second given parameter (or created if it did not exist yet) and &lt;br /&gt;
 write the &#039;char&#039; chain given as first parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read_file (char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the given parameter and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute_one (&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can write more data into the same file without overwriting the previous ones&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read_file(&amp;quot;NEW.TXT&amp;quot;);)&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://focus.ti.com/lit/ds/slas368e/slas368e.pdf MSP430F169 Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;br /&gt;
* [http://focus.ti.com/mcu/docs/mcutechdocs.tsp?sectionId=96&amp;amp;tabId=1502&amp;amp;techDoc=6&amp;amp;familyId=342&amp;amp;documentCategoryId=6 Texas Instrument_MSP430_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3087</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3087"/>
		<updated>2007-08-31T08:55:22Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host giving the possibility to connect any USB device (Flash Disc, web camera, etc) to microprocessors which have not integrated USB. The library will be programmed by connecting USB data disc and VNC1L to ATmega microprocessor with SPI and RS232 interface.&lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections to reprogram VNC1L Flash memory]]&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_Cabling2.jpg|thumb|Fig.3: Connections for SPI communication]]&lt;br /&gt;
[[Image:UART_Connections.jpg|thumb|Fig.4: Connections for UART communication]]&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Communication through SPI protocol:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Communication through UART protocol:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Both devices exchange data through a UART protocol. They are linked to each other as shown beside on &#039;Fig.4&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in UART mode using J3 and J4 three way jumper pin headers (J3 pull up ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication with MSP430 microcontroler:&#039;&#039;&#039;&lt;br /&gt;
[[Image:MSP430_Schematic.jpg|thumb|Fig.5: Schematic of connections for MSP430 module]]&lt;br /&gt;
&lt;br /&gt;
In order to communicate with VNC1L from MSP430 microcontroler, I had to create the following module adding a 4 MHz oscillator and giving access to all I/O port pins:&lt;br /&gt;
&lt;br /&gt;
[[Image:MSP430 module1.jpg]]&lt;br /&gt;
&lt;br /&gt;
ORCAD schematic of the MSP430 module&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init (unsigned int ubrr)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI or UART protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char receive ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receive a byte from VNC1L via SPI or UART and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receive several bytes from VNC1L and write them into the ‘char’ chain given&lt;br /&gt;
 as parameter until a single carriage return (0x0D) or a null value (0x00) &lt;br /&gt;
 is received or until the ‘char’ chain is full.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receive sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int transmit (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI or UART protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_one (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_two (char My_Command1[], char My_Command2[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given with the two parameters and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[], char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the second given parameter (or created if it did not exist yet) and &lt;br /&gt;
 write the &#039;char&#039; chain given as first parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read_file (char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the given parameter and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute_one (&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can write more data into the same file without overwriting the previous ones&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read_file(&amp;quot;NEW.TXT&amp;quot;);)&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
* [http://focus.ti.com/lit/ds/slas368e/slas368e.pdf MSP430F169 Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;br /&gt;
* [http://focus.ti.com/mcu/docs/mcutechdocs.tsp?sectionId=96&amp;amp;tabId=1502&amp;amp;techDoc=6&amp;amp;familyId=342&amp;amp;documentCategoryId=6 Texas Instrument_MSP430_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3086</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3086"/>
		<updated>2007-08-31T08:53:55Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Documentation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host giving the possibility to connect any USB device (Flash Disc, web camera, etc) to microprocessors which have not integrated USB. The library will be programmed by connecting USB data disc and VNC1L to ATmega microprocessor with SPI and RS232 interface.&lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections to reprogram VNC1L Flash memory]]&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_Cabling2.jpg|thumb|Fig.3: Connections for SPI communication]]&lt;br /&gt;
[[Image:UART_Connections.jpg|thumb|Fig.4: Connections for UART communication]]&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Communication through SPI protocol:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Communication through UART protocol:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Both devices exchange data through a UART protocol. They are linked to each other as shown beside on &#039;Fig.4&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in UART mode using J3 and J4 three way jumper pin headers (J3 pull up ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication with MSP430 microcontroler:&#039;&#039;&#039;&lt;br /&gt;
[[Image:MSP430_Schematic.jpg|thumb|Fig.5: Schematic of connections for MSP430 module]]&lt;br /&gt;
&lt;br /&gt;
In order to communicate with VNC1L from MSP430 microcontroler, I had to create the following module adding a 4 MHz oscillator and giving access to all I/O port pins:&lt;br /&gt;
&lt;br /&gt;
[[Image:MSP430 module1.jpg]]&lt;br /&gt;
&lt;br /&gt;
ORCAD schematic of the MSP430 module&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init (unsigned int ubrr)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI or UART protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char receive ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receive a byte from VNC1L via SPI or UART and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receive several bytes from VNC1L and write them into the ‘char’ chain given&lt;br /&gt;
 as parameter until a single carriage return (0x0D) or a null value (0x00) &lt;br /&gt;
 is received or until the ‘char’ chain is full.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receive sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int transmit (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI or UART protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_one (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_two (char My_Command1[], char My_Command2[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given with the two parameters and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[], char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the second given parameter (or created if it did not exist yet) and &lt;br /&gt;
 write the &#039;char&#039; chain given as first parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read_file (char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the given parameter and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute_one (&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can write more data into the same file without overwriting the previous ones&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read_file(&amp;quot;NEW.TXT&amp;quot;);)&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
* [http://focus.ti.com/lit/ds/slas368e/slas368e.pdf MSP430F169 Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3085</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3085"/>
		<updated>2007-08-31T08:52:10Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Documentation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host giving the possibility to connect any USB device (Flash Disc, web camera, etc) to microprocessors which have not integrated USB. The library will be programmed by connecting USB data disc and VNC1L to ATmega microprocessor with SPI and RS232 interface.&lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections to reprogram VNC1L Flash memory]]&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_Cabling2.jpg|thumb|Fig.3: Connections for SPI communication]]&lt;br /&gt;
[[Image:UART_Connections.jpg|thumb|Fig.4: Connections for UART communication]]&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Communication through SPI protocol:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Communication through UART protocol:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Both devices exchange data through a UART protocol. They are linked to each other as shown beside on &#039;Fig.4&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in UART mode using J3 and J4 three way jumper pin headers (J3 pull up ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication with MSP430 microcontroler:&#039;&#039;&#039;&lt;br /&gt;
[[Image:MSP430_Schematic.jpg|thumb|Fig.5: Schematic of connections for MSP430 module]]&lt;br /&gt;
&lt;br /&gt;
In order to communicate with VNC1L from MSP430 microcontroler, I had to create the following module adding a 4 MHz oscillator and giving access to all I/O port pins:&lt;br /&gt;
&lt;br /&gt;
[[Image:MSP430 module1.jpg]]&lt;br /&gt;
&lt;br /&gt;
ORCAD schematic of the MSP430 module&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init (unsigned int ubrr)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI or UART protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char receive ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receive a byte from VNC1L via SPI or UART and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receive several bytes from VNC1L and write them into the ‘char’ chain given&lt;br /&gt;
 as parameter until a single carriage return (0x0D) or a null value (0x00) &lt;br /&gt;
 is received or until the ‘char’ chain is full.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receive sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int transmit (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI or UART protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_one (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_two (char My_Command1[], char My_Command2[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given with the two parameters and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[], char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the second given parameter (or created if it did not exist yet) and &lt;br /&gt;
 write the &#039;char&#039; chain given as first parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read_file (char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the given parameter and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute_one (&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can write more data into the same file without overwriting the previous ones&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read_file(&amp;quot;NEW.TXT&amp;quot;);)&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
* [http://focus.ti.com/mcu/docs/mcutechdocs.tsp?sectionId=96&amp;amp;tabId=1502&amp;amp;techDoc=6&amp;amp;familyId=342&amp;amp;documentCategoryId=6 MSP430x1xx Datasheet]&lt;br /&gt;
* [http://focus.ti.com/lit/ds/slas368e/slas368e.pdf MSP430F169 Datasheet]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3084</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3084"/>
		<updated>2007-08-31T07:29:40Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Developing phase */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host giving the possibility to connect any USB device (Flash Disc, web camera, etc) to microprocessors which have not integrated USB. The library will be programmed by connecting USB data disc and VNC1L to ATmega microprocessor with SPI and RS232 interface.&lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections to reprogram VNC1L Flash memory]]&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_Cabling2.jpg|thumb|Fig.3: Connections for SPI communication]]&lt;br /&gt;
[[Image:UART_Connections.jpg|thumb|Fig.4: Connections for UART communication]]&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Communication through SPI protocol:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Communication through UART protocol:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Both devices exchange data through a UART protocol. They are linked to each other as shown beside on &#039;Fig.4&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in UART mode using J3 and J4 three way jumper pin headers (J3 pull up ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication with MSP430 microcontroler:&#039;&#039;&#039;&lt;br /&gt;
[[Image:MSP430_Schematic.jpg|thumb|Fig.5: Schematic of connections for MSP430 module]]&lt;br /&gt;
&lt;br /&gt;
In order to communicate with VNC1L from MSP430 microcontroler, I had to create the following module adding a 4 MHz oscillator and giving access to all I/O port pins:&lt;br /&gt;
&lt;br /&gt;
[[Image:MSP430 module1.jpg]]&lt;br /&gt;
&lt;br /&gt;
ORCAD schematic of the MSP430 module&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init (unsigned int ubrr)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI or UART protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char receive ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receive a byte from VNC1L via SPI or UART and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receive several bytes from VNC1L and write them into the ‘char’ chain given&lt;br /&gt;
 as parameter until a single carriage return (0x0D) or a null value (0x00) &lt;br /&gt;
 is received or until the ‘char’ chain is full.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receive sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int transmit (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI or UART protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_one (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_two (char My_Command1[], char My_Command2[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given with the two parameters and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[], char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the second given parameter (or created if it did not exist yet) and &lt;br /&gt;
 write the &#039;char&#039; chain given as first parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read_file (char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the given parameter and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute_one (&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can write more data into the same file without overwriting the previous ones&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read_file(&amp;quot;NEW.TXT&amp;quot;);)&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3083</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3083"/>
		<updated>2007-08-30T22:12:47Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host giving the possibility to connect any USB device (Flash Disc, web camera, etc) to microprocessors which have not integrated USB. The library will be programmed by connecting USB data disc and VNC1L to ATmega microprocessor with SPI and RS232 interface.&lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections to reprogram VNC1L Flash memory]]&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_Cabling2.jpg|thumb|Fig.3: Connections for SPI communication]]&lt;br /&gt;
[[Image:UART_Connections.jpg|thumb|Fig.4: Connections for UART communication]]&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Communication through SPI protocol:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Communication through UART protocol:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Both devices exchange data through a UART protocol. They are linked to each other as shown beside on &#039;Fig.4&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in UART mode using J3 and J4 three way jumper pin headers (J3 pull up ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication with MSP430 microcontroler:&#039;&#039;&#039;&lt;br /&gt;
[[Image:MSP430_Schematic.jpg|thumb|Fig.5: Schematic of connections for MSP430 module]]&lt;br /&gt;
&lt;br /&gt;
In order to communicate with VNC1L from MSP430 microcontroler, I had to create the following module adding a 4 MHz oscillator and giving access to all I/O port pins:&lt;br /&gt;
&lt;br /&gt;
[[Image:MSP430 module1.jpg]]&lt;br /&gt;
&lt;br /&gt;
ORCAD schematic of the MSP430 module&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_one (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_two (char My_Command1[], char My_Command2[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given with the two parameters and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[], char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the second given parameter (or created if it did not exist yet) and &lt;br /&gt;
 write the &#039;char&#039; chain given as first parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read_file (char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the given parameter and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute_one (&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can write more data into the same file without overwriting the previous ones&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read_file(&amp;quot;NEW.TXT&amp;quot;);)&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3082</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3082"/>
		<updated>2007-08-30T22:11:40Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Developing phase */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host giving the possibility to connect any USB device (Flash Disc, web camera, etc) to microprocessors which have not integrated USB. The library will be programmed by connecting USB data disc and VNC1L to ATmega microprocessor with SPI and RS232 interface.&lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections to reprogram VNC1L Flash memory]]&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_Cabling2.jpg|thumb|Fig.3: Connections for SPI communication]]&lt;br /&gt;
[[Image:UART_Connections.jpg|thumb|Fig.4: Connections for UART communication]]&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Communication through SPI protocol:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Communication through UART protocol:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Both devices exchange data through a UART protocol. They are linked to each other as shown beside on &#039;Fig.4&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in UART mode using J3 and J4 three way jumper pin headers (J3 pull up ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication with MSP430 microcontroler:&#039;&#039;&#039;&lt;br /&gt;
[[Image:MSP430_Schematic.jpg|thumb|Fig.5: Schematic of connections for MSP430 module]]&lt;br /&gt;
&lt;br /&gt;
In order to communicate with VNC1L from MSP430 microcontroler, I had to create the following module adding a 4 MHz oscillator and giving access to all I/O port pins:&lt;br /&gt;
&lt;br /&gt;
[[Image:MSP430 module1.jpg]]&lt;br /&gt;
&lt;br /&gt;
ORCAD schematic of the MSP430 module&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_one (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_two (char My_Command1[], char My_Command2[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given with the two parameters and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[], char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the second given parameter (or created if it did not exist yet) and &lt;br /&gt;
 write the &#039;char&#039; chain given as first parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read_file (char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the given parameter and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute_one (&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can write more data into the same file without overwriting the previous ones&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read_file(&amp;quot;NEW.TXT&amp;quot;);)&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3080</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3080"/>
		<updated>2007-08-27T13:58:22Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Developing phase */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host giving the possibility to connect any USB device (Flash Disc, web camera, etc) to microprocessors which have not integrated USB. The library will be programmed by connecting USB data disc and VNC1L to ATmega microprocessor with SPI and RS232 interface.&lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections to reprogram VNC1L Flash memory]]&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_Cabling2.jpg|thumb|Fig.3: Connections for SPI communication]]&lt;br /&gt;
[[Image:UART_Connections.jpg|thumb|Fig.4: Connections for UART communication]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Communication through SPI protocol:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Communication through UART protocol:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Both devices exchange data through a UART protocol. They are linked to each other as shown beside on &#039;Fig.4&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in UART mode using J3 and J4 three way jumper pin headers (J3 pull up ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication with MSP430 microcontroler:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:MSP430_Schematic.jpg|thumb|Fig.5: Schematic of connections for MSP430 module]]&lt;br /&gt;
In order to communicate with VNC1L from MSP430 microcontroler, I had to create the following module adding a 4 MHz oscillator and giving access to all I/O port pins:&lt;br /&gt;
&lt;br /&gt;
[[Image:MSP430 module1.jpg]]&lt;br /&gt;
&lt;br /&gt;
ORCAD schematic of the MSP430 module&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_one (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_two (char My_Command1[], char My_Command2[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given with the two parameters and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[], char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the second given parameter (or created if it did not exist yet) and &lt;br /&gt;
 write the &#039;char&#039; chain given as first parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read_file (char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the given parameter and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute_one (&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can write more data into the same file without overwriting the previous ones&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read_file(&amp;quot;NEW.TXT&amp;quot;);)&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=File:UART_Connections.jpg&amp;diff=3079</id>
		<title>File:UART Connections.jpg</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=File:UART_Connections.jpg&amp;diff=3079"/>
		<updated>2007-08-27T13:50:01Z</updated>

		<summary type="html">&lt;p&gt;Calvi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3078</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3078"/>
		<updated>2007-08-27T13:41:32Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Developing phase */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host giving the possibility to connect any USB device (Flash Disc, web camera, etc) to microprocessors which have not integrated USB. The library will be programmed by connecting USB data disc and VNC1L to ATmega microprocessor with SPI and RS232 interface.&lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections to reprogram VNC1L Flash memory]]&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Communication through SPI protocol:&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_Cabling2.jpg|thumb|Fig.3: Connections for communication through SPI protocol]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication with MSP430 microcontroler:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:MSP430_Schematic.jpg|thumb|Fig.4: Schematic of connections for MSP430 module]]&lt;br /&gt;
In order to communicate with VNC1L from MSP430 microcontroler, I had to create the following module adding a 4 MHz oscillator and giving access to all I/O port pins:&lt;br /&gt;
&lt;br /&gt;
[[Image:MSP430 module1.jpg]]&lt;br /&gt;
&lt;br /&gt;
ORCAD schematic of the MSP430 module&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_one (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_two (char My_Command1[], char My_Command2[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given with the two parameters and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[], char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the second given parameter (or created if it did not exist yet) and &lt;br /&gt;
 write the &#039;char&#039; chain given as first parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read_file (char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the given parameter and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute_one (&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can write more data into the same file without overwriting the previous ones&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read_file(&amp;quot;NEW.TXT&amp;quot;);)&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3076</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3076"/>
		<updated>2007-08-22T13:11:26Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Developing phase */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host giving the possibility to connect any USB device (Flash Disc, web camera, etc) to microprocessors which have not integrated USB. The library will be programmed by connecting USB data disc and VNC1L to ATmega microprocessor with SPI and RS232 interface.&lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections to reprogram VNC1L Flash memory]]&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Communication through SPI protocol:&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_Cabling2.jpg|thumb|Fig.3: Connections for communication through SPI protocol]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication with MSP430 microcontroler:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:MSP430_Schematic.jpg|thumb|Fig.4: Schematic of connections for MSP430 module]]&lt;br /&gt;
In order to communicate with VNC1L from MSP430 microcontroler, I had to create the following module adding a 4 MHz oscillator and giving access to all I/O port pins:&lt;br /&gt;
&lt;br /&gt;
[[Image:MSP430 module1.jpg]]&lt;br /&gt;
&lt;br /&gt;
ORCAD schematic of the MSP430 module&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_one (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_two (char My_Command1[], char My_Command2[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given with the two parameters and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[], char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the second given parameter (or created if it did not exist yet) and &lt;br /&gt;
 write the &#039;char&#039; chain given as first parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read_file (char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the given parameter and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute_one (&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can write more data into the same file without overwriting the previous ones&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read_file(&amp;quot;NEW.TXT&amp;quot;);)&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=File:MSP430_module1.jpg&amp;diff=3075</id>
		<title>File:MSP430 module1.jpg</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=File:MSP430_module1.jpg&amp;diff=3075"/>
		<updated>2007-08-22T13:06:33Z</updated>

		<summary type="html">&lt;p&gt;Calvi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=File:MSP430_module.jpg&amp;diff=3074</id>
		<title>File:MSP430 module.jpg</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=File:MSP430_module.jpg&amp;diff=3074"/>
		<updated>2007-08-22T12:54:13Z</updated>

		<summary type="html">&lt;p&gt;Calvi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=File:MSP430_Schematic.jpg&amp;diff=3073</id>
		<title>File:MSP430 Schematic.jpg</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=File:MSP430_Schematic.jpg&amp;diff=3073"/>
		<updated>2007-08-22T12:51:04Z</updated>

		<summary type="html">&lt;p&gt;Calvi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3072</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3072"/>
		<updated>2007-08-21T13:40:48Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Project definition */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host giving the possibility to connect any USB device (Flash Disc, web camera, etc) to microprocessors which have not integrated USB. The library will be programmed by connecting USB data disc and VNC1L to ATmega microprocessor with SPI and RS232 interface.&lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections to reprogram VNC1L Flash memory]]&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Communication through SPI protocol:&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_Cabling2.jpg|thumb|Fig.3: Connections for communication through SPI protocol]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_one (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_two (char My_Command1[], char My_Command2[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given with the two parameters and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[], char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the second given parameter (or created if it did not exist yet) and &lt;br /&gt;
 write the &#039;char&#039; chain given as first parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read_file (char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the given parameter and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute_one (&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can write more data into the same file without overwriting the previous ones&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read_file(&amp;quot;NEW.TXT&amp;quot;);)&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=Wireless_Sensor_Networks&amp;diff=3071</id>
		<title>Wireless Sensor Networks</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=Wireless_Sensor_Networks&amp;diff=3071"/>
		<updated>2007-08-21T13:29:28Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Library for USB module - VNC1L (ongoing) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;float: right;&amp;quot;&amp;gt;&lt;br /&gt;
[[Image:Wireless_intro.png]]&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- DO NOT DELETE, ONLY COMMENT, THX --&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #DCDDF6; width:300px; border: solid #BA0000 1px; float: right; padding: 1em; margin-top: 4em; margin-right: 2em; margin-left: 2em&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;TmoteSky modules circulation record&#039;&#039;&#039; ==&lt;br /&gt;
Who has [http://www.moteiv.com/products/tmotesky.php TmoteSky] (TelosB) module(s) and how many pieces. There are 10 pieces available for our group.&lt;br /&gt;
* Soukup Jan (Krákora Jan) - 2x &#039;&#039;&#039;VRTIT&#039;&#039;&#039;&lt;br /&gt;
* Kubias Jiří - 1x + 1x KO (+USB cable)&lt;br /&gt;
* Auersvald Martin - 3x&lt;br /&gt;
* Jurík Petr - 0x&lt;br /&gt;
* Inderjit Singh (space master) - 3x &lt;br /&gt;
----&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Meetings&#039;&#039;&#039; ==&lt;br /&gt;
* [[07.02.2007]] - 13:00 G205&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Documentaion &amp;amp; Notes&#039;&#039;&#039; ==&lt;br /&gt;
* TmoteSky is functionally equivalent to Moteiv&#039;s Telos Revision B. All Telos Revision B code will run without modifications on the TmoteSky module.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;WSN Applications&#039;&#039;&#039; ==&lt;br /&gt;
==== Automotive E-safety System (ongoing) ====&lt;br /&gt;
* responsible people:&lt;br /&gt;
** Soukup Jan, [http://dce.felk.cvut.cz/pub/staffos.php?jazyk=cz&amp;amp;href=krakorj Krákora Jan]&lt;br /&gt;
* short description:&lt;br /&gt;
** &#039;&#039;wireless vehicle to vehicle communication, which should improve the active safety on the roads. The main goal is to prevent the mass car accidents with the distributed warning system. In consequences of an obstacle detection (driver&#039;s reactions - hard breaking, fast trajectory change...) the function unit starts to transmit a warning signal which is then distributed to other nearby vehicles and forwarded by them to cars a few kilometers ahead the obstacle.&#039;&#039;&lt;br /&gt;
* date&lt;br /&gt;
** &#039;&#039;March2006 - &#039;&#039; &lt;br /&gt;
* [[Automotive_safety_system | Automotive safety system]] project link&lt;br /&gt;
&lt;br /&gt;
==== Parkinson&#039;s disease monitoring (ongoing) ====&lt;br /&gt;
* responsible people:&lt;br /&gt;
** Auersvald Martin, Kubias Jiří,[http://dce.felk.cvut.cz/pub/staffos.php?jazyk=cz&amp;amp;href=sprdlo1 Šprdlík Otakar], [http://dce.felk.cvut.cz/pub/staffos.php?jazyk=cz&amp;amp;href=jurcikp Jurík Petr], [http://dce.felk.cvut.cz/pub/staffos.php?jazyk=cz&amp;amp;href=trdlij1 Trdlika Jiří]&lt;br /&gt;
* short description:&lt;br /&gt;
** &#039;&#039;Wireless sensor motes placed on limbs (legs, arms) transmit periodically measured data to a central node for storing and evaluation. Once a day (or in predefined period) data from central node is downloaded to PC or PDA for analysis and computation of feedback in the form of brain stimulation or appropriate dose of medicine.&#039;&#039;&lt;br /&gt;
* date:&lt;br /&gt;
** &#039;&#039;Jul/2006 -&#039;&#039; &lt;br /&gt;
* [[Parkinsons_disease_monitoring_project | Parkinson&#039;s disease monitoring]] project link&lt;br /&gt;
&lt;br /&gt;
==== Building temperature control (ongoing) ====&lt;br /&gt;
* responsible people:&lt;br /&gt;
** Burget Pavel,&lt;br /&gt;
* short description:&lt;br /&gt;
** &#039;&#039;--unspecified--&#039;&#039;&lt;br /&gt;
* date&lt;br /&gt;
** &#039;&#039;--unspecified--&#039;&#039; &lt;br /&gt;
* [[Building_temperature_control | Building temperature control]] project link&lt;br /&gt;
&lt;br /&gt;
==== Rat monitoring ====&lt;br /&gt;
* responsible people:&lt;br /&gt;
** prof. Hlavá,&lt;br /&gt;
* short description:&lt;br /&gt;
** &#039;&#039;--unspecified--&#039;&#039;&lt;br /&gt;
* date&lt;br /&gt;
** &#039;&#039;--unspecified--&#039;&#039; &lt;br /&gt;
* [[Rat_monitoring | Rat monitoring]] project link&lt;br /&gt;
&lt;br /&gt;
==== Real-Time Object Tracking with Wireless Sensor Networks. (ongoing) ====&lt;br /&gt;
* responsible people:&lt;br /&gt;
** Inderjit Singh, [http://dce.felk.cvut.cz/pub/staffos.php?jazyk=cz&amp;amp;href=trdlij1 Trdlika Jiří]&lt;br /&gt;
* short description:&lt;br /&gt;
** &#039;&#039; The aim of the thesis is to design and implement a wireless sensor network for object tracking under real-time constraints, using time division media access (TDMA).&#039;&#039;&lt;br /&gt;
* date&lt;br /&gt;
** &#039;&#039;February/2007 - &#039;&#039; &lt;br /&gt;
* [[Real-Time_Object_Tracking | Real-Time Object Tracking]] project link&lt;br /&gt;
&lt;br /&gt;
==== Application for WSN data monitoring. (ongoing)  ====&lt;br /&gt;
* Responsible people:&lt;br /&gt;
** Sorin Dumitur, [http://dce.felk.cvut.cz/pub/staffos.php?jazyk=cz&amp;amp;href=trdlij1 Trdlika Jiří]&lt;br /&gt;
* Short description:&lt;br /&gt;
** &#039;&#039; The task of this project is to design and implement an application for WSN data monitoring. The application is suppose to download data from a wireless sensor network and allow to edit them and export them to different programs (like Open Office, M. Excel, Matlab, ...). The implementation will be done in &amp;quot;.NET&amp;quot; . &#039;&#039;&lt;br /&gt;
* date&lt;br /&gt;
** &#039;&#039;February/2007 - &#039;&#039; &lt;br /&gt;
* [[Application_for_WSN_data_monitoring | Application for WSN data monitoring]] project link&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;WSN sub-projects and tasks&#039;&#039;&#039; ==&lt;br /&gt;
==== Introduction to TmoteSky module (closed) ====&lt;br /&gt;
* responsible people:&lt;br /&gt;
** &#039;&#039;[[User:Nicoo| Schulz Nicolas]]&#039;&#039;&lt;br /&gt;
* short description:&lt;br /&gt;
** &#039;&#039;Introduction to TinyOS and nesC programming language. Architecture of TinyOS.&#039;&#039;&lt;br /&gt;
* date:&lt;br /&gt;
** &#039;&#039;Jul/2006 - Aug/2006&#039;&#039;&lt;br /&gt;
* [[Introduction_to_TmoteSky | Introduction to TmoteSky module]] project link&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== ZigBee radio module (ongoing)====&lt;br /&gt;
* responsible people:&lt;br /&gt;
** &#039;&#039;Kubias Jiří&#039;&#039;&lt;br /&gt;
* short description:&lt;br /&gt;
** &#039;&#039;Design and hardware implementation of own ZigBee radio module based on Freescale MC1319x radio and ATmega8 microcontroller&#039;&#039;&lt;br /&gt;
* date:&lt;br /&gt;
**&#039;&#039;Oct/2006 - April/2007&#039;&#039;&lt;br /&gt;
* [[ZigBee_module | ZigBee radio Module]] project link&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Library for USB module - VNC1L (ongoing)====&lt;br /&gt;
* responsible people:&lt;br /&gt;
** &#039;&#039;Yvan Calvignac&#039;&#039;&lt;br /&gt;
* short description:&lt;br /&gt;
** &#039;&#039; VNC1L module is USB host giving the possibility to connect any USB device to microprocessors, main target is to create universal C library in order to communicate with USB Flash Disc via SPI interface or RS232. &#039;&#039;&lt;br /&gt;
* date:&lt;br /&gt;
**&#039;&#039;Jul/2006 - Sep/2007&#039;&#039;&lt;br /&gt;
* [[USB_VNC1L_module | USB data Module]] project link&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== ZigBee radio module II (future)====&lt;br /&gt;
* responsible people:&lt;br /&gt;
** &#039;&#039;Kubias Jiří&#039;&#039;&lt;br /&gt;
* short description:&lt;br /&gt;
** &#039;&#039;Design and hardware implementation of own ZigBee radio module based on Freescale MC1319x radio and MSP430 microcontroller.&#039;&#039;&lt;br /&gt;
* date:&lt;br /&gt;
** &#039;&#039;--unspecified--&#039;&#039;&lt;br /&gt;
* [[ZigBee_module_II | ZigBee radio Module II]] project link&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Open-ZB stack porting to TmoteSky module (ongoing) ====&lt;br /&gt;
* responsible people:&lt;br /&gt;
** &#039;&#039;Auersvald Martin&#039;&#039;&lt;br /&gt;
* short description:&lt;br /&gt;
** &#039;&#039;The [http://www.open-zb.net open-ZB protocol stack] (designed for MicaZ platform) should be ported to the TmoteSky platform in this project.&#039;&#039;&lt;br /&gt;
* date:&lt;br /&gt;
** &#039;&#039;Dec/2006 - April/2007&#039;&#039;&lt;br /&gt;
* [[Open-ZB_stack_porting_to_TmoteSky | Open-ZB stack porting to TmoteSky module ]] project link&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Open-ZB stack porting to own ZigBee radio modul (reserved) ====&lt;br /&gt;
* responsible people:&lt;br /&gt;
** &#039;&#039;Auersvald Martin, Yvan Calvignac&#039;&#039;&lt;br /&gt;
* short description:&lt;br /&gt;
** &#039;&#039; The [http://www.open-zb.net open-ZB protocol stack] (designed for MicaZ platform) should be ported to own ZigBee radio platform.This project depend on [[ZigBee_module | ZigBee radio Module]] project. &#039;&#039;&lt;br /&gt;
* date:&lt;br /&gt;
** &#039;&#039;--unspecified--&#039;&#039;&lt;br /&gt;
* [[Open-ZB_stack_porting_to_own_ZigBee_module | Open-ZB stack porting to own ZigBee radio module]] project link&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== BAN data aggregation application (reserved) ====&lt;br /&gt;
* responsible people:&lt;br /&gt;
** &#039;&#039;Auersvald Martin&#039;&#039;&lt;br /&gt;
* short description:&lt;br /&gt;
** &#039;&#039; Application in nesC/TinyOS for data aggregation from motes in the Body Area Network (BAN).  &#039;&#039;&lt;br /&gt;
* date:&lt;br /&gt;
** &#039;&#039;--unspecified--&#039;&#039;&lt;br /&gt;
* [[BAN_data_aggregation_application | BAN data aggregation application]] project link&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Application deployment over radio (open) ====&lt;br /&gt;
* responsible people:&lt;br /&gt;
** &#039;&#039;--unspecified--&#039;&#039;&lt;br /&gt;
* short description:&lt;br /&gt;
** &#039;&#039; Deployment of application modules through radio interface to appropriate node(s) in network. Design of daemon monitor software.&#039;&#039;&lt;br /&gt;
* date:&lt;br /&gt;
** &#039;&#039;--unspecified--&#039;&#039;&lt;br /&gt;
* [[Application_deployment | Application deployment over radio]] project link&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Network monitoring (open)====&lt;br /&gt;
* responsible people:&lt;br /&gt;
** &#039;&#039;--unspecified--&#039;&#039;&lt;br /&gt;
* short description:&lt;br /&gt;
** &#039;&#039;User friendly software for monitoring of the large scale wireless sensor network. Possible link to [[Application_deployment | Application deployment over radio]] project. &#039;&#039;&lt;br /&gt;
* date:&lt;br /&gt;
** &#039;&#039;--unspecified--&#039;&#039;&lt;br /&gt;
* [[Network_monitoring | Network monitoring]] project link&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== ZigBee &amp;amp; Bluetooth cooperation  (open)====&lt;br /&gt;
* responsible people:&lt;br /&gt;
** &#039;&#039;--unspecified--&#039;&#039;&lt;br /&gt;
* short description:&lt;br /&gt;
** &#039;&#039;Cooperation of ZigBee and Bluetooth standards at single radio module. Hardware and software design.&#039;&#039;&lt;br /&gt;
* date:&lt;br /&gt;
** &#039;&#039;--unspecified--&#039;&#039;&lt;br /&gt;
* [[ZigBee_&amp;amp;_Bluetooth_cooperation | ZigBee &amp;amp; Bluetooth cooperation]] project link&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;Links &amp;amp; References&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.moteiv.com TmoteSky module: mote platform with 250kbps 2.4GHz IEEE 802.15.4 Chipcon Wireless Transceiver and Texas Instruments MSP430 microcontroller ]&lt;br /&gt;
&lt;br /&gt;
* [http://tinyos.net TinyOS: open-source operating system designed for wireless embedded sensor networks]&lt;br /&gt;
&lt;br /&gt;
* [http://nescc.sourceforge.net nesC: a Programming Language]&lt;br /&gt;
&lt;br /&gt;
* [http://www.zigbee.org ZigBee Alliance home page (ZigBee specification download)]&lt;br /&gt;
&lt;br /&gt;
* [http://www.open-zb.net Open-source toolset for IEEE802.15.4/ZigBee: protocol stack and simulation model]&lt;br /&gt;
&lt;br /&gt;
* [http://www.zigbeemania.com Zigbee Mania]&lt;br /&gt;
&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Sensor_network Wireless Sensor Network - Wikipedia]&lt;br /&gt;
&lt;br /&gt;
* [http://www.palowireless.com Wireless resource center]&lt;br /&gt;
&lt;br /&gt;
* [http://www.ieee802.org/15/pub/TG4.html IEEE 802.15.4 WPAN Task Group (specification download)]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3070</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3070"/>
		<updated>2007-08-21T13:24:47Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Project definition */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host giving the possibility of connecting any USB device (Flash Disc, web camera, etc) to microprocessors which have not integrated USB. The library will be programmed by connecting USB data disc and VNC1L to ATmega microprocessor with SPI and RS232 interface.&lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections to reprogram VNC1L Flash memory]]&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Communication through SPI protocol:&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_Cabling2.jpg|thumb|Fig.3: Connections for communication through SPI protocol]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_one (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_two (char My_Command1[], char My_Command2[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given with the two parameters and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[], char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the second given parameter (or created if it did not exist yet) and &lt;br /&gt;
 write the &#039;char&#039; chain given as first parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read_file (char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the given parameter and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute_one (&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can write more data into the same file without overwriting the previous ones&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read_file(&amp;quot;NEW.TXT&amp;quot;);)&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3069</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3069"/>
		<updated>2007-08-21T11:39:06Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Developing phase */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connect any USB device (Flash Disc, web camera, and etc.) to microprocesors which have not integrated USB. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections to reprogram VNC1L Flash memory]]&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Communication through SPI protocol:&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_Cabling2.jpg|thumb|Fig.3: Connections for communication through SPI protocol]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_one (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_two (char My_Command1[], char My_Command2[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given with the two parameters and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[], char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the second given parameter (or created if it did not exist yet) and &lt;br /&gt;
 write the &#039;char&#039; chain given as first parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read_file (char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the given parameter and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute_one (&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can write more data into the same file without overwriting the previous ones&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read_file(&amp;quot;NEW.TXT&amp;quot;);)&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3068</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3068"/>
		<updated>2007-08-21T11:38:29Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Developing phase */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connect any USB device (Flash Disc, web camera, and etc.) to microprocesors which have not integrated USB. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections to reprogram VNC1L Flash memory]]&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Communication through SPI protocol:&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_Cabling2.jpg|thumb|Fig.3: Connections for communication through SPI protocol]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;int execute_one (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_two (char My_Command1[], char My_Command2[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given with the two parameters and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[], char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the second given parameter (or created if it did not exist yet) and &lt;br /&gt;
 write the &#039;char&#039; chain given as first parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read_file (char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the given parameter and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute_one (&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can write more data into the same file without overwriting the previous ones&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read_file(&amp;quot;NEW.TXT&amp;quot;);)&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3067</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3067"/>
		<updated>2007-08-21T11:36:18Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Developing phase */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connect any USB device (Flash Disc, web camera, and etc.) to microprocesors which have not integrated USB. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections to reprogram VNC1L Flash memory]]&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Communication through SPI protocol:&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_Cabling2.jpg|thumb|Fig.3: Connections for communication through SPI protocol]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_one (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_two (char My_Command1[], char My_Command2[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given with the two parameters and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[], char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the second given parameter (or created if it did not exist yet) and &lt;br /&gt;
 write the &#039;char&#039; chain given as first parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read_file (char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the given parameter and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute_one (&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can write more data into the same file without overwriting the previous ones&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read_file(&amp;quot;NEW.TXT&amp;quot;);)&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3066</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3066"/>
		<updated>2007-08-13T13:36:20Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Developing phase */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connect any USB device (Flash Disc, web camera, and etc.) to microprocesors which have not integrated USB. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections reprogram VNC1L Flash memory]]&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Communication through SPI protocol:&lt;br /&gt;
&lt;br /&gt;
[[Image:SPI_Cabling2.jpg|thumb|Fig.3: Connections for communication through SPI protocol]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_one (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_two (char My_Command1[], char My_Command2[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given with the two parameters and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[], char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the second given parameter (or created if it did not exist yet) and &lt;br /&gt;
 write the &#039;char&#039; chain given as first parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read_file (char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the given parameter and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute_one (&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can write more data into the same file without overwriting the previous ones&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read_file(&amp;quot;NEW.TXT&amp;quot;);)&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=File:SPI_Cabling2.jpg&amp;diff=3065</id>
		<title>File:SPI Cabling2.jpg</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=File:SPI_Cabling2.jpg&amp;diff=3065"/>
		<updated>2007-08-13T13:32:25Z</updated>

		<summary type="html">&lt;p&gt;Calvi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3064</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3064"/>
		<updated>2007-08-08T12:39:26Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Developing phase */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connect any USB device (Flash Disc, web camera, and etc.) to microprocesors which have not integrated USB. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections reprogram VNC1L Flash memory]]&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|Fig.3: Connections for communication through SPI protocol]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
 &lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_one (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_two (char My_Command1[], char My_Command2[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given with the two parameters and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[], char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the second given parameter (or created if it did not exist yet) and &lt;br /&gt;
 write the &#039;char&#039; chain given as first parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read_file (char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the given parameter and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute_one (&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can write more data into the same file without overwriting the previous ones&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read_file(&amp;quot;NEW.TXT&amp;quot;);)&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3063</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3063"/>
		<updated>2007-08-08T12:36:55Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connect any USB device (Flash Disc, web camera, and etc.) to microprocesors which have not integrated USB. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections reprogram VNC1L Flash memory]]&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|Fig.3: Connections for communication through SPI protocol]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int monitor_mode (char Cmd[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Switch the monitor on VNC1L into shortened/extended command set and into the use of   &lt;br /&gt;
 ASCII/binary values.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_one (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_two (char My_Command1[], char My_Command2[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given with the two parameters and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[], char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the second given parameter (or created if it did not exist yet) and &lt;br /&gt;
 write the &#039;char&#039; chain given as first parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read_file (char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the given parameter and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute_one (&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can write more data into the same file without overwriting the previous ones&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;, &amp;quot;NEW.TXT&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read_file(&amp;quot;NEW.TXT&amp;quot;);)&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3062</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3062"/>
		<updated>2007-08-08T12:31:30Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Developing phase */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connect any USB device (Flash Disc, web camera, and etc.) to microprocesors which have not integrated USB. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections reprogram VNC1L Flash memory]]&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|Fig.3: Connections for communication through SPI protocol]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int monitor_mode (char Cmd[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Switch the monitor on VNC1L into shortened/extended command set and into the use of   &lt;br /&gt;
 ASCII/binary values.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_one (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_two (char My_Command1[], char My_Command2[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given with the two parameters and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[], char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the second given parameter (or created if it did not exist yet) and &lt;br /&gt;
 write the &#039;char&#039; chain given as first parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read_file (char My_File[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file named by the given parameter and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute(&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read()&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3061</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3061"/>
		<updated>2007-08-08T12:24:38Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Developing phase */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connect any USB device (Flash Disc, web camera, and etc.) to microprocesors which have not integrated USB. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections reprogram VNC1L Flash memory]]&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|Fig.3: Connections for communication through SPI protocol]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int monitor_mode (char Cmd[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Switch the monitor on VNC1L into shortened/extended command set and into the use of   &lt;br /&gt;
 ASCII/binary values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; (or created if it did not exist yet) and write the &#039;char&#039; chain given &lt;br /&gt;
 as parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute(&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read()&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3060</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3060"/>
		<updated>2007-08-08T12:23:59Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Developing phase */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connect any USB device (Flash Disc, web camera, and etc.) to microprocesors which have not integrated USB. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections for reprogramming VNC1L Flash memory]]&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|Fig.3: Connections for communication through SPI protocol]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int monitor_mode (char Cmd[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Switch the monitor on VNC1L into shortened/extended command set and into the use of   &lt;br /&gt;
 ASCII/binary values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; (or created if it did not exist yet) and write the &#039;char&#039; chain given &lt;br /&gt;
 as parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute(&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read()&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3059</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3059"/>
		<updated>2007-08-08T12:22:56Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Developing phase */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connect any USB device (Flash Disc, web camera, and etc.) to microprocesors which have not integrated USB. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections to reprogram VNC1L Flash memory]]&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|Fig.3: Connections for communication through SPI protocol]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int monitor_mode (char Cmd[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Switch the monitor on VNC1L into shortened/extended command set and into the use of   &lt;br /&gt;
 ASCII/binary values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; (or created if it did not exist yet) and write the &#039;char&#039; chain given &lt;br /&gt;
 as parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute(&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read()&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3058</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3058"/>
		<updated>2007-08-08T12:21:21Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Developing phase */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connect any USB device (Flash Disc, web camera, and etc.) to microprocesors which have not integrated USB. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections to reprogram VNC1L Flash memory]]&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|Fig.3: Connections for SPI protocol]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.3&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int monitor_mode (char Cmd[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Switch the monitor on VNC1L into shortened/extended command set and into the use of   &lt;br /&gt;
 ASCII/binary values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; (or created if it did not exist yet) and write the &#039;char&#039; chain given &lt;br /&gt;
 as parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute(&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read()&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3057</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3057"/>
		<updated>2007-08-08T12:15:02Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Developing phase */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connect any USB device (Flash Disc, web camera, and etc.) to microprocesors which have not integrated USB. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections to reprogram VNC1L Flash memory]]&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on &#039;Fig.2&#039; beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; provided with the VPROG application until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|Fig.2: Connections for SPI protocol]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.2&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int monitor_mode (char Cmd[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Switch the monitor on VNC1L into shortened/extended command set and into the use of   &lt;br /&gt;
 ASCII/binary values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; (or created if it did not exist yet) and write the &#039;char&#039; chain given &lt;br /&gt;
 as parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute(&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read()&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3056</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3056"/>
		<updated>2007-08-08T12:10:36Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Developing phase */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connect any USB device (Flash Disc, web camera, and etc.) to microprocesors which have not integrated USB. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Firmware_Connections.jpg|thumb|Fig.2: Connections to reprogram VNC1L Flash memory]]&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) drivers ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]) in order to use an FTDI 232 (USBUART) device. It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on Fig.2 beside, link the FTDI 232 device to the computer and run the VPROG application following the steps explained on the &#039;VPROG VNC1L reflasher application manual&#039; until a message box is displayed indicating that the reprogramming has completed and was successful.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|Fig.2: Connections for SPI protocol]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.2&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int monitor_mode (char Cmd[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Switch the monitor on VNC1L into shortened/extended command set and into the use of   &lt;br /&gt;
 ASCII/binary values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; (or created if it did not exist yet) and write the &#039;char&#039; chain given &lt;br /&gt;
 as parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute(&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read()&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=File:Firmware_Connections.jpg&amp;diff=3055</id>
		<title>File:Firmware Connections.jpg</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=File:Firmware_Connections.jpg&amp;diff=3055"/>
		<updated>2007-08-08T12:01:04Z</updated>

		<summary type="html">&lt;p&gt;Calvi: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3054</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3054"/>
		<updated>2007-08-08T11:57:41Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Developing phase */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connect any USB device (Flash Disc, web camera, and etc.) to microprocesors which have not integrated USB. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;Reprograming the VNC1L Flash memory with a new firmware:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
In order to communicate with the VNC1L, it is required to choose firmware and to reprogram its Flash memory. In our case, the more adapted one is ‘VDAP Firmware’ which is used to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
Actually the VDIP1 device is sold with a preloaded ‘VDAP Firmware’ but it is an old version.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, it is quite easy to reprogram the VNC1L Flash memory with new firmware via the UART&lt;br /&gt;
interface using the VNC1L-1A&#039;s internal bootloader.&lt;br /&gt;
&lt;br /&gt;
To do so, start by downloading new firmware and the VPROG application availables as free downloads from the Vinculum web site ([http://www.vinculum.com/downloads.html download new firmware and VPROG application]) and install Windows CDM (D2XX) driver in order to use an FTDI 232 (USBUART) device ([http://www.ftdichip.com/Drivers/D2XX.htm download Windows CDM (D2XX) drivers]). It is possible to use other devices with a UART, but these will require a different application which must be written by the developer.&lt;br /&gt;
Once it is done, just connect the FTDI 232 device with the VNC1L as shown on Fig.2 beside, link the FTDI 232 device to the computer and run the VPROG application.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|Fig.2: Connections for SPI protocol]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.2&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int monitor_mode (char Cmd[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Switch the monitor on VNC1L into shortened/extended command set and into the use of   &lt;br /&gt;
 ASCII/binary values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; (or created if it did not exist yet) and write the &#039;char&#039; chain given &lt;br /&gt;
 as parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute(&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read()&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3053</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3053"/>
		<updated>2007-08-07T10:35:31Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connect any USB device (Flash Disc, web camera, and etc.) to microprocesors which have not integrated USB. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
I use &#039;AVR Studio&#039; from ATMEL to program the C library ([http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725 download AVR Studio]).&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;VDAP firmware loaded on VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
VDIP1 is sold with a preloaded ‘VDAP Firmware’ which is using to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
The firmware version actually loaded on the VNC1L is ‘VDAP_02.08’ which is an old one while ‘VDAP_03.55’ is available on the Vinculum website. It is possible to load it to VNC1L but this old version seems to be operational enough so I start working like this.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|Fig.2: Connections for SPI protocol]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.2&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int monitor_mode (char Cmd[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Switch the monitor on VNC1L into shortened/extended command set and into the use of   &lt;br /&gt;
 ASCII/binary values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; (or created if it did not exist yet) and write the &#039;char&#039; chain given &lt;br /&gt;
 as parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute(&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read()&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3052</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3052"/>
		<updated>2007-08-07T10:27:48Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connect any USB device (Flash Disc, web camera, and etc.) to microprocesors which have not integrated USB. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports.&lt;br /&gt;
&lt;br /&gt;
Flash disks are connected to VNC1L through the VDIP1 module which is MCU to USB host controller development module for the VNC1L device. It is supplied on a PCB designed to fit a 24-pin DIP socket and provides access to all UART, SPI and FIFO interface pins of the VNC1L device. It is ideal for rapid prototyping and development of VNC1L designs. An attractive quantity discount structure also makes this module suitable for incorporation into low/medium volume finished product designs.&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;VDAP firmware loaded on VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
VDIP1 is sold with a preloaded ‘VDAP Firmware’ which is using to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
The firmware version actually loaded on the VNC1L is ‘VDAP_02.08’ which is an old one while ‘VDAP_03.55’ is available on the Vinculum website. It is possible to load it to VNC1L but this old version seems to be operational enough so I start working like this.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|Fig.2: Connections for SPI protocol]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.2&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int monitor_mode (char Cmd[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Switch the monitor on VNC1L into shortened/extended command set and into the use of   &lt;br /&gt;
 ASCII/binary values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; (or created if it did not exist yet) and write the &#039;char&#039; chain given &lt;br /&gt;
 as parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute(&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read()&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3051</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3051"/>
		<updated>2007-08-07T10:18:56Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Developing phase */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connect any USB device (Flash Disc, web camera, and etc.) to microprocesors which have not integrated USB. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;VDAP firmware loaded on VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|Fig.1: VDAP Firmware]]&lt;br /&gt;
VDIP1 is sold with a preloaded ‘VDAP Firmware’ which is using to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown beside on &#039;Fig.1&#039;.&lt;br /&gt;
&lt;br /&gt;
The firmware version actually loaded on the VNC1L is ‘VDAP_02.08’ which is an old one while ‘VDAP_03.55’ is available on the Vinculum website. It is possible to load it to VNC1L but this old version seems to be operational enough so I start working like this.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|Fig.2: Connections for SPI protocol]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside on &#039;Fig.2&#039;.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int monitor_mode (char Cmd[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Switch the monitor on VNC1L into shortened/extended command set and into the use of   &lt;br /&gt;
 ASCII/binary values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; (or created if it did not exist yet) and write the &#039;char&#039; chain given &lt;br /&gt;
 as parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute(&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read()&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3050</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3050"/>
		<updated>2007-08-06T13:49:50Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connect any USB device (Flash Disc, web camera, and etc.) to microprocesors which have not integrated USB. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;VDAP firmware loaded on VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|VDAP Firmware]]&lt;br /&gt;
VDIP1 is sold with a preloaded ‘VDAP Firmware’ which is using to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown in the figure beside.&lt;br /&gt;
&lt;br /&gt;
The firmware version actually loaded on the VNC1L is ‘VDAP_02.08’ which is an old one while ‘VDAP_03.55’ is available on the Vinculum website. It is possible to load it to VNC1L but this old version seems to be operational enough so I start working like this.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|SPI Cabling]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int monitor_mode (char Cmd[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Switch the monitor on VNC1L into shortened/extended command set and into the use of   &lt;br /&gt;
 ASCII/binary values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; (or created if it did not exist yet) and write the &#039;char&#039; chain given &lt;br /&gt;
 as parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute(&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can read this file&lt;br /&gt;
 &#039;&#039;&#039;read()&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file (the &#039;.&#039; = &#039;0x0A&#039; indicates a new line)&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;.HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3049</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3049"/>
		<updated>2007-08-06T13:26:40Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connect any USB device (Flash Disc, web camera, and etc.) to microprocesors which have not integrated USB. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;VDAP firmware loaded on VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|VDAP Firmware]]&lt;br /&gt;
VDIP1 is sold with a preloaded ‘VDAP Firmware’ which is using to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown in the figure beside.&lt;br /&gt;
&lt;br /&gt;
The firmware version actually loaded on the VNC1L is ‘VDAP_02.08’ which is an old one while ‘VDAP_03.55’ is available on the Vinculum website. It is possible to load it to VNC1L but this old version seems to be operational enough so I start working like this.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|SPI Cabling]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int monitor_mode (char Cmd[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Switch the monitor on VNC1L into shortened/extended command set and into the use of   &lt;br /&gt;
 ASCII/binary values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; (or created if it did not exist yet) and write the &#039;char&#039; chain given &lt;br /&gt;
 as parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and in this way we can manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute(&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can read this file right now&lt;br /&gt;
 &#039;&#039;&#039;read()&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3048</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3048"/>
		<updated>2007-08-06T13:25:39Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connect any USB device (Flash Disc, web camera, and etc.) to microprocesors which have not integrated USB. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;VDAP firmware loaded on VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|VDAP Firmware]]&lt;br /&gt;
VDIP1 is sold with a preloaded ‘VDAP Firmware’ which is using to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown in the figure beside.&lt;br /&gt;
&lt;br /&gt;
The firmware version actually loaded on the VNC1L is ‘VDAP_02.08’ which is an old one while ‘VDAP_03.55’ is available on the Vinculum website. It is possible to load it to VNC1L but this old version seems to be operational enough so I start working like this.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|SPI Cabling]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int monitor_mode (char Cmd[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Switch the monitor on VNC1L into shortened/extended command set and into the use of   &lt;br /&gt;
 ASCII/binary values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; (or created if it did not exist yet) and write the &#039;char&#039; chain given &lt;br /&gt;
 as parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Using the library, it becomes easy to communicate with VNC1L (sending commands and receiving data sent back) and so to manage data into a flash disk plugged on VDIP1 device. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
 // Initialize ATmega88&lt;br /&gt;
 &#039;&#039;&#039;init();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Configure the monitor on VNC1L in command mode&lt;br /&gt;
 &#039;&#039;&#039;command_mode();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 // Receive data sent by VNC1L waiting for a prompt reception&lt;br /&gt;
 &#039;&#039;&#039;wait_prompt();&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // Upon starting the Monitor, the following string is displayed indicating the firmware &lt;br /&gt;
     version number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
     &lt;br /&gt;
     // While a device is not detected VNC1L does not send new data&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
 &lt;br /&gt;
     // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
     &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // And no new data is sent while the device is scanned&lt;br /&gt;
     ........................&lt;br /&gt;
     ........................&lt;br /&gt;
     ......&lt;br /&gt;
     &lt;br /&gt;
     // When the scan disk is over, the following strings are displayed&lt;br /&gt;
     &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     &lt;br /&gt;
 // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
 &#039;&#039;&#039;execute(&amp;quot;DIR&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L lists files in current directory&lt;br /&gt;
     &lt;br /&gt;
     &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can also write data into a file on the flash disk&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HELLO!&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;write_file (&amp;quot;HOW ARE YOU?&amp;quot;);&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
     // VNC1L answer when it is ready for more commands&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
  &lt;br /&gt;
  &lt;br /&gt;
 // ATmega88 can read this file right now&lt;br /&gt;
 &#039;&#039;&#039;read()&#039;&#039;&#039;;&lt;br /&gt;
  &lt;br /&gt;
     // VNC1L send data contained in this file&lt;br /&gt;
     &#039;&#039;&#039;HELLO!&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;HOW ARE YOU?&#039;&#039;&#039;&lt;br /&gt;
     &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3047</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3047"/>
		<updated>2007-08-06T12:54:37Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connect any USB device (Flash Disc, web camera, and etc.) to microprocesors which have not integrated USB. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;VDAP firmware loaded on VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|VDAP Firmware]]&lt;br /&gt;
VDIP1 is sold with a preloaded ‘VDAP Firmware’ which is using to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown in the figure beside.&lt;br /&gt;
&lt;br /&gt;
The firmware version actually loaded on the VNC1L is ‘VDAP_02.08’ which is an old one while ‘VDAP_03.55’ is available on the Vinculum website. It is possible to load it to VNC1L but this old version seems to be operational enough so I start working like this.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|SPI Cabling]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int monitor_mode (char Cmd[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Switch the monitor on VNC1L into shortened/extended command set and into the use of   &lt;br /&gt;
 ASCII/binary values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; (or created if it did not exist yet) and write the &#039;char&#039; chain given &lt;br /&gt;
 as parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have already made software allowing from ATmega88 to send commands to VNC1L and to receive data sent back. In this way I can start communicating with a flash disk. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Upon starting the Monitor, the following string is displayed indicating the firmware version  &lt;br /&gt;
  number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
  &lt;br /&gt;
  &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // While a device is not detected VNC1L does not send new data&lt;br /&gt;
  ........................&lt;br /&gt;
  ........................&lt;br /&gt;
  ......&lt;br /&gt;
 &lt;br /&gt;
  // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
  &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // And no new data is sent while the device is scanned&lt;br /&gt;
  ........................&lt;br /&gt;
  ........................&lt;br /&gt;
  ......&lt;br /&gt;
 &lt;br /&gt;
  // When the scan disk is over, the following strings are displayed&lt;br /&gt;
  &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
  &#039;&#039;&#039;DIR&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // VNC1L lists files in current directory&lt;br /&gt;
  &lt;br /&gt;
  &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3046</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3046"/>
		<updated>2007-08-06T12:53:45Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connect any USB device (Flash Disc, web camera, and etc.) to microprocesors which have not integrated USB. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;VDAP firmware loaded on VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|VDAP Firmware]]&lt;br /&gt;
VDIP1 is sold with a preloaded ‘VDAP Firmware’ which is using to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown in the figure beside.&lt;br /&gt;
&lt;br /&gt;
The firmware version actually loaded on the VNC1L is ‘VDAP_02.08’ which is an old one while ‘VDAP_03.55’ is available on the Vinculum website. It is possible to load it to VNC1L but this old version seems to be operational enough so I start working like this.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|SPI Cabling]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int monitor_mode (char Cmd[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Switch the monitor on VNC1L into shortened/extended command set and into the use of   &lt;br /&gt;
 ASCII/binary values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; (or created if it did not exist yet) and write the &#039;char&#039; chain given &lt;br /&gt;
 as parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have already made software allowing from ATmega88 to send commands to VNC1L and to receive data sent back. In this way I can start communicating with a flash disk. Here follows an example of communication.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  // Upon starting the Monitor, the following string is displayed indicating the firmware version  &lt;br /&gt;
  number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
  &lt;br /&gt;
  &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // While a device is not detected VNC1L does not send new data&lt;br /&gt;
  ........................&lt;br /&gt;
  ........................&lt;br /&gt;
  ......&lt;br /&gt;
 &lt;br /&gt;
  // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
  &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // And no new data is sent while the device is scanned&lt;br /&gt;
  ........................&lt;br /&gt;
  ........................&lt;br /&gt;
  ......&lt;br /&gt;
 &lt;br /&gt;
  // When the scan disk is over, the following strings are displayed&lt;br /&gt;
  &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
  &#039;&#039;&#039;DIR&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // VNC1L lists files in current directory&lt;br /&gt;
  &lt;br /&gt;
  &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3045</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3045"/>
		<updated>2007-08-06T12:52:53Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Developing phase */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connect any USB device (Flash Disc, web camera, and etc.) to microprocesors which have not integrated USB. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;VDAP firmware loaded on VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|VDAP Firmware]]&lt;br /&gt;
VDIP1 is sold with a preloaded ‘VDAP Firmware’ which is using to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown in the figure beside.&lt;br /&gt;
&lt;br /&gt;
The firmware version actually loaded on the VNC1L is ‘VDAP_02.08’ which is an old one while ‘VDAP_03.55’ is available on the Vinculum website. It is possible to load it to VNC1L but this old version seems to be operational enough so I start working like this.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|SPI Cabling]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to VDIP1 device:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until &lt;br /&gt;
 a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain &lt;br /&gt;
 is full.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send several bytes as ‘char’ values from the address given as parameter until a null value is &lt;br /&gt;
 read but not sent.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Configure the monitor on VNC1L in command mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int monitor_mode (char Cmd[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Switch the monitor on VNC1L into shortened/extended command set and into the use of   &lt;br /&gt;
 ASCII/binary values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute (char My_Command[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int write_file (char My_Data[])&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; (or created if it did not exist yet) and write the &#039;char&#039; chain given &lt;br /&gt;
 as parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;int read ()&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 Open the file &amp;quot;NEW.TXT&amp;quot; and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have already made software allowing from ATmega88 to send commands to VNC1L and to receive data sent back. In this way I can start communicating with a flash disk. Here follows an example of communication.&lt;br /&gt;
----&lt;br /&gt;
  // Upon starting the Monitor, the following string is displayed indicating the firmware version  &lt;br /&gt;
  number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
  &lt;br /&gt;
  &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // While a device is not detected VNC1L does not send new data&lt;br /&gt;
  ........................&lt;br /&gt;
  ........................&lt;br /&gt;
  ......&lt;br /&gt;
 &lt;br /&gt;
  // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
  &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // And no new data is sent while the device is scanned&lt;br /&gt;
  ........................&lt;br /&gt;
  ........................&lt;br /&gt;
  ......&lt;br /&gt;
 &lt;br /&gt;
  // When the scan disk is over, the following strings are displayed&lt;br /&gt;
  &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
  &#039;&#039;&#039;DIR&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // VNC1L lists files in current directory&lt;br /&gt;
  &lt;br /&gt;
  &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3044</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3044"/>
		<updated>2007-08-06T12:45:33Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Developing phase */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocessors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connect any USB device (Flash Disc, web camera, and etc.) to microprocesors which have not integrated USB. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
== Vinculum VNC1L USB host controller (VDIP1 - DIP format of the VNC1L) ==&lt;br /&gt;
The device transparently handles the FAT file structure communicating via UART, SPI or parallel FIFO interfaces via a simple to implement command set (Monitor port). The VNC1L device features two USB Ports which can be individually configured by firmware as Host or Slave ports. The device has two USB host ports as well as a combined UART, SPI or FIFO interface. Command &#039;&#039;Monitor&#039;&#039; port can be activated on either the combined interface or one of the USB ports. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;VDAP firmware loaded on VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|VDAP Firmware]]&lt;br /&gt;
VDIP1 is sold with a preloaded ‘VDAP Firmware’ which is using to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown in the figure beside.&lt;br /&gt;
&lt;br /&gt;
The firmware version actually loaded on the VNC1L is ‘VDAP_02.08’ which is an old one while ‘VDAP_03.55’ is available on the Vinculum website. It is possible to load it to VNC1L but this old version seems to be operational enough so I start working like this.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|SPI Cabling]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The library:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have created several functions allowing from ATmega88 to manage data into a flash disk plugged to the VDIP1 device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;int init ()&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Initialize the ATmega88 to communicate through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;char SPI_recept ()&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Receipt a byte from VNC1L and return it as a ‘char’ value.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;int recept_sentence (char Sentence[], int Length)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Receipt several bytes from VNC1L and write them into the ‘char’ chain given as parameter until a single carriage return (0x0D) or a null value (0x00) is received or until the ‘char’ chain is full.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;int check_prompt (char Sntce1[])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Check if the last sentence received was a prompt (D:\&amp;gt;) and return 0 if it was.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;int wait_prompt ()&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Receipt sentences from VNC1L until a prompt reception.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;unsigned int SPI_trans (char cData)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Send a byte as a ‘char’ value to VNC1L through SPI protocol.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;int trans_command (char * pCommand)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Send several bytes as ‘char’ values from the address given as parameter until a null value is read but not sent and add a single carriage return in the end.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;int trans_data (char * pData)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Send several bytes as ‘char’ values from the address given as parameter until a null value is read but not sent.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;int command_mode ()&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Configure the monitor on VNC1L in command mode.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;int monitor_mode (char Cmd[])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Switch the monitor on VNC1L into shortened/extended command set and into the use of   ASCII/binary values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;int convert_dword (unsigned long Number, char dWord [])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Convert a ‘long’ value given as parameter into a ‘char’ chain and write it to the given address.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;int execute (char My_Command[])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Send the command given as parameter and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;int execute_dword (char My_Command[], char My_dWord[])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Send the command given as first parameter followed by the value given into the second one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;int write_sentence (char Sentence[])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Write the given &#039;char&#039; chain into the current opened file and wait for VNC1L to send a prompt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;int write_file (char My_Data[])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open the file &amp;quot;NEW.TXT&amp;quot; (or created if it did not exist yet) and write the &#039;char&#039; chain given as parameter at its end before to close it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;int read ()&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Open the file &amp;quot;NEW.TXT&amp;quot; and read it before to close it.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have already made software allowing from ATmega88 to send commands to VNC1L and to receive data sent back. In this way I can start communicating with a flash disk. Here follows an example of communication.&lt;br /&gt;
----&lt;br /&gt;
  // Upon starting the Monitor, the following string is displayed indicating the firmware version  &lt;br /&gt;
  number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
  &lt;br /&gt;
  &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // While a device is not detected VNC1L does not send new data&lt;br /&gt;
  ........................&lt;br /&gt;
  ........................&lt;br /&gt;
  ......&lt;br /&gt;
 &lt;br /&gt;
  // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
  &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // And no new data is sent while the device is scanned&lt;br /&gt;
  ........................&lt;br /&gt;
  ........................&lt;br /&gt;
  ......&lt;br /&gt;
 &lt;br /&gt;
  // When the scan disk is over, the following strings are displayed&lt;br /&gt;
  &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
  &#039;&#039;&#039;DIR&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // VNC1L lists files in current directory&lt;br /&gt;
  &lt;br /&gt;
  &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3036</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3036"/>
		<updated>2007-07-27T12:42:11Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocesors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connet any USB device (Flash Disc, web camera, and etc.) to microprocesors. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;VDAP firmware loaded on VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|VDAP Firmware]]&lt;br /&gt;
VDIP1 is sold with a ‘VDAP Firmware’ preloaded which typical application is using the Vinculum VNC1L to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown on the figure beside.&lt;br /&gt;
&lt;br /&gt;
The firmware version actually loaded on the VNC1L is ‘VDAP_02.08’ which is an old one while ‘VDAP_03.55’ is available on the Vinculum website. It is possible to load it to VNC1L but this old version seems to be operational enough so I start working like this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|SPI Cabling]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have already made software allowing from ATmega88 to send commands to VNC1L and to receive data sent back. In this way I can start communicating with a flash disk. Here follows an example of communication.&lt;br /&gt;
----&lt;br /&gt;
  // Upon starting the Monitor, the following string is displayed indicating the firmware version  &lt;br /&gt;
  number (02.08) and the firmware type (VDAP) loaded on VNC1L&lt;br /&gt;
  &lt;br /&gt;
  &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // While a device is not detected VNC1L does not send new data&lt;br /&gt;
  ........................&lt;br /&gt;
  ........................&lt;br /&gt;
  ......&lt;br /&gt;
 &lt;br /&gt;
  // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
  &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // And no new data is sent while the device is scanned&lt;br /&gt;
  ........................&lt;br /&gt;
  ........................&lt;br /&gt;
  ......&lt;br /&gt;
 &lt;br /&gt;
  // When the scan disk is over, the following strings are displayed&lt;br /&gt;
  &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
  &#039;&#039;&#039;DIR&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // VNC1L lists files in current directory&lt;br /&gt;
  &lt;br /&gt;
  &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3035</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3035"/>
		<updated>2007-07-27T12:39:56Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Developing phase */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocesors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connet any USB device (Flash Disc, web camera, and etc.) to microprocesors. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;VDAP firmware loaded on VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|VDAP Firmware]]&lt;br /&gt;
VDIP1 is sold with a ‘VDAP Firmware’ preloaded which typical application is using the Vinculum VNC1L to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown on the figure beside.&lt;br /&gt;
&lt;br /&gt;
The firmware version actually loaded on the VNC1L is ‘VDAP_02.08’ which is an old one while ‘VDAP_03.55’ is available on the Vinculum website. It is possible to load it to VNC1L but this old version seems to be operational enough so I start working like this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|SPI Cabling]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pull down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have already made software allowing from ATmega88 to send commands to VNC1L and to receive data sent back. In this way I can start communicating with a flash disk. Here follows an example of communication.&lt;br /&gt;
----&lt;br /&gt;
  // Upon starting the Monitor, the following string is displayed indicating the firmware version  &lt;br /&gt;
  number (02.08) and the firmware type (VDAP)&lt;br /&gt;
  &lt;br /&gt;
  &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // While a device is not detected VNC1L does not send new data&lt;br /&gt;
  ........................&lt;br /&gt;
  ........................&lt;br /&gt;
  ......&lt;br /&gt;
 &lt;br /&gt;
  // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
  &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // And no new data is sent while the device is scanned&lt;br /&gt;
  ........................&lt;br /&gt;
  ........................&lt;br /&gt;
  ......&lt;br /&gt;
 &lt;br /&gt;
  // When the scan disk is over, the following strings are displayed&lt;br /&gt;
  &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
  &#039;&#039;&#039;DIR&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // VNC1L lists files in current directory&lt;br /&gt;
  &lt;br /&gt;
  &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3034</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3034"/>
		<updated>2007-07-27T12:39:22Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Developing phase */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocesors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connet any USB device (Flash Disc, web camera, and etc.) to microprocesors. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;VDAP firmware loaded on VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|VDAP Firmware]]&lt;br /&gt;
VDIP1 is sold with a ‘VDAP Firmware’ preloaded which typical application is using the Vinculum VNC1L to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown on the figure beside.&lt;br /&gt;
&lt;br /&gt;
The firmware version actually loaded on the VNC1L is ‘VDAP_02.08’ which is an old one while ‘VDAP_03.55’ is available on the Vinculum website. It is possible to load it to VNC1L but this old version seems to be operational enough so I start working like this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|SPI Cabling]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown beside.&lt;br /&gt;
&lt;br /&gt;
I/O on data and control bus pins of the VDIP1 are configured in SPI mode using J3 and J4 three way jumper pin headers (J3 pulled down ACBUS5 and J4 pull up ACBUS6).&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have already made software allowing from ATmega88 to send commands to VNC1L and to receive data sent back. In this way I can start communicating with a flash disk. Here follows an example of communication.&lt;br /&gt;
----&lt;br /&gt;
  // Upon starting the Monitor, the following string is displayed indicating the firmware version  &lt;br /&gt;
  number (02.08) and the firmware type (VDAP)&lt;br /&gt;
  &lt;br /&gt;
  &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // While a device is not detected VNC1L does not send new data&lt;br /&gt;
  ........................&lt;br /&gt;
  ........................&lt;br /&gt;
  ......&lt;br /&gt;
 &lt;br /&gt;
  // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
  &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // And no new data is sent while the device is scanned&lt;br /&gt;
  ........................&lt;br /&gt;
  ........................&lt;br /&gt;
  ......&lt;br /&gt;
 &lt;br /&gt;
  // When the scan disk is over, the following strings are displayed&lt;br /&gt;
  &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
  &#039;&#039;&#039;DIR&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // VNC1L lists files in current directory&lt;br /&gt;
  &lt;br /&gt;
  &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3033</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3033"/>
		<updated>2007-07-27T12:36:57Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocesors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connet any USB device (Flash Disc, web camera, and etc.) to microprocesors. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;VDAP firmware loaded on VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|VDAP Firmware]]&lt;br /&gt;
VDIP1 is sold with a ‘VDAP Firmware’ preloaded which typical application is using the Vinculum VNC1L to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown on the figure beside.&lt;br /&gt;
&lt;br /&gt;
The firmware version actually loaded on the VNC1L is ‘VDAP_02.08’ which is an old one while ‘VDAP_03.55’ is available on the Vinculum website. It is possible to load it to VNC1L but this old version seems to be operational enough so I start working like this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|SPI Cabling]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown on the figure beside.&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have already made software allowing from ATmega88 to send commands to VNC1L and to receive data sent back. In this way I can start communicating with a flash disk. Here follows an example of communication.&lt;br /&gt;
----&lt;br /&gt;
  // Upon starting the Monitor, the following string is displayed indicating the firmware version  &lt;br /&gt;
  number (02.08) and the firmware type (VDAP)&lt;br /&gt;
  &lt;br /&gt;
  &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // While a device is not detected VNC1L does not send new data&lt;br /&gt;
  ........................&lt;br /&gt;
  ........................&lt;br /&gt;
  ......&lt;br /&gt;
 &lt;br /&gt;
  // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
  &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // And no new data is sent while the device is scanned&lt;br /&gt;
  ........................&lt;br /&gt;
  ........................&lt;br /&gt;
  ......&lt;br /&gt;
 &lt;br /&gt;
  // When the scan disk is over, the following strings are displayed&lt;br /&gt;
  &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
  &#039;&#039;&#039;DIR&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // VNC1L lists files in current directory&lt;br /&gt;
  &lt;br /&gt;
  &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready to receive an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
	<entry>
		<id>https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3032</id>
		<title>USB VNC1L module</title>
		<link rel="alternate" type="text/html" href="https://rtime.felk.cvut.cz/hw/index.php?title=USB_VNC1L_module&amp;diff=3032"/>
		<updated>2007-07-27T12:26:00Z</updated>

		<summary type="html">&lt;p&gt;Calvi: /* Developing phase */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Project definition ==&lt;br /&gt;
Main task is to create universal C library for microprocesors (ATmega, MSP340, ARM7) which will communicate with VNC1L module. VNC1L module is USB host and its giving possibility to connet any USB device (Flash Disc, web camera, and etc.) to microprocesors. Current task is to connect USB data disc and VNC1L to ATmega microprocesor with SPI and RS232 interface.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Developing phase ==&lt;br /&gt;
&#039;&#039;&#039;VDAP firmware loaded on VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:VDAP.jpg|thumb|VDAP Firmware]]&lt;br /&gt;
VDIP1 is sold with a ‘VDAP Firmware’ preloaded which typical application is using the Vinculum VNC1L to provide USB Host functionality to a microcontroller. This will have the monitor port on the combined interface allowing BOMS devices (Bulk Only Mass Storage, e.g. Flash Disk) to be connected to Port 2 and USB Slave Peripherals to Port 1 as shown on the figure beside.&lt;br /&gt;
&lt;br /&gt;
The firmware version actually loaded on the VNC1L is ‘VDAP_02.08’ which is an old one while ‘VDAP_03.55’ is available on the Vinculum website. It is possible to load it to VNC1L but this old version seems to be operational enough so I start working like this.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Communication between ATmega88 and VNC1L:&#039;&#039;&#039;&lt;br /&gt;
[[Image:SPI_Cabling.jpg|thumb|SPI Cabling]]&lt;br /&gt;
Both devices exchange data through a SPI protocol. They are linked to each other as shown on the figure beside.&lt;br /&gt;
&lt;br /&gt;
The software is loaded on ATmega88 through its /RESET pin using an AVR Dragon interface which also provides the power supply unit (5V0 / GND).&lt;br /&gt;
&lt;br /&gt;
PORTB0 and PORTB1 on ATmega88 are used to command DATAREQ# and DATAACK# on VNC1L in order to switch it between command mode and data mode.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&#039;&#039;&#039;The software:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
I have already made software allowing from ATmega88 to send commands to VNC1L and to receive the data sent back. In this way I can start communicating with a flash disk. Here follows an example of communication.&lt;br /&gt;
----&lt;br /&gt;
  // Upon starting the Monitor, the following string is displayed indicating the firmware version  &lt;br /&gt;
  number (02.08) and the firmware type (VDAP)&lt;br /&gt;
  &lt;br /&gt;
  &#039;&#039;&#039;Ver 02.08VDAPF On-Line:&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // While a device is not detected VNC1L does not send new data&lt;br /&gt;
  ........................&lt;br /&gt;
  ........................&lt;br /&gt;
  ......&lt;br /&gt;
 &lt;br /&gt;
  // As soon as a device is plugged on USB Port 2, the following string is displayed&lt;br /&gt;
  &#039;&#039;&#039;Device Detected P2&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // And no new data is sent while the device is scanned&lt;br /&gt;
  ........................&lt;br /&gt;
  ........................&lt;br /&gt;
  ......&lt;br /&gt;
 &lt;br /&gt;
  // When the scan disk is over, the following strings are displayed&lt;br /&gt;
  &#039;&#039;&#039;No Upgrade&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // ATmega88 is now able to send a command like ‘DIR’ for example&lt;br /&gt;
  &#039;&#039;&#039;DIR&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
  // VNC1L lists files in current directory&lt;br /&gt;
  &lt;br /&gt;
  &#039;&#039;&#039;SUBDIR1 DIR&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;SUBDIR2 DIR&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;FILE1.XXX&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;FILE2.XXX&#039;&#039;&#039;&lt;br /&gt;
  &#039;&#039;&#039;D:\&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
----&lt;br /&gt;
Notes :&lt;br /&gt;
&lt;br /&gt;
The ‘’ character represent a single carriage return.&lt;br /&gt;
&lt;br /&gt;
When ATmega88 reads data sent by VNC1L waiting for it to be ready for an other command while it is not sending new data, the software returns null characters &#039;0x00&#039; (......).&lt;br /&gt;
&lt;br /&gt;
A prompt (D:\&amp;gt;) is sent when VNC1L is ready for a new command.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
* [http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf ATmega88_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VNC1L-1A.pdf VNC1L_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf VDIP1_Datasheet]&lt;br /&gt;
* [http://www.vinculum.com/documents/schematics/VDIP1%20Schematic%20Prints.pdf VDIP1_Schematic]&lt;br /&gt;
* [http://www.vinculum.com/documents/fwspecs/Vinculum%20Firmware%20User%20Manual%20V2.0%20Rev%202.pdf VNC1L_FirmwareUserManual]&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
* [http://www.atmel.com/dyn/products/product_card.asp?family_id=607&amp;amp;family_name=AVR+8%2DBit+RISC+&amp;amp;part_id=3302 Atmel_ATmega88_MainPage]&lt;br /&gt;
* [http://www.vinculum.com/prd_vnc1l.html Vinculum_VNC1L_MainPage]&lt;/div&gt;</summary>
		<author><name>Calvi</name></author>
	</entry>
</feed>