CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

vdrive2 speed
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
paz



Joined: 17 Oct 2013
Posts: 9

View user's profile Send private message

vdrive2 speed
PostPosted: Fri Dec 20, 2013 1:36 am     Reply with quote

Hello all,
This is a general question.
I am using vdrive2 with my controller. It is serial to usb converter. i.e to interface usb drive such as pen drive to controller which doesnt have usb port but serial port is present.
So that user can save data in pendrive.
I am able to interface with 9600 pbs baudrate with serial mode.
vdrive2 writing to pendrive is very well.
I want to know that can I increase the speed of writing to pendrive using vdrive2 i.e I am writing 10 records if 1KB (txt file) each size to pendrive using vdrive2, it is taking 2 and half minutes to write to pendrive. I am not missing a single data, all records are received correctly.
How can I reduce the speed of writing i.e to write 10 records it should take less than 30 seconds.
And any memory size of pendrive or portable usb hard disk should be used.
Is it possible in vdrive2 and vdrive3?
If not then please suggest me some different module.
Is vdrive2 and vdrive3 are USB2.0 compatible?
Thanks and regards.
Ttelmah



Joined: 11 Mar 2010
Posts: 19454

View user's profile Send private message

PostPosted: Fri Dec 20, 2013 2:09 am     Reply with quote

Are you sure you are driving your serial port efficiently?. Are you using a hardware serial?. 10KB, can be sent to the vdrive with the standard firmware in just over 10 seconds!. It sounds as if your code may be actually taking a lot of time to generate the data....
This is probably your main problem.

Then to go even faster, the next thing is the baud rate.

Two choices.
You can customise the firmware in the unit, so it defaults to a higher rate.
Or, just send it the command to switch to a higher rate, and then change the UART speed in your PIC code.

Switching up to 115200bps, using interrupt driven hardware serial transmit, I can send nearly 0.5MB, in one minute, but the PIC code really has to work to actually generate the data this fast.

I'd suspect the vdrive is not the limiting factor. If you are using a software serial, then you will be stopping generating data, each time you send a byte, and having to do all the 'thought' in between bytes. Massive loss in performance.

Best Wishes
paz



Joined: 17 Oct 2013
Posts: 9

View user's profile Send private message

PostPosted: Fri Dec 20, 2013 2:48 am     Reply with quote

hi
Thank you for reply.
I even tested with computer communication i.e terminal.
To create a file it takes time.
I tried using command set given in the datasheet.
I tried to change the baudrate but when I turn OFF and then ON
it resumes to 9600 bps which is default baudrate.
Then if I try to change the baudrate then it will not work.
Ttelmah



Joined: 11 Mar 2010
Posts: 19454

View user's profile Send private message

PostPosted: Fri Dec 20, 2013 3:36 am     Reply with quote

Yes.
That is how it works unless you change the firmware.
But you can setup your code, to wake up at 9600bps, send the command for the Vdrive to change rate, and then change the baud rate in the code up to the higher rate.
paz



Joined: 17 Oct 2013
Posts: 9

View user's profile Send private message

PostPosted: Fri Dec 20, 2013 6:07 am     Reply with quote

Hello,
I tried the exactly you have mentioned.
but if I turn off and on then vdrive2 stucks in the reply routine.
i.e if I send change baudrate command then reply of command prompt doesnt come.
but if I continue with 9600bps then I am able to work properly but speed is slow.
I even tried to program the vdrive2 permanently using vncfwmod.exe
FTRFB.ftd but unable to program
is it really a fault of my code?
can you share your file with me?
temtronic



Joined: 01 Jul 2010
Posts: 9205
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Fri Dec 20, 2013 6:25 am     Reply with quote

Mr. T is right again, seems that you're not reprogramming the Vdrive2 module to a higher speed.
It's been couple years since I played with it but I recall needing to use their Windows software to create a new dotFTD file on a flashdrive,then using a terminal program to 'install' the new dotFTD file into the vdrive.
It took me a couple of trys to get it right,but likr Mr. T, I did get it to run at 115k200 baud.
Technically it can go faster( I think 3megaBaud) but 'other' things came up.
If you have your PIC program change the speed thats a temporary change as you found out, powering down, it reads its default of 9600.You could edit your PIC code to always change the baudrate when it powersup.
When you do get the default changed,put a small label with the speed on the drive to remind you! I have 2 of them here,one 9600, one 115k200 and yes , got them mixed up and spent an hour wondering WHY my was working code didn't work.......

hth
jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19454

View user's profile Send private message

PostPosted: Fri Dec 20, 2013 8:26 am     Reply with quote

Evil grin.....

You can waste so much time that way.

It really does depend if you want to run with standard firmware. If so, changing the rate is not exactly hard. Set the UART up to 9600bps, send the command to change rate, and switch UART rates. About three lines of PIC code.
Advantage is that there is no setup needed for an 'off the shelf' Vdrive.

You have to do this with many other devices like GPS's.

You 'pays your money, and takes your choice'...
paz



Joined: 17 Oct 2013
Posts: 9

View user's profile Send private message

vdrive2 speed
PostPosted: Mon Dec 30, 2013 9:45 pm     Reply with quote

Hello all,
I followed your advice and now my vdrive2 and controller baudrate is 57600 kbps.

but for writing 10 records of 1KB each it is taking 15sec on 8GB pendrive.
for writing 10 records of 1KB each it is taking 25sec on 2GB pendrive
is it OK?

