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 CCS Technical Support

.txt File Storage - What's the best to do?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
krigisk



Joined: 10 Nov 2011
Posts: 6

View user's profile Send private message MSN Messenger

.txt File Storage - What's the best to do?
PostPosted: Tue Mar 20, 2012 8:43 am     Reply with quote

Hello all!

First, sorry for my English, I'm from Brazil.

Guys, I have a little problem and need to find a solution to continue my project.

I'm building a equipment that tests cables. I need to save this tests like "TEST1.txt" and inside this file I need to write something like "TEST 1 - all OK" or "TEST1 - Found ERROR - You have a problem in the cable shield".
Then, logically, I need to transfer this file to the PC.

What's the best to work... A SD CARD? If this is the best option, do you have some example?

Is there another type of memory storage that I can use with USB communication? EEPROM maybe?


Thank you in advance.
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

Re: .txt File Storage - What's the best to do?
PostPosted: Tue Mar 20, 2012 10:16 am     Reply with quote

krigisk wrote:
Hello all!

First, sorry for my English, I'm from Brazil.

Guys, I have a little problem and need to find a solution to continue my project.

I'm building a equipment that tests cables. I need to save this tests like "TEST1.txt" and inside this file I need to write something like "TEST 1 - all OK" or "TEST1 - Found ERROR - You have a problem in the cable shield".
Then, logically, I need to transfer this file to the PC.

What's the best to work... A SD CARD? If this is the best option, do you have some example?

Is there another type of memory storage that I can use with USB communication? EEPROM maybe?


Thank you in advance.


It depends on your volume of data and how you want to transfer data between you target and the PC. If you want to be able to remove the media, ship it to a remote location and then plug it into a PC for accessing the data without requiring specialized device drivers, then SD/MMC cards, combined with the FAT file system is a good option.

If the target and the PC are in close proximity to each other then USB may be the way to go. There are PICs with embedded USB peripherals however you need to exercise caution before taking this approach. You may find the loss of resources (such as RAM) and application integration considerations for the embedded controller, do not justify this approach. It is not uncommon to see PICs with embedded USB capabilities being connected to an external USB controller rather than using the embedded controller.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
krigisk



Joined: 10 Nov 2011
Posts: 6

View user's profile Send private message MSN Messenger

PostPosted: Tue Mar 20, 2012 10:40 am     Reply with quote

Thanks for the response asmallri

I think I'll use a 18f4550 to this project.
Another point is that equipment will not have to storage many .txt file.

Sometimes I really think SD card is the best option. But If another options are more easy, I'll will make this project with them because my time to develop this is short.

Thank you very much.
temtronic



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

View user's profile Send private message

PostPosted: Tue Mar 20, 2012 10:53 am     Reply with quote

I've used the FTDI Vinculum chips designed for USB flashdrives for 'dataloggers'.
Simple to use, easy to get 'up and running',fast to get the project done!
It looks like a 'serial' device to the PIC and if you store your data as dotCSV files(easy with CCS !) you can have ANY PC with a USB port( all do ) read the data. Excel will automatically read it.
I buy the premade 'modules' for about $30 US.The 'operating system, is onboard, so it doesn't take up any PIC code space.
You should search this site for SD questions, tons of them,1/2 due to incorrect hardware(5V PIC <=> 3V SD card), 1/2 due to 'software' issues(you can buy commercial drivers).If you value your time, spend a 1/2 day and scan this site, google 'vinculum data logger',etc.
There are other makes/model out there but FTDI seems to be the easiest,fastest, best performance for the money.
You can easily finish the project in one or two days.
krigisk



Joined: 10 Nov 2011
Posts: 6

View user's profile Send private message MSN Messenger

PostPosted: Tue Mar 20, 2012 12:47 pm     Reply with quote

temtronic thanks for the response!

When you said "module" means this?

http://www.parallax.com/tabid/768/ProductID/434/Default.aspx

Do you know any places that I can buy this or a "better" module?

Thanks for the help guys
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Tue Mar 20, 2012 2:15 pm     Reply with quote

krigisk wrote:
I think I'll use a 18f4550 to this project.
Wait with the decision for a specific PIC model until you have a more detailed design.
The PIC18F4550 has USB, but when you would decide to use a Viniculum module you don't need a PIC with USB and can choose a cheaper model.

