This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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.
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.
Joined: Jul 30, 2009
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!!
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.