One more thing I noticed that, first time when I connect the pendrive of 8GB to vdrive2 and try to copy records, it takes more than a minute. but afterwards it takes 15sec to write another 10 records if I don't remove the pendrive.

why is it so?
in datasheet, it is mentioned that vdrive2 is reading sector and free space available in pendrive. and it may take one minute to read.

How can I reduce the time and increase the speed?
Please guide.

regards
gpsmikey



Joined: 16 Nov 2010
Posts: 588
Location: Kirkland, WA

View user's profile Send private message

PostPosted: Mon Dec 30, 2013 9:53 pm     Reply with quote

One thing you have to be careful with on changing baud rates - you need to make sure the uart has finished sending whatever command string you are sending BEFORE switching rates. Favorite way to shoot self in foot - "send" a character then do something to the uart before it has time to finish sending. Been there, done that, have powder burns on feet to show for it Laughing

mikey
_________________
mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3
paz



Joined: 17 Oct 2013
Posts: 9

View user's profile Send private message

vdrive2 speed
PostPosted: Mon Dec 30, 2013 10:05 pm     Reply with quote

Hello,
Thanks for reply.

I have check the baudrate by sending echo command and it is working fine.

I am not sending data immediately after setting the baudrate

I have an application where data will be sent after 2 to 3 minutes.

I want to know why vdrive2 takes time for the first time when pendrive is connected for the copying the data and afterwards it doesnt take time for copying new set of data when pendrive is kept connected.

How can I reduce that speed?

how much big size pendrive or hard disk can be connected to vdrive2?

regards
paz



Joined: 17 Oct 2013
Posts: 9

View user's profile Send private message

vdrive2
PostPosted: Mon Dec 30, 2013 11:01 pm     Reply with quote

sorry I want to say how can I reduce the time and increase the speed
Ttelmah



Joined: 11 Mar 2010
Posts: 19454

View user's profile Send private message

PostPosted: Tue Dec 31, 2013 2:38 am     Reply with quote

Seriously, look at a PC.

When you attach a drive like this to the PC, note how it takes a few seconds before the device is seen, and then a few seconds more before the actual drive letter appears.

When you attach a device, first the USB host has to identify it, work out what speed it supports, & find a driver. Significant work.
Then on a drive, the start of the 'disk' has to be read to work out what type of file system is present 'floppy format', FAT16, or FAT32. Then for the latter, the partition table has to be read, to actually work out what logical drives are present. There is a lot of work involved in making the initial connection to a device like this. Hence some of the time....

However that being said, there was a fault with the initialisation code in the Vdrive2 firmware before V3.61, which made this much slower than it has to be. Check what firmware you have. The older firmware did a scan to determine free space on the drive, and this added significantly to this time.

Now in some environments where this time has to be reduced, one technique is to reduce the flexibility of the driver. You re-code to Vdrive, so (for instance), it only supports FAT16, with a specific drive size, and ensure your drives are all formatted the same. This reduces the connection time to a few mSec, but means that only drives formatted this exact way, can be used. If you are prepared to do this, then you need to learn how to code the FTDI device (they have a development kit).

Best Wishes
paz



Joined: 17 Oct 2013
Posts: 9

View user's profile Send private message

vdrive2
PostPosted: Tue Dec 31, 2013 2:48 am     Reply with quote

Hi,
Thanks for reply.

I understood what you want to say.

I need to change the software of vdrive2 but how ?

I have received this vdrive2 from digikey in a small box but no code for it.

please tell me what is the maximum size of pendrive and hardisk can be used with vdrive2?

regards
temtronic



Joined: 01 Jul 2010
Posts: 9205
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Dec 31, 2013 7:04 am     Reply with quote

comment: FTDI has a 'ap' on their website that allows you to edit and save 'configuration' of the vdrives. With it you create a small file ( ie: 'my115.ftd') and save onto a flashdrive. You insert that drive into the vdrive and read it into the vdrive OS. There's a command to do that..it's in the datasheet. Once 'upgraded', reboot the drive and the new settings will take effect, though it might autoreboot. It's been a couple years since I used them but I know it works. my115.ftd is my 115k200 baud configuration. Some things I do remember.


The vdrive should be good for 32GB drives. I've used 128MB, 512MB and 4GB drives in the past. Even a 128MB drive is a LOT of data storage! If you save your data in CSV format, it'll 'auto-load' into an eXcel spreadsheet.


hth
jay
DanielTPE



Joined: 20 Oct 2014
Posts: 10

View user's profile Send private message

vdrive2 speed
PostPosted: Wed Oct 29, 2014 10:00 am     Reply with quote

Hello everyone,

I see that you all have struggled with changing the baudrate of the VDrive2.
Now i'm trying to accomplish that as well by setting the baudrate from the standard 9600 to 115k2 baud with PIC code. (btw, I use a PIC16F1788)

Ttelmah wrote the following:

Ttelmah wrote:

It really does depend if you want to run with standard firmware. If so, changing the rate is not exactly hard. Set the UART up to 9600bps, send the command to change rate, and switch UART rates. About three lines of PIC code.


Now i'm wondering what command there is to change the baudrate by PIC code. My guess is using the following code:

Code:
printf("SBR divisor")


But that is not working right now. Can anyone point me in the right direction here?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group