This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TLV2553 with Stelaris and SSI

Other Parts Discussed in Thread: TLV2553, LM3S6537

Hi,

I have to use manual control of CS? I would use hardware SPI.

I use this functions:

void initVstupyADC(void)
{
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0);
GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE,EN);
GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE,CS);
EN_ADC;

GPIOPinConfigure(SSI0CLK_PIN);
GPIOPinConfigure(SSI0FSS_PIN);
GPIOPinConfigure(SSI0RX_PIN);
GPIOPinConfigure(SSI0TX_PIN);

GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_5 | GPIO_PIN_4 | GPIO_PIN_3 |
GPIO_PIN_2);

SSIConfigSetExpClk(SSI0_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_0,
SSI_MODE_MASTER, 1000000, 12);

SSIEnable(SSI0_BASE);



}
 

  • My Main function is here:

    initVstupyADC();

      ADC_Send(ADC_SELECTTEST1,ADC_MSB,ADC_UNIPOLAR,ADC_DELKA12);

    delay(1000000);
    SSIDataGet(SSI0_BASE, &data[0]);
    while(GPIOPinRead(GPIO_PORTB_BASE,EOC)==0);

    ADC_Send(ADC_SELECTTEST1,ADC_MSB,ADC_UNIPOLAR,ADC_DELKA12);

    delay(1000000);
    SSIDataGet(SSI0_BASE, &data[0]);
    while(GPIOPinRead(GPIO_PORTB_BASE,EOC)==0);
      lcd_print("ready");

    teplota = data[0];

  • Hi Lubo,

    What sort of project are you working on with the TLV2553?  Are you having trouble with it or is this just a general request for information?  In your initial post, you asked about the /CS input to the TLV2553.  Yes, you can use the SPISS as /CS to the device.

  • I working on security device. It is my school project...LM3S6537 doesn't communicate with TLV2553 and I don't have oscilloscope. I don't know How I should communicate with TLV2553. I thought, that I only send information about channel, direction, polarity and lenght in  one byte  and TLV2553 will return of measured value.

  • Lubo,

    Lubo�� Pejchal said:
    void initVstupyADC(void)
    {
    SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0);
    GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE,EN);
    GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE,CS);
    EN_ADC;

    GPIOPinConfigure(SSI0CLK_PIN);
    GPIOPinConfigure(SSI0FSS_PIN);
    GPIOPinConfigure(SSI0RX_PIN);
    GPIOPinConfigure(SSI0TX_PIN);

    GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_5 | GPIO_PIN_4 | GPIO_PIN_3 | GPIO_PIN_2);

    SSIConfigSetExpClk(SSI0_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_0, SSI_MODE_MASTER, 1000000, 12);

    SSIEnable(SSI0_BASE);
    }

    You're close. You need to enable the GPIO port that you are using for the SSI bus. In general terms you need to:

    1. Call SysCtlPeripheralEnable for the GPIO port and SSI peripheral that you are using
    2. Make calls to GPIOPinConfigure & GPIOPinTypeSSI to set the MUX on the GPIO port to the SSI peripheral
    3. Finish configuring the SSI bus based on your interface's requirements

    The section highlighted in your quote in yellow isn't necessary.

    Optionally you can also call GPIOPadConfigSet() to modify the current output of the SSI pins. Make sure you did this after everything else is configured if you're using the StellarisWare APIs; some of those functions will reset the pad configurations to the default conditions.

  • I know. I use GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE,CS); for test of manual setting CS.

  • Lubo,

    Fair enough, I didn't catch that they were different ports/pins.

    You still need to include a call to SysCtlPeripheralEnable in your init function. Something like...

    void initVstupyADC(void)
    {

    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0);

    GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE,EN);
    GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE,CS);
    EN_ADC;

    GPIOPinConfigure(GPIO_PA2_SSI0CLK);
    GPIOPinConfigure(GPIO_PA3_SSI0FSS);
    GPIOPinConfigure(GPIO_PA4_SSI0RX);
    GPIOPinConfigure(GPIO_PA5_SSI0TX);

    GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_5 | GPIO_PIN_4 | GPIO_PIN_3 | GPIO_PIN_2);

    GPIOPadConfigSet(GPIO_PORTA_BASE, GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4 |  GPIO_PIN_5, GPIO_STRENGTH_8MA, GPIO_PIN_TYPE_STD);

    SSIConfigSetExpClk(SSI0_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_0, SSI_MODE_MASTER, 1000000, 12);

    SSIEnable(SSI0_BASE);

    }

  • Never mind, My problem has solved.

  • Hi Lubo!

    What did you do to resolve the problem?  Curious minds want to know!

  • Kevin Duke: I didn't copy whole my Main function here.

    Tom Hendrick: I switched communication lenght from 12 to 8 and It has function now.