Arduino Forum

Forum 2005-2010 (read only) => Hardware => Interfacing => Topic started by: bhags21 on Aug 29, 2010, 02:57 pm

Title: .TXT file from PC to Arduino
Post by: bhags21 on Aug 29, 2010, 02:57 pm
How to read .txt file from PC with Arduino via Arduino's serial connection?

I have  10 text file in PC;
b1.txt, b2.txt....b10.txt
each of them 64bytes with different data(variable-periodically changing)
I want to transfer these data to Arduino via its usb-serial connection.

Can I use Serial.Write(buf,n) command or program like
HyperTerminal can do it easily?

Please advice
Thanks :)
Title: Re: .TXT file from PC to Arduino
Post by: Eight on Aug 29, 2010, 03:15 pm
You could try from the command line (can't remember if this exactly works or not)

C:\>type myfile.txt > com6

where com6 is the name of the com port connected to your Arduino. It doesn't die for me, but I don't have a sketch on there to read the data so it blocks and sits. Can't say whether it works.
Title: Re: .TXT file from PC to Arduino
Post by: bhags21 on Aug 29, 2010, 05:54 pm
I need something like 'Serial Monitor' which can send files too not just characters and numbers that we have to type in it.

Awaiting response
:'(
Title: Re: .TXT file from PC to Arduino
Post by: PaulS on Aug 29, 2010, 06:19 pm
You could write your own program on the PC that shows a form with input fields and a list of files and a send button.Type something and press send. Or select a file and press send. Do whatever is appropriate in the callback for the send button.
Title: Re: .TXT file from PC to Arduino
Post by: zoomkat on Aug 29, 2010, 06:57 pm
Quote
I need something like 'Serial Monitor' which can send files too not just characters and numbers that we have to type in it.

Awaiting response


So how do you plan to do "file" handling on the arduino?
Title: Re: .TXT file from PC to Arduino
Post by: bhags21 on Aug 29, 2010, 07:50 pm
Folks thanks for your attempts to ans my question!
Meanwhile I found out how to do file transfer(at least .txt file!!)
However it can transfer up to 115200 bits per second(Thats awsome for some ppl  :D ) but I need 6 times more than that  :'(  :'(
I'm trying have a look at FTDI's FT232R chip to see if I can bypass Arduino and receive the data directly from chip!

Will post back soon...
Title: Re: .TXT file from PC to Arduino
Post by: bhags21 on Aug 29, 2010, 08:33 pm
FTDI chip which does all the USB to serial processing supports upto 3Megabaud rate. You can check this out here..
http://www.ftdichip.com/Products/ICs/FT232R.htm

Even Arduino supports the baud rate more than 115200 but in serial monitor they haven't put the option to select more than 115200 so I'm trying look in to it...
will post u soon..
:)
Title: Re: .TXT file from PC to Arduino
Post by: bhags21 on Aug 29, 2010, 08:44 pm
Agreed but at the moment I'm at development stage only  :-[ and I'll
need financial funding before i go in production  :)
Title: Re: .TXT file from PC to Arduino
Post by: Osgeld on Aug 29, 2010, 09:00 pm
what financial funding

you can do this from the command prompt using the mode command to set your serial port speed and either type or echo commands to send it out

you could do this with putty, or hyperterm or anything the speed limitation on the arduino IDE is software only, if its not fast enough (i cant imagine why it wouldnt be you will fill the arduino's ram in less than a second) just dont use it
Title: Re: .TXT file from PC to Arduino
Post by: bhags21 on Aug 31, 2010, 01:39 pm
:D guys I've transferred text files from PC to Arduino at 921600bits/sec it's awsome!!!
However I'm bypassing Arduino and outputting data to other MCU. Just got FTDI working without Arduino. He he. I'm trying with 2Mbps now
;)
Title: Re: .TXT file from PC to Arduino
Post by: doublet on Aug 31, 2010, 03:38 pm
Can you please post your solution, so other people looking for this don't have to ask the same question?
Title: Re: .TXT file from PC to Arduino
Post by: bhags21 on Aug 31, 2010, 04:47 pm
I'm using following program to write .txt file from PC to arduino.  
Change COM port to one with yours also it works only for COM ports between 1 to 9 only!!!!
http://timewitharduino.blogspot.com/2009/05/getting-arduino-to-write-to-or-read.html

I hope this would be helpful!!
:)