Jump to content
CorB

SOLVED: SPI on C2000 launchpad

Recommended Posts

Hi Trey,

 

I will wait for others to test the SPI module, FIFO isnt necessary for this application.

 

COr

Edited by CorB

Share this post


Link to post
Share on other sites

Hello,

 

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);

       CLK_enableSpiaClock(myClk);

       // 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_enableTx(mySpi);
       SPI_setBaudRate(mySpi, 0x63);
       // Relinquish SPI from Reset
       SPI_enable(mySpi);
       // 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;
CSLOW;
   SpiaRegs.SPICTL.bit.TALK = 1; // Enable Transmit path
   SpiaRegs.SPITXBUF = spidata; // Master transmits data
   CSHIGH;
}

Share this post


Link to post
Share on other sites

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.

 

cheers

CorB

Share this post


Link to post
Share on other sites

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.

 

EDIT:

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

Edited by TI_Trey

Share this post


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.

 

EDIT:

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?

Share this post


Link to post
Share on other sites

Ya I was gonna try to get Lar's LCD working on hardware SPI. I also ordered a SD card booster...Blue, I'll race you to see who can get FatFS running first :P

Ok.. I'll try this weekend :)

Share this post


Link to post
Share on other sites

Team,

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.

Regards

Abhed

Share this post


Link to post
Share on other sites

Hi Abhed,

 

Your code was not attached and the connections are also not clearly visible ... something must have gone wrong

 

regards

 

CorB

Share this post


Link to post
Share on other sites

I have started the blog of Hardware SPI on C2000 launch Pad. Please take a look on the same. It has the code and connections image attached.

Awaiting your kind feedback on the same.

Abhed

Share this post


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