I have an 18LF2620 connected to 256 MB SD card all on 3.3v. I can get the FAT file system program to read the directory and create directories. I get errors when trying to create a file or read an existing file or delete a file. I have CCS V3.230. Thanks.
Guest Guest
spi settings
Posted: Wed Dec 07, 2005 4:13 pm
I had a similar problem and you might want to look at you spi settings. I used the following three lines of code:
setup_spi(SPI_MASTER|SPI_H_TO_L|SPI_CLK_DIV_4);
*0x94 |= 0x40; // set CKE = 1 - clock idle low
*0x14 &= 0xEF; // set CKP = 0 - data valid on rising edge
The last two lines set the proper spi bus state. I think the default is something like idle low but read on falling edge.
asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
Re: Anyone using Progressive LLC FAT?
Posted: Wed Dec 07, 2005 5:09 pm
ljbeng wrote:
I have an 18LF2620 connected to 256 MB SD card all on 3.3v. I can get the FAT file system program to read the directory and create directories. I get errors when trying to create a file or read an existing file or delete a file. I have CCS V3.230. Thanks.
You have not given enough information. What type of errors? What are the status messages returned from the card?
How was the card formatted?
What size fat?
Was the card partitioned?
Did you write the SD/MMC driver or did it come with the file system?
If you wrote the driver are you sure you have flushed the card with SPI_Write(0xFF) before issuing the first byte of a new command sequence and to issue a SPI_Write(0xFF) after the last command byte is issued in a sequence.
Are you using SPI or have you implemented one of the native 1x or 4x interfaces? _________________ Regards, Andrew
Is this a little of topic? LLC is commercial software so shouldn't this issue be adressed by LLC and not this forum. My fear is that if we are off the CCS topic too frequently CCS will see this forum as benefitting other commercial ventures and not them. Fixing commercial software from LLC maybe crossing this line.
ljbeng
Joined: 10 Feb 2004 Posts: 205
Posted: Thu Dec 08, 2005 3:29 pm
Guest, That didn't seem to help. It will not even initilize with those lines. It looks like Progressive has a provision in there for the SPI functions as you suggested. Thanks.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum