wood burning stoves 2.0*
The moose likes Arduino and the fly likes Porting an SD card that's designed for Arduino on a TI Hercules Launchpad Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Arduino
Bookmark "Porting an SD card that Watch "Porting an SD card that New topic
Author

Porting an SD card that's designed for Arduino on a TI Hercules Launchpad

Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2491
    
    8

I'm trying to get an SD card that's designed to be used with Arduino on a Texas Instruments Hercules Launchpad.
The SD card breakout board is of Chinese make. it's part of a package of Arduino gizmos I bought second hand from the web (The packet contained two cards - I sold one)
I know the SD shield is working. I tested it on an Arduino.

My plans are to get it working on a TI TMS570. Not because I need it, but it's a nice hook to dig deeper into working with the ARM Cortex microcontroller.
I'm not yet sure if I'll use the SPI or MIBSPI driver of my processor. I'll keep all options open.

What have I done so far:
- I've created a custom 'boosterpack' from a proto-PCB that can be plugged onto the LaunchPad. Because the LaunchPad has male headers, it's not a straightforward exercise to use it for breadboarding.



- I've tested if the signals are appearing on the right pins by using one of TI's example applications from their e2e.ti forum. I changed the example to match my processor (it was for an RM42x), and to use a different chip-select pin. The CS0 from the original example is not available as a boosterpack breakout pin.
- I measured SCLK (I falsely called it system clock in the video), CS and MOSI with my (previous millennium early digital/analog PM 3305) Philips oscilloscope and with an Arduino as logic analyzer - just for kicks



Next step is to compile a SD library (most likely FatFs) and adapt it for this processor. I will try to maximize the use of the HALCoGen generated SPI/MIBSPI API.


OCUP UML fundamental and ITIL foundation
youtube channel
Jake Hammer
Greenhorn

Joined: Jul 30, 2009
Posts: 24
Were you able to get this to work with the Hercules? Where did you change the default Chip select setting that you mention in the video?
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2491
    
    8

I didn't complete this exercise yet. It's on the list of things that will happen some day

Where did you change the default Chip select setting that you mention in the video?

At what time in the video is that? I'll check my code, but as far as I know everything was done in HALCoGen.

Jake Hammer
Greenhorn

Joined: Jul 30, 2009
Posts: 24
At around 40 seconds in the second video, you mention that the sample code uses the chip select 0 pin by default and you had to change it to 1 for the hercules. I found the setting for that in HalCoGen (version 03.08.00) on the MIBSPI1 Transfer Groups tab. In the upper right corner, there is a place to define the Default Chip Select. Currently it is set to 0xFF.

I'm not very well versed in Hex, or embedded coding in general for that matter...I assume this is where I need to make the change, but I'm not sure what to change it to.m

Any insight you could provide would be very helpful!!

Thanks!
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2491
    
    8

You are on the right tab, but the chip select is available as a combo box.
For each of the transfer groups there is a Chip Select box. I've changed the selection for the transfer group used in the demo (you can see what fgroup is used in the demo's sys_main.cpp file, it's the second parameter of all the mibspi....() functions
I did not alter the Default Chip Select value.
Jake Hammer
Greenhorn

Joined: Jul 30, 2009
Posts: 24
I'll give it a try, thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Porting an SD card that's designed for Arduino on a TI Hercules Launchpad
 
Similar Threads
My 'Arduino in action' experience.
Arduino h/w recommendation for newbie
Testing out an Arduino as logic analyzer
Unpacking my second hand Arduino kits
Another devboard arrived: Texas instruments LaunchPad hercules is not an Arduino :)