Jump to content
43oh

PetiteFS FATfs SDCard USCI code


Recommended Posts

Hello Bluehash,

 

I managed to get the hardware connection working (and your code running) after a series of troubleshoots as listed below,

 

1. I found that P1.5 and GND of MSP430G2553 were short may be due to excess current fed into the line (it was my mistake). So replaced the IC itself.

2. I added pull-up resister of 10k each for SCK, DO, DI pins (Ref : http://www.mcu-turkey.com/wp-content/uploads/2012/12/sch_2-1024x701.png ).

3. Added 100nF capacitor across the VDD and VSS.

4. Retained pullup resister at 47k for CS pin. (Ref : TI site)

 

Thanks for all the help offered by you in solving the problem.

 

Regarding the commands, it seems "ft" and "fd" are the same except the alignment of display.

 

Some points :

 

1. I tried on 1GB, 2GB, 4GB, 8GB Miro SD cards successfully.

2. It worked for both FAT16 as well as for FAT32.

3. I soldered the wires directly to SD adapter and then inserted the micro SD.

 

Thanks & Regards,

Vksalian.

 

Why don't you connect it according to the schematic for the SDCard booster? The code is meant for that. It will be easier to debug.

Lets see:

P1.5 ->SCLK-------->Card Pin5

P1.6 ->MISO  ------>Card Pin7 

P1.7 ->MOSI-------->Card Pin2

P2.0 ->Chip select->Card Pin1

..and ground/power.

 

Forget about the CardDetect for now

Link to post
Share on other sites
  • Replies 144
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Edit: July 6th, 2014 Please also note that Pabigot maintains BSP430 which has an example for the msp430. He also tracks any changes done to the ElmChan library with patches made to the example. Refer

I went ahead and tested the booster pack and added the write support in the attached zip file. You should take a look at the Petit FatFS documentation regarding the write limitations. PetiteFS only

I took a look at the software serial code - I'm not seeing any issues with gutting it and using hardware UART unless I'm missing something obvious.  I'm not seeing anything that sets anything affectin

Posted Images

Hello Bluehash,

 

I managed to get the hardware connection working (and your code running) after a series of troubleshoots as listed below,

 

1. I found that P1.5 and GND of MSP430G2553 were short may be due to excess current fed into the line (it was my mistake). So replaced the IC itself.

2. I added pull-up resister of 10k each for SCK, DO, DI pins (Ref : http://www.mcu-turkey.com/wp-content/uploads/2012/12/sch_2-1024x701.png ).

3. Added 100nF capacitor across the VDD and VSS.

4. Retained pullup resister at 47k for CS pin. (Ref : TI site)

 

Thanks for all the help offered by you in solving the problem.

 

Regarding the commands, it seems "ft" and "fd" are the same except the alignment of display.

 

Some points :

 

1. I tried on 1GB, 2GB, 4GB, 8GB Miro SD cards successfully.

2. It worked for both FAT16 as well as for FAT32.

3. I soldered the wires directly to SD adapter and then inserted the micro SD.

 

Thanks & Regards,

Vksalian.

Congrats! Must be feeling good.  :thumbup:

Link to post
Share on other sites
  • 1 month later...
  • 2 weeks later...

if I were to use clock frequency of 1MHz instead of 16MHz and baud rate 9600 remains the same:

 

   BCSCTL1 = CALBC1_1MHZ;
   DCOCTL = CALDCO_1MHZ;
 
what do I need to change other than
 
these 2 line of codes in void setup ()
 
and
 
change to #define F_CPU 1000000 in config.h?
Link to post
Share on other sites
  • 4 weeks later...

Hi, do you think this coding is compatible with a MicroSD break out board, in place of the regular SD Card Booster Pack?

for example, this: http://www.hobbytronics.co.uk/microsd-transflash-breakout

 

It has the same functional pins as the SD Card Adapter, i was just wondering because that would be incredibly more convenient :-P

Thanks!

You should be fine.  MicroSD->SD adapters just pass those pins through - they're functionally identical.

Link to post
Share on other sites

Hey @@bluehash,

I downloaded your code and set it up as a new project in CCS. I have the correct connection from the LP board to the SD card, confirming it thru an Energia program. But when I build & debug the code, I can't get any responses from the Terminal Console.

 

I am using the g2553, the Termite 2.9 terminal, a microSD to SD card adapter, my baud rate on the terminal and code is 9600, the RXD/TXD jumpers are set in the horizontal position to communicate with the computer. And I even try typing 'Enter' or '> (Enter)' into the terminal, but I do not have any response.

Are there any other settings that I need to configure to get the prints & communication to show?

Thanks

Link to post
Share on other sites

ahh ok, so the RX and TX jumpers need to be Vertical || for CCS, whereas in Energia they have to be Horizontal =

So I got the terminal to print out the welcome messages, but I cannot get it to respond to 'di' or any variation of the command.
such as >di, > di, or any other spaces in between.

Could it be an SPI connection error? I keep switching between the microSD breakout board and the SD card adapter to see if either one works, but still nothing yet :/

 

Edit: I tried setting breakpoints during the forever loop, and I can't get any characters to be used at all.
I feel as if there may be an issue with the get_line function from the terminal? It reads in the characters, ie. '>' or 'd', but it doesn't trigger the switch-cases or anything.

Link to post
Share on other sites

@@bluehash, you're awesome!!

that was it, the SD card works and it can initialize the disk, FS, and read and open files!

 

only a little thing, when i prompt the >di command, i get "rc=1" which i think means that the res status is FR_DISK_ERR. But the card is still readable and everything else works afterwards. I was wondering if that's a concern at all?

But yeah! Definitely feels good to have this project working! Do you think it is possible to use the petitFS to read an .mp3 file and utilize that data to a decoder?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...