VDIP1 and 16f688 HSEROUT


Closed Thread
Results 1 to 4 of 4

Hybrid View

  1. #1
    Join Date
    Dec 2010
    Posts
    48

    Default VDIP1 and 16f688 HSEROUT

    I finally got around to setting up my VDIP1 and I have no clue where to start. I have it connected to a 16f688 and am using the onboard serial communication ports and HSEROUT commands with 9600 baud rate. The VDIP1 is set in UART mode and CTS pin 10 is grounded. When I turn my circuit on the VDIP1 leds alternate two or three times, stop, then alternate once again. At this point led 2 begins to flash as does the USB thumb drive internal led. Once that stops led 2 remains on. It seems the VDIP1 recognizes the thumb drive based on what I just explained. The thumb drive I am using is a Verbatim 4gb card formatted in FAT32.

    My problem is communicating with the module. Here is my code so far, though I feel it is lacking some essential features:

    Code:
    ANSEL  = 0
    TRISC = 0
    CMCON0 = 0
    
    DEFINE LCD_DREG PORTC 'Define PIC port used for LCD Data lines
    DEFINE LCD_DBIT 0 'LCD Data Starting Bit = Bit 0 or 4
    DEFINE LCD_EREG PORTA 'Define PIC port used for E line of LCD
    DEFINE LCD_EBIT 5 'Define Port pin used for E connection
    DEFINE LCD_RSREG PORTA 'Define PIC port used for RS line of LCD
    DEFINE LCD_RSBIT 4 'Define Port pin used for RS connection
    DEFINE LCD_BITS 4 'Define the 4 bit communication mode to LCD
    DEFINE LCD_LINES 2 'Define using a 2 line LCD
    DEFINE LCD_COMMANDUS 2000 'Define delay time between sending LCD commands
    DEFINE LCD_DATAUS 50 'Define delay time between data sent.
    
    Pause 600 ' Wait for LCD to startup
    
    DEFINE HSER_RCSTA 90h ' Enable Serial PORT
    DEFINE HSER_TXSTA 24h ' Enable transmit
    DEFINE HSER_SPBRG 129 ' set USART to 9600 baud (when BRGH=1)
    DEFINE HSER_CLROERR 1 ' Enable automatic overrun error
    DEFINE LOADER_USED 1
    
    Receive var word
    
    '~~~~~~~~~~Main Proram~~~~~~~~~~~~~~~~~~~~~~~
    
    lcdout "Start"
    
    Main:
    
    pause 2000
    lcdout $fe, 1
    
    hserout ["SCS", $0D]      'select shorthand command set
    pauseus 10
    hserout ["IPA", $0D]      'input in ASCII
    pauseus 10
    hserout [$01, $0D]        'list files in current directory
    
    pauseus 10
    hserin [receive]
    lcdout receive
    pause 100
    
    stop
    There is a file on the thumb drive named "A" and I am trying to have that filename displayed on an lcd screen. The connection between the lcd and the pic works fine, but once the lcd screen is cleared it remains blank. Can anyone help get me started in the right direction? Thanks

    p.s. I have seen BrianT's write-up on using the VDIP1 module and tried to use what he did in the beginning

  2. #2
    Join Date
    Dec 2010
    Posts
    48


    Did you find this post helpful? Yes | No

    Default Re: VDIP1 and 16f688 HSEROUT

    here are the datasheets for the 16f688, VDIP1, and the command codes for the VDIP1:

    16f688 datasheet - http://ww1.microchip.com/downloads/e...doc/41203d.pdf

    VDIP1 datasheet - http://www.ftdichip.com/Support/Docu...s/DS_VDIP1.pdf

    VDIP1 commands - http://www.ftdichip.com/Firmware/Pre...mware_V205.pdf

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: VDIP1 and 16f688 HSEROUT

    Your HSER defines are setup for 9600 baud at 20Mhz.
    But you don't have a DEFINE OSC statement, so PBP assumes you are running at 4Mhz.

    What frequency is your oscillator?
    DT

  4. #4
    Join Date
    Dec 2010
    Posts
    48


    Did you find this post helpful? Yes | No

    Default Re: VDIP1 and 16f688 HSEROUT

    wow I sure missed that. I typically use the 8MHz internal oscillator because I have no external crystals to use.

Similar Threads

  1. VDIP1 Command List
    By emerson in forum Documentation
    Replies: 5
    Last Post: - 5th October 2013, 10:55
  2. VDIP1 (Vinculum - FTDI) problems
    By BrianT in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 20th August 2013, 13:51
  3. Vdip1
    By sky071022 in forum Off Topic
    Replies: 17
    Last Post: - 9th March 2009, 03:42
  4. PIC interfacing with FTDI's VDIP1
    By Vidya in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 12th May 2008, 17:02
  5. Problem with 16F688 and Hserout
    By DWV in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 19th March 2005, 05:37

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts