Pages: [1]   Go Down
Author Topic: VDIP1 storage  (Read 866 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm trying to write a small program that works and then transform that into my bigger program (used to measure atmospheric data).

I'm using an Arduino Mega 2560. I using a FTDI VDIP1 to hold my flash drive in which I'm writing data to. I am utilizing my serial ports on my arduino and have them wired to the VDIP1. The connections:

5V
ground
A0 to RX1
A1 to TX1

The code is as follows:

Code:
void setup() {

  Serial1.begin(9600);
  Serial.begin(57600);

  char letter;
  int noOfChars;
  noOfChars +=2;
  letter='A';
 
  //Tells the USB Module to use ASCII numbers, so the output is human-readable.
  Serial1.print("IPA");
  Serial1.print(13, BYTE);
 
  //Open a file for writing data.
  Serial1.print("OPW DATA.TXT");
  Serial1.print(13, BYTE);
 
  //Write a header to the file
  Serial1.print("WRF ");
  Serial1.print(noOfChars);
  Serial1.print(13, BYTE);
  Serial1.print(letter);
  Serial1.print(13, BYTE);
 
  Serial1.print("CLF DATA.TXT");
  Serial1.print(13, BYTE);
 

 
  Serial.println("Wrote to file");
}

void loop() {
 
}

I tried using this as a guide:

http://www.arduino.cc/playground/Main/UsbMemory

Is there any information you need from my end to diagnose the problem?

The problem right now is that no file is made at all on the USB drive. Any ideas to solve this problem?
Logged

If it aint broke, stop touching it

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8967
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

II'm using an Arduino Mega 2560. I using a FTDI VDIP1 to hold my flash drive in which I'm writing data to. I am utilizing my serial ports on my arduino and have them wired to the VDIP1. The connections:

5V
ground
A0 to RX1
A1 to TX1

The playground page says: "It uses the cts and rts lines to control flow - so I just connected them to each other so that every time the vdip says it is ready to send, it gets a clear to send message."

Did you do that?
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

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

Yeah I soldered them together, before that it wouldn't recognize the flash drive at all. Before the flash drive wouldn't light up, and after I soldered them the flash drive lights up.
Logged

If it aint broke, stop touching it

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8967
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
  int noOfChars;
  noOfChars +=2;

You are taking an uninitialized variable (unknown value) and adding 2 to it. 

If you want to store an 'A' and a return character you probably want:


Code:
  int noOfChars = 2;
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

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

Yeah you're right, fixed it and tested it and still doesn't make the file. Do I need to do anything with the DIR command at all?
Logged

If it aint broke, stop touching it

Pages: [1]   Go Up
Jump to: