Shop OBEX P1 Docs P2 Docs Learn Events
UART setup for communication with FTDI Vinclulum chip — Parallax Forums

UART setup for communication with FTDI Vinclulum chip

azaccagninoazaccagnino Posts: 11
edited 2007-05-08 21:08 in General Discussion
I am trying to setup communication with a device that has the following specs:
·The standard data format is 8 data bits, 1 start bit, 1 stop bit, and no parity with RTS/CTS hardware handshaking enabled.
·
·This is my UART setup:
·
txUart· = new Uart (· Uart.dirTransmit,· ·· // Transimt Uart
························· TX,················ ··········· // Transmit Pin
························· Uart.dontInvert,··· ······ / Dont invert transmit pin
························· RTS,··············· ·········· // Handshake Pin
························· Uart.dontInvert,··· ······ // Don't invert handshake pin
························· Uart.speed9600,···· ···· // Serial Speed· 9600
························· Uart.stop1 );······ ········ // 1 stop bit.
··· rxUart· = new Uart (· Uart.dirTransmit,·· // Receive Uart
························· RX,················ // Receive Pin
························· Uart.dontInvert,··· // Dont invert receive pin
························· CTS,··············· // Handshake Pin
························· Uart.dontInvert,··· // Don't invert handshake pin
························· Uart.speed9600,···· // Serial Speed· 9600
························· Uart.stop1 );······ // 1 stop bit.
·
I don’t seem to be communicating with the device (FTDI Vinculum chip) is my UART setup O.K.?
·
Thank you,
·
Andrea Zaccagnino
Nettuno A.S.G. inc.

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-04-30 18:49
    I would keep the naming consistent with DTE devices.
    In that case TX (output) is paired with CTS (input), RX (input)·is paired with RTS (output).
    Be sure to define pins as CPU.pinXX where XX is 0 to 15.

    static final int pinTX = CPU.pin0; //transmit output, connect to device RX pin
    static final int pinRX = CPU.pin1; //receive input, connect to device TX pin
    static final int pinRTS = CPU.pin2; //handshake output, connect to device handshake input pin
    static final int pinCTS = CPU.pin3; //handshake input, connect to device handshake output pin

    static Uart tx = new Uart(Uart.dirTransmit,pinTX,Uart.dontInvert,pinCTS,Uart.dontInvert,Uart.speed9600,Uart.stop1);
    static Uart rx = new Uart(Uart.dirReceive,pinRX,Uart.dontInvert,pinRTS,Uart.dontInvert,Uart.speed9600,Uart.stop1);

    If the above does not work, try using Uart.invert


    regards peter
  • azaccagninoazaccagnino Posts: 11
    edited 2007-05-07 21:34
    I have done what you suggested and I did get some response. This is how I have my UART setup.

    static final int pinTX· = CPU.pin4; //transmit output, connect to device RX pin
    static final int pinRX· = CPU.pin5; //receive input, connect to device TX pin
    static final int pinRTS = CPU.pin2; //handshake output, connect to device handshake input pin
    static final int pinCTS = CPU.pin3; //handshake input, connect to device handshake output pin

    static Uart tx = new Uart(Uart.dirTransmit,
    ························· pinTX,
    ························· Uart.invert,
    ························· pinCTS,
    ························· Uart.invert,
    ························· Uart.speed9600,
    ························· Uart.stop1);
    static Uart rx = new Uart(Uart.dirReceive,
    ························· pinRX,
    ························· Uart.invert,
    ························· pinRTS,
    ························· Uart.invert,
    ························· Uart.speed9600,
    ························· Uart.stop1);

    I also have an oscilloscope conneted to pinTX. When I send the following command: tx.sendString("Rx07") nothing happens. The pinTX does not send a signal (the oscilloscope is flat) . If on the other hand I associate the pinCTS with the rx Uart and the pinRTS with the tx Uart I have a signal ont the pinTX. What could cause this?

    Thank you for your help.

    ·
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-05-07 23:06
    Could be a number of reasons.
    Give us a link to the datasheet of the·exact ftdi chip you are using.
    Tell us which javelin pin you connect to which FTDI pin
    and which pins of the FTDI you set·high or low to enter·uart mode.
    Schematic diagram if possible.

    regards peter
  • azaccagninoazaccagnino Posts: 11
    edited 2007-05-08 11:48
    Hello Peter,

    Thank you for your help.
    Here are the links of the FTDI chip, of the Firmware and of the schematics:
    http://www.vinculum.com/documents/datasheets/DS_VDIP1.pdf
    http://www.vinculum.com/documents/fwspecs/DS_VNC1L_FW_VDAP.pdf
    http://www.vinculum.com/documents/schematics/VDIP1 Schematic Prints.pdf

    I have connected the following pins:

    static final int pinTX = CPU.pin4; //transmit output, connect to AD1

    static final int pinRX = CPU.pin5; //receive input, connect to AD0
    static final int pinRTS = CPU.pin2; //handshake output, connect to device AD3
    static final int pinCTS = CPU.pin3; //handshake input, connect to device AD2

    AC5 and AC6 are both held high to enter UART mode.

    Hopefully this is enough for your help.
    Thanks

    Andrea Zaccagnino
  • azaccagninoazaccagnino Posts: 11
    edited 2007-05-08 12:21
    I think I have an Idea of where my prolem is..

    If I understand Uart serial comm correctly the microcontroller waits for RTS to go high before sending the transmit data on TX. It looks like RTX never goes high therefore my javelin stamp does not transmit. Is this analysis correct? What could I do to solve this?



    Thank you,



    Andrea Zaccagnino
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-05-08 12:57
    You have

    javelin TX to ftdi AD1 (RXD)·· correct
    javelin RX to ftdi AD0 (TXD)·· correct
    javelin RTS to ftdi AD3 (CTS)· correct
    javelin CTS to ftdi AD2 (RTS)· correct

    Don't forget you need to connect javelin GND to ftdi GND

    AC5 and AC6 both high (pullup) to enter uart mode· correct

    Your setup should be

    static final int pinTX = CPU.pin4; //transmit output, connect to device RX pin
    static final int pinRX = CPU.pin5; //receive input, connect to device TX pin
    static final int pinRTS = CPU.pin2; //handshake output, connect to device handshake input pin
    static final int pinCTS = CPU.pin3; //handshake input, connect to device handshake output pin

    static Uart tx = new Uart(Uart.dirTransmit,pinTX,Uart.dontInvert,pinCTS,Uart.dontInvert,Uart.speed9600,Uart.stop1);
    static Uart rx = new Uart(Uart.dirReceive,pinRX,Uart.dontInvert,pinRTS,Uart.dontInvert,Uart.speed9600,Uart.stop1);

    I think you need to create a local connection on the ftdi:
    DTR (AD4) to DSR (AD5)

    Assuming you have the correct baudrate, the above should work.
    In case it doesn't you need to play with the Uart.dontInvert settings

    static Uart tx = new Uart(Uart.dirTransmit,pinTX,Uart.invert,pinCTS,Uart.dontInvert,Uart.speed9600,Uart.stop1);
    static Uart rx = new Uart(Uart.dirReceive,pinRX,Uart.invert,pinRTS,Uart.dontInvert,Uart.speed9600,Uart.stop1);

    if the above does not work, try

    static Uart tx = new Uart(Uart.dirTransmit,pinTX,Uart.dontInvert,pinCTS,Uart.invert,Uart.speed9600,Uart.stop1);
    static Uart rx = new Uart(Uart.dirReceive,pinRX,Uart.dontInvert,pinRTS,Uart.invert,Uart.speed9600,Uart.stop1);

    if the above does not work, try

    static Uart tx = new Uart(Uart.dirTransmit,pinTX,Uart.invert,pinCTS,Uart.invert,Uart.speed9600,Uart.stop1);
    static Uart rx = new Uart(Uart.dirReceive,pinRX,Uart.invert,pinRTS,Uart.invert,Uart.speed9600,Uart.stop1);

    regards peter





    Post Edited (Peter Verkaik) : 5/8/2007 1:02:40 PM GMT
  • azaccagninoazaccagnino Posts: 11
    edited 2007-05-08 17:26
    SUCCESS ....

    Thank you Peter for all your help.
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-05-08 21:08
    That's great.
    Now please·tell·us your working setup so others that want to use that chip
    don't have to work it out all again. Thanks.

    regards peter
Sign In or Register to comment.