VNC1L - Need Help

Has anyone gotten one of these to work?? I’m trying to communicate with a USB flash drive though this IC, via UART on an MSP430F1611. However I have not been able to get any responce when I run the following code. The CTS# pin(referenced from the uP) never goes high. Thus character are never received or transmitted.

Thanks in advance.

-Jon

;----------------------------------------------------------------------------

; Initialization Sequence

#include <msp430x14x.h>

ORG 01100h

RESET mov.w #0A00h,SP ; Initialize stackpointer

StopWDT mov.w #WDTPW+WDTHOLD,&WDTCTL ; Stop WDT

bis.b #001h, &P1DIR ; Use P1.0 as output

bic.b #001h, &P1OUT

bis.b #030h, &P3SEL ; Use P3.4,5 for UART0

bis.b #050h, &P3DIR ; Use P3.4,6 as output

bis.b #040h, &P5DIR ; Use P5.6 for DREQ

bis.b #040h, &P5OUT ;

mov.b #004h, &BCSCTL1 ; Setup Clocks

mov.b #088h, &BCSCTL2 ;

mov.b #002h, &IFG1 ;

SetOsc0 bic.b #OFIFG, &IFG1 ; Test Oscilator

mov.w #0FFh, R15 ;

SetOsc1 dec.w R15 ;

jnz SetOsc1 ;

bit.b #OFIFG, &IFG1 ;

jnz SetOsc0 ;

mov.b #021h, &U0TCTL ; Setup U0TCTL

mov.b #008h, &U0RCTL ; Setup U0RCTL

mov.b #baudDiv0, U0BR0 ; Setup Baud Rate Clock

mov.b #baudDiv1, U0BR1 ;

mov.b #baudMod, U0MCTL ;

bis.b #0C0h, &ME1 ; Enable UART Transmitters

mov.b #010h, &U0CTL ; UART0 Released

mov.b #000h, &P1IES ; Port 1: Low=>High Transition Cause Interupts

bic.b #0FFh, &P1IFG ; Clear any existing Port 1 Interupt Flags

mov.b #002h, &P1IE ; Allow P1.1 to Cause Interupts

bis.b #GIE, R2 ; Enable global interupts

;----------------------------------------------------------------------------

; Super_Loop

mov.w &fromUSB, R5 ; R5 is a pointer to a table where data is received from the UART

Super_Loop mov.w &toUSB, R4 ; R4 is pointer to data being sent to UART

call #UART0_TX ; transmit character subroutine

jmp Super_Loop ; Do nothing

;----------------------------------------------------------------------------

; UART0 TX Subroutine

UART0_TX bic.b #002h,&P1IE ; Disable Interupts Caused by P1.1

bis.b #rts, &P1OUT ; Set P1.1 (RTS# on uP, #CTS on USB Host)

poll_CTS_TX bit.b #cts, &P1IN ; Wait for CTS#(uP) to set

jz poll_CTS_TX

poll_TX bit.b #TXEPT, &U0TCTL ; Wait until U0 TX Buffer is Empty

jz poll_TX

mov.b @R4,U0TXBUF ; Transmit Selected Character

bic.b #rts, &P1OUT ; Reset P1.1 (RTS# on uP, #CTS on USB Host)

bis.b #002, &P1OUT ; Enable Interupts Caused by P1.1

ret ; return from subroutine

;--------------------------------------------------------------------------

