BS2 Datalogger to a CF card or IDE drive....
Well, after much work, I finally got the low-level IDE code down to 850 bytes.
In the remaining space, I've put the code necessary to create a blank CSV file
on the FAT16 partition. Now, I'm working on a main loop that reads an ADC and
puts the value in the RAM buffer. Once all the data is ready, it dumps the FAT,
ROOT and DATA sectors to the drive. Right now, without the main loop, there's
432 bytes left.
This project has gone way beyond what I ever thought possible with the BS2.
It's REALLY slow (30 seconds to initialize and create new file), but for a
datalogger that takes readings on the >5 minute interval range, it will do the
job nicely. With the addition of a real-time clock and a way to multiplex
analog signals, you could take several readings on a long interval.
I brought a 4.3GB drive home from work and it worked with minor changes. I put
in a timeout that would reset the drive if there was no response. That had to
be removed so it would just retry without reset. Now, even my 1GB IBM
Microdrive works.
I'm going on vacation for 2 weeks, so this project will not be updated till I
get back. I'll update my site with all the newest code changes before I leave.
If anyone has any suggestions, ideas, etc., please don't hesitate to share it.
This project is going to be open for anyone to build and experiment with. Who
knows how far it could go....
Barry
http://www.barrymichels.com/ide
[noparse][[/noparse]Non-text portions of this message have been removed]
In the remaining space, I've put the code necessary to create a blank CSV file
on the FAT16 partition. Now, I'm working on a main loop that reads an ADC and
puts the value in the RAM buffer. Once all the data is ready, it dumps the FAT,
ROOT and DATA sectors to the drive. Right now, without the main loop, there's
432 bytes left.
This project has gone way beyond what I ever thought possible with the BS2.
It's REALLY slow (30 seconds to initialize and create new file), but for a
datalogger that takes readings on the >5 minute interval range, it will do the
job nicely. With the addition of a real-time clock and a way to multiplex
analog signals, you could take several readings on a long interval.
I brought a 4.3GB drive home from work and it worked with minor changes. I put
in a timeout that would reset the drive if there was no response. That had to
be removed so it would just retry without reset. Now, even my 1GB IBM
Microdrive works.
I'm going on vacation for 2 weeks, so this project will not be updated till I
get back. I'll update my site with all the newest code changes before I leave.
If anyone has any suggestions, ideas, etc., please don't hesitate to share it.
This project is going to be open for anyone to build and experiment with. Who
knows how far it could go....
Barry
http://www.barrymichels.com/ide
[noparse][[/noparse]Non-text portions of this message have been removed]
Comments
space left. More will be available after optimization like I did to the
low-level routines.
Currently, it logs a reading to a CSV file every minute. There's a LED on pin 8
that is a 'safe-to-remove' pin. If you're quick, you can remove the card and
view the contents before the next reading. When you put the CF card back, it
resumes recording. With the retry routine in place, even if you can't get the
card back in by the time the next reading starts, it will resume when the card
is replaced. The next reading will be delayed, though.
I'm going to take a break from this project for now and update my site tomorrow.
Barry
[noparse][[/noparse]Non-text portions of this message have been removed]