In order to help you choose the best option we need more information:
1) How many of these devices are you going to build?
2) How is the user going to use the device?
3) Will the user be performing the cable tests close to the PC that is processing the data? I mean, can the user walk to the PC after the test is finished?
4) How many tests do you want to store?
5) How large will the text file for one measurement be approximately?
6) Any more info you can provide will get you a better answer.
temtronic



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

View user's profile Send private message

PostPosted: Tue Mar 20, 2012 3:31 pm     Reply with quote

Yes, that's one I've used. There's also a 'panel mount' version that someone sells. Problem with the Web, it's so easy to find stuff once...remembering WHERE is 'fun'.
I like them as a fast, universal storage solution since every PC has a USB port but not SD interfaces. Heck you can easily blow $40 in R&D time and not get anywhere. I use mine at 115K200 without handshaking, never lost a bit or a byte of data.
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Tue Mar 20, 2012 4:39 pm     Reply with quote

The very simplest method for close proximity connections (up to 10 ft or a bit more) are various RS-232 translators that use the FTDI FT232R chip.

It has a very simple way to interface to 5v or 3.3v logic on your pic
** they do not need a crystal and cost only a couple $$ each.

Better still, it will connect at TTL level to your pic and there are computer interface drivers for PC OS WIN,DOS, LINUX pc s's and several MAC OS's as well.

I have had excellent success designing these into a number of low cost to produce instruments and if you ONLY need a few ready to go units
for a pilot run consider the EXCELLENT UM232R development board.

It makes it VERY EZ to be up and connected for under $20 USD.
krigisk



Joined: 10 Nov 2011
Posts: 6

View user's profile Send private message MSN Messenger

PostPosted: Wed Mar 21, 2012 4:48 am     Reply with quote

Thanks for all the responses guys.

ckielstra

1)It's a prototype, so I will produce one and then my boss will decide if it's a good device to sell here in Brazil.
2)I think that is best to build a universal device. Anyone can use, intuitive.
3)It's a network cable tester for the industry, so yes, the user will be close to the PC.
4)I think 50 tests it's a good number.
5)I want to make the text like this: Test X - ERROR - Wire A breaked
Test Y - all OK - Nothing detected

temtronic

I found this in a electronic store here where I live: http://www.tato.ind.br/detalhe_produto.php?codigo_chave=63
The command sheet: http://www.tato.ind.br/files/PenBScomandos.pdf

Is the same what you talking about right?

asmboy

I will google that.

Thanks


Guys, you are awesome. You're help me so much, I hope some day help you with something.
temtronic



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

View user's profile Send private message

PostPosted: Wed Mar 21, 2012 5:25 am     Reply with quote

Yes, it is a very similar unit !

What does it cost in US$.

Jay
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

PostPosted: Wed Mar 21, 2012 6:40 am     Reply with quote

For 24$ USD, sparkfun's open log is tough to beat.
interface is simple... power, send serial data. thats it.
_________________
CCS PCM 5.078 & CCS PCH 5.093
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Wed Mar 21, 2012 9:32 am     Reply with quote

temtronic wrote:
What does it cost in US$.Jay
R$120 ~ US$66 ~ €50

Quote:
4)I think 50 tests it's a good number.
5)I want to make the text like this: Test X - ERROR - Wire A breaked
Test Y - all OK - Nothing detected
So basically 1 file contains max. 35 ASCII characters. Times 50 = 1750 bytes total.
Or when you take just the raw data, it is an id number + error code. 5 bytes max * 50 tests = 250 bytes total. This would fit into the PIC's internal EEPROM.

I didn't know about the Sparkfun Openlog and it sounds like a real bargain for a quick one-off prototype. But for a small series of this product you can save $24 on every unit by using the PIC's internal EEPROM. The choice of course largely depends on your hourly rate as it will take at least an extra week to write the USB code to access the data.

There is still one thing I don't understand. How is the user going to use the test device? I mean, he can test 20 different cables, but then back at the PC how will he know which cable belongs to which test file?
Is there some other means of input on the test device? For example a keyboard where the user can enter a product ID?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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