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.

Licensing: Tiva™ TM4C123BH6ZRB Microcontroller with CCSv5 IDE

Other Parts Discussed in Thread: TM4C123BH6ZRB, ADS1218

Hi,

I am using TM4C123BH6ZRB Microcontroller and CCSV5 code-size limited IDE with my new TIVA cortex M4 target board .

The link http://processors.wiki.ti.com/index.php/Stellaris_support_in_CCS#What_CCS_License_types_support_Stellaris.3F says, "With the free license you are restricted to using the development board that comes with the Stellaris development kits, there will be no code size limit."

From above link i assume that LM4S family of controller comes with full version of CCS IDE, there is no restriction on our custom development board, even in term of JTAG debugger. Am i correct?

Will I not be able to use the free license with my new TIVA cortex M4 target board(with TM4C123BH6ZRB controller ), do i have to pay to use code composer and have unrestricted code size for my new board?

Also i need to use BDI3000 JTAG debugger with the 10-pin JTAG connector interfaced on my board, not the XDS100. Can I use BDI3000 for debugging and re-flashing activity using the free license with my new board.

I could not find this answer in any place. Can you point me in right direction?

Regards,

Mritunjai

  • Hi,

    The TIVA Launchpad is covered under the Bundle License for CCS. So there is no limitation on the code size as long as you use TIVA launchpad.

    For, custom boards too you can use this license keeping into mind that you use XDS100 emulator with your board.

    Also i need to use BDI3000 JTAG debugger with the 10-pin JTAG connector interfaced on my board, not the XDS100. Can I use BDI3000 for debugging and re-flashing activity using the free license with my new board.

    No, you will have to purchase CCS license for availing that. The free bundled license is only for XDS100 emulators.

    Regards,

    Gautam

  • Thanks a lot,  I am now able to debug my code with the XDS100v2 emulator.

    Now I am currently testing all the hardware on my development board with TIVA processor(TM4C123BH6ZRBI). I am stuck in testing SPI interface with ADS1218. Can anyone provide me the code for testing ADS1218 hardware say simple flash read/write. I don't know the initialisation steps of this device. I know datasheet provides these, still I would be grateful if someone can provide me the code ASAP. I just need to verify if ADS1218 is correctly interface with SPI by verifying the data read/write through SPI.

    BTW ADS1218 is interfaced on SPI2.

    Regards,

    Mritunjai

  • Hi,

    Can anyone provide me the code for testing ADS1218 hardware say simple flash read/write. I don't know the initialisation steps of this device.

    Aren't the SPI examples in Tivaware helping you out?

    Regards,

    Gautam

  • I need SPI example for ADS1218 device which is not there in Tivaware example. I may need to write full or minimal slave driver for ADS1218 device in order to test its functionality. Thats why I need the minimal code that can test my slave device ADS1218 and if possible for M25P40(4 Mbit Flash) also.

     

    Regards,

    Mritunjai

  • I need SPI example for ADS1218 device which is not there in Tivaware example.

    Sorry, you won't get a direct implementation for the above devices. You'll have to modify the example spi codes wrt to the slave devices by referring their datasheets.

    Regards,

    Gautam

  • Hi,

    I am trying to test ADS1218 which is interfaced to SPI. Actually what I am trying to test initially is that I am writing to 16 registers of ADS1218 with some values and reading back those values. I am using SPI peirpheral ROM library.

     I can see that I am able to correctly write the value to the registers on the oscilloscope on MOSI line. But while reading the value gives me unpredictable values. I have pasted my code as below:

    //Write register

    void ADS1218WriteRegister(int StartAddress, int NumRegs, unsigned * pData)
    {
    uint32_t readDummy, adcTxData[16];
    //pData = adcData;

    // assert CS to start transfer
    ADS1218AssertCS(0);
    int ulLoop;

    //
    // Send the instruction byte and receive a dummy byte to pace the
    // transaction.
    //
    SSIDataPut(SSI2_BASE, ADS1218_CMD_WREG | (StartAddress & 0x0f)); //Write Register(command)
    SSIDataGet(SSI2_BASE, &readDummy);

    // send the command argument
    SSIDataPut(SSI2_BASE, NumRegs-1); //count
    SSIDataGet(SSI2_BASE, &readDummy);

    // pause according to the data sheet
    //delay_us(10);

    // send the data bytes
    //
    // Now send the data to the device.
    //
    for(ulLoop = 0; ulLoop < NumRegs; ulLoop++)
    {
    adcTxData[ulLoop] = (*pData);
    SSIDataPut(SSI2_BASE, (*pData++)); //data bytes
    //SSIDataPut(SSI2_BASE, adcData[ulLoop]); //data bytes
    SSIDataGet(SSI2_BASE, &readDummy);
    }

    ADS1218AssertCS(1); //Chip select high
    }

    //Read registers

    void ADS1218ReadRegister(int StartAddress, int NumRegs, unsigned * pData)
    {
    uint32_t readDummy, adcrxData[16];
    int ulLoop;

    // assert CS to start transfer
    ADS1218AssertCS(0);

    SSIDataPut(SSI2_BASE, ADS1218_CMD_RREG | (StartAddress & 0x0f)); //Read ADC Register(command)
    SSIDataGet(SSI2_BASE, &readDummy);

    // send the command argument
    SSIDataPut(SSI2_BASE, NumRegs-1); //count
    SSIDataGet(SSI2_BASE, &readDummy);

    for(ulLoop = 0 ; ulLoop < NumRegs ; ulLoop++)
    {
    *pData++ = 0;
    adcrxData[ulLoop] = 0;
    }

    // pause according to the data sheet
    //delay_us(10);

    // get the register content
    for (ulLoop=0; ulLoop< NumRegs; ulLoop++)
    {
    SSIDataPut(SSI2_BASE, 0xFF);
    SSIDataGet(SSI2_BASE, pData);
    adcrxData[ulLoop-1] = *pData;
    pData++;
    }

    // de-assert CS
    ADS1218AssertCS(0);
    }

    // In main() function

    main()

    {//main starts

    //
    // Set the clocking to run directly from the external crystal/oscillator.
    // configure clock speed @ 16 MHz
    //
    SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);

    ....

    .....

    //

    // The SSI2 peripheral must be enabled for use.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI2);

    //
    // For this example SSI2 is used with PortB[7:4].
    // GPIO port B needs to be enabled so these pins can be used.
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);

    //
    // Configure the pin muxing for SSI2 functions on port B4, B5, B6, and B7.
    //
    GPIOPinConfigure(GPIO_PB4_SSI2CLK);
    //GPIOPinConfigure(GPIO_PB5_SSI2FSS); // to be configured as GPIO not as SSI function
    GPIOPinConfigure(GPIO_PB6_SSI2RX);
    GPIOPinConfigure(GPIO_PB7_SSI2TX);

    //
    // The SS line is configured as GPIO since the board has 3 devices connected to
    // SSI2 and each uses a separate CS.
    //
    GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE, GPIO_PIN_5);
    GPIOPinTypeGPIOOutput(GPIO_PORTQ_BASE, GPIO_PIN_3);


    ADS1218AssertCS(1); // assert CS high
    M25P40AssertCS(1); // assert CS high

    //
    // Configure the GPIO settings for the SSI pins. This function also gives
    // control of these pins to the SSI hardware. Consult the data sheet to
    // see which functions are allocated per pin.
    // The pins are assigned as follows:
    // PB7 - SSI2Tx
    // PB6 - SSI2Rx
    // PB5 - SSI2Fss(configured as GPIO)
    // PB4 - SSI2CLK
    //
    GPIOPinTypeSSI(GPIO_PORTB_BASE, GPIO_PIN_7 | GPIO_PIN_6 | GPIO_PIN_4);

    SSIConfigSetExpClk(SSI2_BASE, SysCtlClockGet(), SSI_FRF_MOTO_MODE_3,
    SSI_MODE_MASTER, SysCtlClockGet()/8, 8);

    //
    // Enable the SSI2 module.
    //
    SSIEnable(SSI2_BASE);

    ....

    ....

    ads1218_txdata[0] = 0x04; //SETUP - ID ID ID SPEED REFEN REFHI BUFEN BITORDER
    ads1218_txdata[1] = 0X01; //MUX PSEL3 PSEL2 PSEL1 PSEL0 NSEL3 NSEL2 NSEL1 NSEL0
    ads1218_txdata[2] = 0X00; //ACR
    ads1218_txdata[3] = 0X00; //IDAC1
    ads1218_txdata[4] = 0X00; //IDAC2
    ads1218_txdata[5] = 0X00; //ODAC
    ads1218_txdata[6] = 0X00; //DIO
    ads1218_txdata[7] = 0X00; //DIR
    ads1218_txdata[8] = 0X80; //DEC0
    ads1218_txdata[9] = 0X07; //M/DEC1
    ads1218_txdata[10] = 0X00; //OCR0
    ads1218_txdata[11] = 0X00; //OCR1
    ads1218_txdata[12] = 0X00; //OCR2
    ads1218_txdata[13] = 0X24; //FSR0
    ads1218_txdata[14] = 0X90; //FSR1
    ads1218_txdata[15] = 0X67; //FSR2

    ADS1218WriteRegister(ADS1218_SETUP_REGISTER, 0x10, ads1218_txdata);

    for(ulLoop = 0 ; ulLoop < 16 ; ulLoop++)
    {
    ads1218_rxdata[ulLoop] = 0;
    }
    ADS1218ReadRegister(ADS1218_SETUP_REGISTER, 0x10, ads1218_rxdata);

    ....

    ...

    }//end main

    I was suspecting that there must be some timing issue but currently I am stepping through the code using debugger, still not able to read values of register. Can you please point out where I am doing wrong.

    And also can you guide in case I need to do some more initialisation in order to start writing and reading the ADS1218 registers. Please guide as I have been struggling for last 2 days to get it work.

    Quick response will be highly appreciated.

    Regards,

    Mritunjai 

  • In case anyone has working code for ADS1218 SPI interface using peripheral library, kindly provide me the code so that I can test this device thorouglhy.

    Regards,

    Mritunjai 

  • Hi,

     

    I am still not able to read the ADS1218 register, In first look it seems to be timing issue. Has anyone done it before ie. succesfully talking to ADS1218 interfaced through SPI. I need simple code that simply writes to the ADS1218 registers and read back the values of the same with all the timings/delay taken into consideration as per datasheet.

    Anyone from TI guys please help, as I am stuck to this issue for 1 week. You can see my implementation above of this thread.

    Also my delay for microsecond not working, it hangs my code.

    // Delay for given number of microseconds(uS)

    void delay_us(int us) {

        ROM_SysCtlDelay( (ROM_SysCtlClockGet()/(3*1000000))*us ) ; 

    }

     

    delay_us(4);       //this call hangs my code

     

    Regards,

    Mritunjai