; P1.1 Interupt Handler (for UART RX, activated on rising edge of #CTS

P1_ISR bit.b #cts, &P1IFG ; test P1_ISR Trigger

jz end_ISR ;

bis.b #rts,&P1OUT ; Set P1.1 (RTS# on uP, CTS# on Host)

poll_RX bit.b #040h, &IFG1 ; Poll UART RX Flag until 1

jz poll_RX

mov.b &U0RXBUF, 0(R5) ; Move RXed Char to Address pointed to by R5, post inc.

inc.b R5

end_ISR mov.b #000h, &P1IFG ; Reset All P1 Interupt Flags

bic.b #rts,&P1OUT ; Reset P1.1 (RTS# on uP, CTS# on Host)

reti ; return from interupt

;---------------------------------------------------------------------------

; Memory

toUSB DW testDataTx ; pointer to table where data is transmitted

fromUSB DW testDataRx ; pointer to table where data is received

testDataTx DW 00Dh ; Data to be transmitted to USB

testDataRx DW 0, 0, 0, 0, 0, 0, 0, 0 ; Data received from USB Host

DW 0, 0, 0, 0, 0, 0, 0, 0

;---------------------------------------------------------------------------

;Interupt Vectors

ORG 0FFFEh

DW RESET

ORG 0FFE8h

DW P1_ISR

;--------------------------------------------------------------------------

;EQUATES

baudDiv0 EQU 041h

baudDiv1 EQU 003h

baudMod EQU 000h

rts EQU 001h

cts EQU 002h

end

Not sure if you’ve solved this issue yet or not, but having just gotten it successfully running today, here’s the things I’d recommend looking at:

Use the schematic values from the VDIP1 schematic. The VNC1L reference schematic in the datasheet is wrong on the PLL filter (47k->180) and the ACBUS7 pulldown (47k->10k). Also, try shorting the VNC1L’s RTS and CTS lines together.

Honestly, this part is VERY poorly supported right now. I have been in contact with FTDI’s ‘support’ for the last two weeks trying to get this sort of stuff resolved, and we’ve ended up locating the problems before they could come up with anything useful.

Also, keep in mind that you have to bootload in the firmware through their bootloader first. Good luck getting their block read command working reliably.

To anybody else wanting to use this part, I’d wait until they come out with release-level (higher than v0.92/v0.96) datasheets.

Anyone get this thing working in host mode yet? does it come with host mode firmware installed?

The VNC1L chip itself comes with no firmware. Why FTDI/Vinculum is offering their entire line with no firmware is a bit puzzling, but hey, whatever.

As far as the host mode question, the only firmware from them that I’ve seen is made to work with HID-compliant devices (flash/thumb drives, keyboards, mice, etc) and some of the FTDI USB chips.

I imagine at some point, once they get their documentation past the point of being miserably poor, there will be enough information that you could write your own firmware package.

When I looked through the VNC1L documentation, I got the impression that they have no intentions of providing the tools necessary to create custom firmware. Perhaps I missed something. If they do, their chip becomes much more interesting.

I’m working with this chip mounted on the VDIP1 board, do you think that the mounted VNC1L chip doesn’t have any firmware on it either? I am having many problems. If I had known documentation was so bad for these I would not have chosen this technology!

Mikeschlag, would it be possible to take a look at your code for initializing and setting up the connection with the USB?

I answered my own question. There is indeed VDAP firmware already on the mounted chip, but if I could see code from other people who have used this already, that would be great.

I am finding that no matter what command I enter in, I get 0x0D back and nothing else. Also, it doesn’t seem to be powering my flash drive (the light isn’t on) any suggestions?

I found that the VDAP firmware can be a little particular about some drives. The firmware that I was working with was v2.19, and I just saw today that there was a v3.50 posted at some point in the last 3 weeks to the Vinculum site.

One of the things I would recommend doing if possible with the VDIP is to breadboard it up and use an RS232<->TTL converter to be able to connect into Hyperterminal (or something similar). You can at least figure out how it will respond to the ASCII commands, and then move onto the short command set if need be (the implementation I did was completely with the extended command set, as the SCS in v2.19 was flaky for me).

Breadboarding with an appropriate supply will also help answer if you have a supply issue - some USB devices can draw a decent amount of power (spec allows up to 500mA draw per hub I believe, and I’ve seen some draw upwards of 25mA for a simple flash drive).

After you get it working that way, it will be much easier to diagnose where the problem is in any sort of embedded situation.

hi, all

I’ve got the VDIP1 module now for testing, playing with it 3 days so far :slight_smile:

OK, some impressions:

The documentation for chip is quite basic. Functionality is not deeply explained. For example what is STATUS register ? no idea… A lot of things depend on firmware funcionality and its version, rather than on chip features and there is no way to do your own firmware (at this time at least).

I tried to use SPI mode first. Very basic operation first - read status register. It returns the same byte all the time no matter what is the state of module. Moreover this byte value sometimes changes and I could not find reasonable explanation. And 4 bits of STATUS register never described in any docs. So I abandoned SPI. Anybody has a better luck ?

Second mode to try was FIFO. I also had some hardware problems (my fault), but finally I get it working. This is the fastest way to communicate and easiest to implement, but you need 12 pins from MCU.

So I get all responses from module, I can see ‘drive connected/removed’ messages etc, already had tried basic file operations: dir, open file, read file, create file, write file. Looks like it really works now :).

But there a few confusing things:

The most strange and painful problem that VDAP firmware has two modes for commands (basic/extended) and two modes for number representation (binary/ascii). While after power-on you have extended command set by default, guess what is the default mode for numbers ? yes, it is binary, not ASCII. Very confusing even they have this is documentaton.

The problem looks like this: I hooked up all hardware, I’ve got my MCU talking to VDIP1 as pass-through unit. So everything from PC terminal software goes to MCU, then to VDIP1 and back. Appears like a modem for user, so you can type simple text commands and get replies. For example DIR gives a file list, IDD gives all the info about flash drive connected etc. Now when you try “dir myfile.dat” it suppose to give you file size, but reply you get is “myfile.dat $%%@” or something like this garbage after file name. Why ? because it is actually a binary number send to terminal as raw data. Not a good choice for default mode I think.

Even if you switch to ASCII mode you can not read a plain numbers, instead you get a ASCII HEX pairs of bytes. Why this strange way to display the size information ??? if it is supposed to be used as binary number by MCU, let it all be binary, but for human-readable option it suppose to be normal numbers, isn’t it ?

Example: your file is 513 bytes long. For me the logical way is to see “myfile.dat 513” so it is human readable. Instead,

in binary mode you get "myfile.dat " 0x02 0x01 0x0d.

If you use ASCII mode, you get the “myfile.dat $02 $01”

Not quite logical for me, but still can be used once you get used to it :slight_smile:

Anyway, the idea of this chip is good and have some application areas, but I wish I can have a better documentation and better firmware.

hello all, i want to learn how to use the VNC1L from the topic most basic, i what learn who send commands whit a microcontroller.

I have to do a project. it consist in read a .txt file that contain sentences from a usb memory and desplay it in a lcd display, how i con do it?.

Any help is always welcome.