|
|
My bad: another note about compact flash cardsSaturday, August 02. 2008Trackbacks
Trackback specific URI for this entry
No Trackbacks
Comments
Display comments as
(Linear | Threaded)
The software required for mass storage devices is pretty much the same. They all give you an interface that reads and writes sectors. With compact flash you just set up a few command registers. With SD you sends some commands over SPI. Same sort of commands, similar complexity.
The fun comes when you want a file system instead of just an array of sectors. It only needs about 1000 lines of C to implement FAT read and write. It is exactly the same code at that level for SD, CF and USB.
If you're on anything where devices get exposed as files, it'd be pretty easy to just sequentially use disk sectors and avoid FAT entirely, without sacrificing the ability to use a computer for it. Hopefully it's not too much more awkward on windows. That is, if there isn't space on the uC to just use FAT.
Looks like with this compiler you have a library that does all the hard work of accessing filenames out of the FAT. There is a code snippet on pp 229-230 in the manual at...
http://www.mikroe.com/pdf/mikrobasic/mikrobasic_manual.pdf
Once you've opened the file you just get the size of it with another command and read it back byte by byte. Pretty much trivial. I'm thinking that I'm going to buy this compiler. It looks to be good value for money.
For arduino there is already a working example for sd card read:
http://www.ladyada.net/make/waveshield/download.html
Instead of spending money to a yet another compiler (which is neither open source nor free and windows-only) would make more sense to adopt the arduino.
Or if you think you are out of pins, check out Zach's new 40pin version of arduino: www.sanguino.org
Learning the C-like wiring language seams really easy, and there are dozens of examples for help you out.
And the hardware costs a fraction of your software license. (149USD vs. 24USD.)
See: http://www.nkcelectronics.com/freeduino-arduino-diecimila-compatible-board-complete-kit.html
Just my 2 cents.
When Zach proposed Arduino as a successor to the old Pic system that Simon designed, I endorsed the change. It was a distinct improvement on the old 16F628/48 pic system and the Arduino open source C compiler was streets ahead of the old SDCC compiler. That said, the way I am doing things with the USB-native 18F4550 is much simpler than Arduino and enormously more powerful. While Zach is trying to address the need for more computing power with Sanguino, I am not at all sure that that is where Darwin/Mendel will ultimately go. Nophead has recently proposed a hardware configuration that has much in common with what I am doing, though he is using another compiler. Given Nophead's day job is doing this sort of design work, I suspect that you won't see Arduino or Sanguino used in Mendel. Anyhow, I'm pretty happy with the development tools I am using and contemplating using, so I think I shall eschew joining the Arduino/Sanguino open source community for the mid-term.
|