Pages: [1]   Go Down
Author Topic: VDIP1 Creating/Opening File  (Read 1281 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, i'm currently involved in a project that includes storing data on a stick through a VDIP1 Vinculum module. I'm using a Arduino Mega2560. I hooked up the VDIP1 pins to Arduino Serial1 pins. Tx-Rx and Rx-Tx and I tied up VDIP1 CTS and RTS together. The problem is that, when i'm trying something simple like creating/opening a file on the stick, nothing happens. I tried debbuging this using a led from my Arduino shield, to show me if the file is created, but it seems that Serial1 is never available therefore the LED never blinks. Any ideas for solving this? It's my first project on Arduino and i really suck on this platform. Code attached below. Any help would be greatly appreciated.

* SimpleUSBOpen.ino (0.83 KB - downloaded 5 times.)
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Your code:

Code:
int incoming=0;
int fileNumber=1;
int ledPin = 9;


void setup() {
  pinMode(ledPin, OUTPUT);
  Serial1.begin(9600);              
  Serial1.print("IPA");                 
  Serial1.print(byte(13));   
  if (Serial1.available() > 0) {       
    incoming = Serial1.read();


    Serial1.print("OPW LOG%");                 
    Serial1.print(fileNumber);                 
    Serial1.print(".TXT");                     
    Serial1.print(byte(13));                   
    delay(10000);
    Serial1.print("CLF LOG%");     
    Serial1.print(fileNumber);     
    Serial1.print(".TXT");
    Serial1.print(byte(13));
    delay(10000);
    digitalWrite(ledPin, HIGH);
    delay(100);
    digitalWrite(ledPin, LOW);
    delay(100);
    digitalWrite(ledPin, HIGH);
    delay(100);
    digitalWrite(ledPin, LOW);
   
     
  }

}
void loop() {
}

Why would Serial1 be available? Does the device send something initially? Link to the spec please?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanx for your replay Nick.You're right, the Seral1.available from my code is useless. That's for reading incoming byte. All i want is to open a file and then close it. I assume that this is your code, http://arduino.cc/playground/Main/UsbMemory, so i used it, with Serial1 instead. The problem is that it still doesn't work. It seems that this operation is pretty straightforward, but i don't know were i'm doing wrong. Related to specs, what specs do you need?
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

No that is not my code.

Quote
i'm currently involved in a project that includes storing data on a stick through a VDIP1 Vinculum module

You may know what that is, and thousands of others might, but I'm not one of them. If you are posting about a sketch involving <some gadget> it helps to post a link to the exact gadget.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, sorry i thought that you were already familiarized with this device because there was a Nick on that page. So the link for this device is http://www.comet.srl.ro/comet/new/FTDI/DS_VDIP1.pdf. The module communicates with arduino board through  AD0(TX) and AD1(RX)pins, which are connected to the arduino Serial1 port. The module also have two pins that are used for flow control AD2 (RTS) and AD3(CTS) and these pins are tied together with a wire.The device is also connected to the arduino 5V and GND. I'm using UART communication. This is the configuration and i've verified twice if i hooked up the wires correctly.Everything looks allright, but still, the file refuses to show up on the stick when i try to create it. Thanks.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You have a USB memory stick plugged into it? I just use SD cards these days plugged into an SD reader, a bit simpler than sending serial commands to some intermediate device.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, there is a USB stick into it. It wasn't actually my choice to work with this module, so i have to stick with it and make a datalogger as soon as possible. If i manage to create/close a file on the stick, then everything should be easy. But as simple as it looks like, this module seems to cause problems to its users.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't know, sorry. The datasheet isn't very helpful. It doesn't even mention 9600 baud, nor any of the commands you are using.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you anyway. The commands that i'm using are standard for opening/closing files on the stick. Is there any method on Arduino to open Serial1, like I'm doing with the standard Serial Monitor, and see if something is happening there?
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Serial goes through the USB interface. Serial1 doesn't. But if you get an FTDI cable (around $20) and hook it up with Tx/Rx connected to the Serial1 Tx/Rx (whichever way around it is) then you should be able to monitor the Serial1 output that way.
Logged

Pages: [1]   Go Up
Jump to: