Drag the circle around to see the other side of the board. Click outside of the circle to “flip” the board.
Progress has been booming the past couple of days (or weeks for that matter). I’ve finally gotten around to taking a couple more pictures of my new wirewrap version of the board (pictured above). As can be seen in the photo I’ve got my FAT driver to work for the most part. What you see is the LCD displaying the contents of the root directory on the SD card. When you click one of the two buttons, it displays the next entry in the directory, and the other button, “opens” the selected item (currently it can only open directories).
One achievement that I’ve had that I am quite proud of is support for long file names. You may recall back in the days of DOS and early versions of Windows, you could only have an 8 character filename and a 3 character extension with considerable restrictions on characters (must all be upper case, etc…) They added a bit of a hack to the standard to allow for longer filenames as used and loved by all of us today.
I thought I’d post a couple links to invaluable resources that I’ve found that detail the FAT filesystem (ordered by usefulness).
- Fat16 Structure Information
- File Allocation Table – Wikipedia
- Microsoft’s FAT32 File System Specification
On another note, I really should have researched the PIC16F877A more thouroughly before embarking on my adventure. In the datasheet, it says 368×8 bytes of Ram. I foolishly interpreted this as 2944 bytes of RAM. Upon closer inspection of the datasheet (the memory map region specifically), it turns out that it is actually just 368 bytes of ram. After running through the compiler and leaving space for its own scratch pad’s and temporary variables, I only have enough space left for a 64 byte buffer. After deciding to support long file names, I had to cut this in half so that I could have some room to store the long file names. Suffice it to say, that space is scarce and as such, performance is taking a hit (smaller buffer means more frequent memory calls). Because of this serious limitation I’ve decided to switch to the PIC18F4585 which is very simmilar except that it has around 4Kb of RAM and can run at 40Mhz.
Until my newly sampled PICs arrive, I’ll have to continue to suffer with memory management issues. I’m hoping for a serious speed increase when the new chip arrives (I’ll use a 512byte buffer instead of a 32byte buffer and will be able to store more information at once).