EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Best Method to Download Data from a datalogger?

Started by Mercy October 10, 2006
"JeffM" <jeffm_@email.com> wrote in message 
news:1160869369.841487.19520@f16g2000cwb.googlegroups.com...
> Tom Lucas wrote: >>I had a very similar problem with an industrial boiler control where >>the old method was to use a laptop with an IrDA dongle to transfer >>data. >>I started a thread on it about a year ago called "Upload Options" >>or similar but I can't find it in google. > > http://groups.google.com/groups/search?q=insubject:Upload-Options+author:Tom-Lucas
Doesn't work for me :-(
Currently the datalogger I'm using uses two internal FRAM chips.  It
has 256 kb each.  So yea, it's quite a bit of memory to download.
Which is why I think I am going to go with the the MMC solution.  I've
finally finished reading the sandisk mmc product manual and feel pretty
confident about the process for reading and writing to the card.

I think I know how to write data to the MMC as raw memory... but I
don't know how to write the data as a 'text file'?  I want the user to
be able to plug the MMC into a card reader on their laptop and simply
open the information as a text file.  Where can I go for more
information on how to do that?

Thanks,
Mercy

"Mercy" <mercy.chang@gmail.com> wrote in message
news:1161191416.325230.51870@b28g2000cwb.googlegroups.com...
> Currently the datalogger I'm using uses two internal FRAM chips. It > has 256 kb each. So yea, it's quite a bit of memory to download. > Which is why I think I am going to go with the the MMC solution. I've > finally finished reading the sandisk mmc product manual and feel pretty > confident about the process for reading and writing to the card. > > I think I know how to write data to the MMC as raw memory... but I > don't know how to write the data as a 'text file'? I want the user to > be able to plug the MMC into a card reader on their laptop and simply > open the information as a text file. Where can I go for more > information on how to do that?
This topic has been discussed often in this group, so you might want to search. Basically, MMC or SD cards can be driven from an SPI interface. It sound like you know how to read and write sectors. To write files you will need code to implement the FAT files system. Usually FAT16 is sufficient. You can get code to do it that fits in to small micros, google for DosFS or FatFS. Typically these require ~1K RAM and a few Ks code. Peter
"Mercy" <mercy.chang@gmail.com> wrote in message 
news:1161191416.325230.51870@b28g2000cwb.googlegroups.com...
> Currently the datalogger I'm using uses two internal FRAM chips. It > has 256 kb each. So yea, it's quite a bit of memory to download. > Which is why I think I am going to go with the the MMC solution. I've > finally finished reading the sandisk mmc product manual and feel > pretty > confident about the process for reading and writing to the card. > > I think I know how to write data to the MMC as raw memory... but I > don't know how to write the data as a 'text file'? I want the user to > be able to plug the MMC into a card reader on their laptop and simply > open the information as a text file. Where can I go for more > information on how to do that?
Lewin's DosFS will handle the file system side of things as long as you can read and write your 512byte blocks to/from the MMC card where requested. You can get it here http://www.zws.com/products/dosfs/index.html . If you don't want to use it then it gives some great pointers on what to do. This application note holds some good pointers too and has a circuit diagram that I have used successfully. http://document.sharpsma.com/Handler/getfile_handler3.asp?nodeid=Documents&fileid=F4BAFFFC85634BD700847119CEFE6EE it is designed for a Sharp 79520 but the principle applies to everyone. As for composing the test file, then it is just a list of ASCII characters which you can write into an appropriate card location from whichever array you stored them in. The heart of the prblem is composing the 512byte blocks to put into the MMC card and working out where (from the FAT) you are going to store them. I wish I could send you my code but the company would frown on it but it is really not that complicated (and I am no whizz kid believe me). I don't bother with FAT32 and just stick to FAT16 with 8.3 filenames (make sure the MMC card is formatted for FAT 16) to keep it simple.
Mercy wrote:

> Currently the datalogger I'm using uses two internal FRAM chips. It > has 256 kb each. So yea, it's quite a bit of memory to download.
256kB = 32Kbyte * 2 = 64KiloBytes !!! What is the FRAM chip involved ?
> Which is why I think I am going to go with the the MMC solution. I've
The smallist MMC chip currentyly available is 32MegaBytes ! I am confused about the sizes involved. Are you sure about the FRAM here ??
> finally finished reading the sandisk mmc product manual and feel pretty > confident about the process for reading and writing to the card. > > I think I know how to write data to the MMC as raw memory... but I > don't know how to write the data as a 'text file'? I want the user to > be able to plug the MMC into a card reader on their laptop and simply > open the information as a text file. Where can I go for more > information on how to do that? > > Thanks, > Mercy >
Donald wrote:
> Mercy wrote: > > > Currently the datalogger I'm using uses two internal FRAM chips. It > > has 256 kb each. So yea, it's quite a bit of memory to download. > > 256kB = 32Kbyte * 2 = 64KiloBytes !!! > > What is the FRAM chip involved ? > > > > Which is why I think I am going to go with the the MMC solution. I've > > The smallist MMC chip currentyly available is 32MegaBytes ! > > I am confused about the sizes involved. > > Are you sure about the FRAM here ?? >
Sorry, I get confused between kb and Kb. I meant Kb :-) -Mercy
Tom Lucas wrote:

> Lewin's DosFS will handle the file system side of things as long as you > can read and write your 512byte blocks to/from the MMC card where > requested. You can get it here > http://www.zws.com/products/dosfs/index.html . If you don't want to use > it then it gives some great pointers on what to do. This application > note holds some good pointers too and has a circuit diagram that I have > used successfully.
Thanks again for all your help guys. I'm not researching the FAT16 stuff. Everyone keeps pointing me to Lewin's DosFS for help... so I went there :-) I've downloaded the 'DOSFS distribution archive' from the zws website. But everytime I try to unzip the compressed file with winzip, I get an error... something about the headers being corrupt. I can't believe I can't even unzip a file! Now I feel really silly. Does anyone else run into the same problem? I'll keep trying and looking around for more info on the file system stuff :-) -Mercy
Mercy wrote:
>
... snip ...
> > I'm not researching the FAT16 stuff. Everyone keeps pointing me > to Lewin's DosFS for help... so I went there :-) > > I've downloaded the 'DOSFS distribution archive' from the zws > website. But everytime I try to unzip the compressed file with > winzip, I get an error... something about the headers being corrupt. > I can't believe I can't even unzip a file! Now I feel really silly. > Does anyone else run into the same problem? I'll keep trying and > looking around for more info on the file system stuff :-)
It's a .tgz file, not a zip file. Why are you using winzip on it? You need gzip and tar. Work from the command line where you can see what you are doing. To check you have a clean copy, the md5sum is: 5d82ee6d0bc0e41add9a10c5a5cd59ab and it should untar into the new directory dosfs-1.02 using: gzip -dNc dosfs.tgz | tar -xv -- Chuck F (cbfalconer at maineline dot net) Available for consulting/temporary embedded and systems. <http://cbfalconer.home.att.net>
CBFalconer wrote:
> It's a .tgz file, not a zip file. Why are you using winzip on it? > You need gzip and tar. Work from the command line where you can > see what you are doing.
> --
I used winzip cause winzip says it "supports all operations on TAZ/TGZ files except creating new ones." http://www.winzip.com/wzdifs.htm I assumed that meant it can open .tgz files. Was I wrong?
Mercy wrote:
> CBFalconer wrote: > >> It's a .tgz file, not a zip file. Why are you using winzip on it? >> You need gzip and tar. Work from the command line where you can >> see what you are doing. > > I used winzip cause winzip says it "supports all operations on > TAZ/TGZ files except creating new ones." > http://www.winzip.com/wzdifs.htm > > I assumed that meant it can open .tgz files. Was I wrong?
I don't know. To my mind winzip is buggy and infested with guisms. That's why I recommended the command line utilities. Did you check you had a clean copy with the md5sum? -- Chuck F (cbfalconer at maineline dot net) Available for consulting/temporary embedded and systems. <http://cbfalconer.home.att.net>

Memfault Beyond the Launch