Jump to content

SOLVED: SPI on C2000 launchpad

Recommended Posts

  • Replies 46
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Hey CorB, looks like we have been working on the same project. Ive also written some code (needs tidying still but will post when Im happy) to drive these LCDs. As Ive been using mine for the $4.30

CorB,   I solved the issues with the original example. It turns out the order in which the FIFO register bit fields are configured is important. To the best of my knowledge this isn't documented i

Replace your common directory with this Import the driverlib project from this directory Build the driverlib project Rebuild the SPI example with the code posted above The example should wor

Posted Images



I had to try once more ... could not stop myself. But again pure failure, the builtin SPI does not work. Ive used the code below to set the SPI up and rewritten the SPI_WRITE part in the LCD too. The oddest part in using this code is that the LEDs are starting to blink as if I see the SPI transfer passing via the LEDs. Thats odd since the Leds are on complete different GPIOlines.


Unfortunately I have not see 1 simple working example of anybody using the SPI on the C2K launchpad ...





**** initialize SPI

GPIO_setPullUp(myGpio, GPIO_Number_16, GPIO_PullUp_Enable);
GPIO_setPullUp(myGpio, GPIO_Number_17, GPIO_PullUp_Enable);
GPIO_setPullUp(myGpio, GPIO_Number_18, GPIO_PullUp_Enable);
GPIO_setPullUp(myGpio, GPIO_Number_19, GPIO_PullUp_Enable);
GPIO_setQualification(myGpio, GPIO_Number_16, GPIO_Qual_ASync);
GPIO_setQualification(myGpio, GPIO_Number_17, GPIO_Qual_ASync);
GPIO_setQualification(myGpio, GPIO_Number_18, GPIO_Qual_ASync);
       GPIO_setQualification(myGpio, GPIO_Number_19, GPIO_Qual_ASync);
       GPIO_setMode(myGpio, GPIO_Number_16, GPIO_16_Mode_SPISIMOA);
       GPIO_setMode(myGpio, GPIO_Number_17, GPIO_17_Mode_SPISOMIA);
       GPIO_setMode(myGpio, GPIO_Number_18, GPIO_18_Mode_SPICLKA);
       GPIO_setMode(myGpio, GPIO_Number_19, GPIO_19_Mode_SPISTEA_NOT);


       // Reset on, rising edge, 8-bit char bits
       SPI_setCharLength(mySpi, SPI_CharLength_9_Bits);
       // Enable master mode, normal phase,
       // enable talk, and SPI int disabled.
       SPI_setMode(mySpi, SPI_Mode_Master);
       SPI_setBaudRate(mySpi, 0x63);
       // Relinquish SPI from Reset
       // Set so breakpoints don't disturb xmission
       SPI_setPriority(mySpi, SPI_Priority_FreeRun);


void SPIWrite(uint16_t command, uint16_t data)
uint16_t spidata;
char bits;
spidata = command<<15;
spidata = spidata | data <<7;
   SpiaRegs.SPICTL.bit.TALK = 1; // Enable Transmit path
   SpiaRegs.SPITXBUF = spidata; // Master transmits data

Link to post
Share on other sites
  • 3 weeks later...

Ah ... I have given up hope on that one myself. Maybe RobG will give it a try, on the stellarisforum he at least suggested to give HW SPI a try both on C2K and on Stellaris. If he also doesnt ... I wonder where the real problem resides.




Link to post
Share on other sites

Was gonna say... I'll send you one of the 4.30 lcd's I did for free... Still got a couple spare ;)

I'd really like to see this working on the hardware SPI. I suppose I should just go order a board and give this a shot myself.



LCD and SD card boosterpacks ordered...I'll get to the bottom of this one way or another... :D


I can send him one in his order. I have 2 left. But I think, Trey is trying to get Lar's booster to work. Trey?

Link to post
Share on other sites
  • 4 weeks later...


I am trying to interface the Anaren Value line booster pack with C2000 launchpad. Kindly find the code attached and suggest what am i doing wrong in this.

The connections are as below:

RF Booster Pack C2000 LaunchPad Jumper Pin No Designation Function Jumper Pin No Designation Function J1 1 Vdd Power J1 1 Vdd Power 2 P1.0 GDO2 2 ADCINA6 GDO2 3 P1.1 Alt GDO0 3 GPIO28 4 P1.2 Alt CSN 4 GPIO29 5 P1.3 Alt GDO0 5 GPIO34 6 P1.4 Alt CSN 6 ADCINA4 7 P1.5 SCLK 7 GPIO18 SPICLK 8 P2.0 NC 8 ADCINA2 9 P2.1 NC 9 IDCINB2 10 P2.2 NC 10 ADCINB4 J2 1 GND GND J2 1 GND 2 XIN GDO0 2 GPIO19 SPISTEA 3 XOUT CSn 3 GPIO12 Switch 4 SBWTCK NC 4 NC 5 RST NC 5 RESET 6 P1.7 MOSI 6 GPIO16 MOSI 7 P1.6 MISO 7 GPIO17 MISO 8 P2.5 NC 8 GPIO6 GDO0 9 P2.4 NC 9 GPIO7 10 P2.3 NC 10 ADCINB6

Using GPIO6 as slave interrupt.



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.

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