Archive for August, 2006

New Goodies!

Thursday, August 17th, 2006

Goodies!
L to R: PIC18LF4585 DIPs and SMT, 2GB SD Kingston SD card, USB SD Card Reader, SD Card Ejector Sockets

I’ve sampled (and purchased) a few more goodies for the project. Most importantly, I’ve sampled some new 18LF4585 PIC’s. The major difference with these PIC’s is that they have more RAM (roughly 3.3Kb as apposed to 368 bytes offered by the 16F877A), they run faster 40Mhz after enableing the Phase Lock Loop Multiplier, an internal 8Mhz oscillator (wow, that’s pretty cool), and few power saving features.
PIC18F4585 Datasheet

Next, I’ve sampled new Crystals (not pictured above) from Fox Electronics. Among my new crystals are two 10Mhz, two 20Mhz, and two 14.7456Mhz. The latter will be used for the STA013 MP3 decoder.

Read more for details on the new card slots, reading the new memory card, and my plans for tomorrow….
(more…)

FAT Filesystem and Wirewrap

Monday, August 14th, 2006

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).

  1. Fat16 Structure Information
  2. File Allocation Table - Wikipedia
  3. 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).

“Hello!”, said the SD card.

Thursday, August 10th, 2006


The Master Boot Record of my SD card starting at address 0×1BE (the important stuff). Bonus points to anyone who replies with comments stating what each byte of this block means.

Well, sorry that I haven’t posted lately, but I’ve been really quite busy. I’ve had quite a bit of success and the mp3 player project has gone through several key changes.

First, and most importantly, I’ve successfully (and reliably!) interfaced to the SD card. This took some work. On the breadboard pictured in one of the previous posts, I was getting some strange interference on the data line of the SD card. Because of this, I decided to switch to wire wrapping for my prototyping. It’s my first time wire wrapping so its still a bit sloppy, but is still leagues ahead of the breadboard in terms of expandability and neatness. After a few more headaches, I realized the problem; the first couple hundred bytes of my SD card are 0×00. I chose a more suitable address to read and it appeared to be working. After a few more tweaks it was reading consistantly and I was able to bump up the peak rate to around 305Kb/s.

Now I am on to the challenge of writing a FAT16 driver. Expect another post on details of this in a day or two.