Quantcast
Channel: Forums - Recent Threads
Viewing all 262198 articles
Browse latest View live

Linux/PROCESSOR-SDK-AM335X: Linux/PROCESSOR-SDK-AM335X

$
0
0

Part Number:PROCESSOR-SDK-AM335X

Tool/software: Linux

Hi,

Microchip has released a new errata for the KSZ8081MLX - 10Base-T/100Base-TX PHY of devices and below are the change details. Is there any U-boot, Kernel and user space update/support required for AM335x based boards for the errata (latest datasheet : DS00002264B) ?

Description of Change

  1. Register Updates
    1. Updated Register 5h, Bits 4:0 to 0_0000
    2. Updated Register 7h, Bit 15 to Reserved and RO
    3. Updated Register 18h, Bits 5:0 to RO and 00_0001
    4. Updated Register 1Eh, Bit 3 to RO in Table 4-2
  2. Added CMOS Level Inputs values and clarified CMOS Level Outputs section in Table 6-1

CC2640: Easiest way to enable bootloader (i.e. write flash) from my application

$
0
0

Part Number:CC2640

What is the easiest way to write the CCFG area to enable the bootloaderfrom my application?  We need field UART upgrade capability (OAD not an option).

According  the RTOS docs the FlashProgram() function must be executed from SRAM (I understand why so no need to explain).   This would definitely be a pain.

I thought that there were ROM functions (actually there must be for the bootloader to work) to do this but I have not seen an API that will actually perform the write function.  Can you please point me to that doc? 

Does SRWU333 apply to the CC2640 as well as the CC2538?  I dont see that stated anywhere....

Thanks.

THVD1551: Receiver Output Logic

$
0
0

Part Number:THVD1551

Dear Brothers,

My customer using an 20M RS485 with below output logic: When RE is low and if (A – B) ≥ -40mV, RO is high. If (A – B) ≤ - 200mV, RO is low.

I try to promote our THVD1551, but our output logic is not the same as their using right now.

My question is whether we have related products have the same output logic. Or Whether THVD1551 will met some problem to instead what customer using? And any material for me to learning the output logic?

Thanks

EK-TM4C1294XL: Failing at setting up UART

$
0
0

Part Number:EK-TM4C1294XL

Hi, so I am having a problem setting up UART communication. I only want to use UARTprintf. My PWM signal works fine, if i remove configureUART(); and the whole thing works fine if i comment out the  UARTStdioConfig(0, 115200, g_ui32SysClock); I used the timer.c example to try to set this up.

I keep getting #10010 null error and #10234-D null error.

Any help would be appreciated

#include <stdint.h>
#include <stdbool.h>
#include <math.h>
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_gpio.h"
#include "inc/hw_pwm.h"
#include "driverlib/debug.h"
#include "driverlib/fpu.h"
#include "driverlib/gpio.h"
#include "driverlib/pwm.h"
#include "driverlib/interrupt.h"
#include "driverlib/pin_map.h"
#include "driverlib/rom.h"
#include "driverlib/rom_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/timer.h"
#include "driverlib/uart.h"
#include "utils/uartstdio.h"


//variable declaration for clock
uint32_t g_ui32SysClock;


//***********************************************************************************************************************//
// This section contains UART communication dependencies - this is used as a check for the code written but will most    //
// be commented out of the final code - it is going to remain as a comment and not deleted to allow editor of program to //
// utilize UART to provide checks of values and functions                                                                //
//***********************************************************************************************************************//

void
configureUART(void)
{
    //
    // Enable GPIO and UART 0
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);

    //
    // Configure UART Pins for UART MODE
    //
    ROM_GPIOPinConfigure(GPIO_PA0_U0RX);
    ROM_GPIOPinConfigure(GPIO_PA1_U0TX);
    ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);


    //UARTClockSourceSet(UART0_BASE, UART_CLOCK_SYSTEM);


    //
    // Initialize the UART for console I/O.
    //
    UARTStdioConfig(0, 115200, g_ui32SysClock);
}

//***********************************************************************************************************************//
// This section contains the PWM function needed create the PWM function                                                 //
// Note: Any changes to the SysCtlPWMClockSet(SYSCTL_PWMDIV_1); will require changes in the above math section!!!!!!!!!  //
//***********************************************************************************************************************//
void
configurePWM(void)
{

    uint32_t Ticks;
    Ticks = Number_Ticks_Freq();
    //
    // Enable the GPIO Peripheral used by PWM (PF0, and eventually PF1)
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);

    //
    // Enable PWM0
    //
    SysCtlPeripheralEnable(SYSCTL_PERIPH_PWM0);

    //
    //Dividing the clock for PWM use - Will use one for now
    //
    SysCtlPWMClockSet(SYSCTL_PWMDIV_1);

    //
    //Unlocking the pins
    //
    HWREG(GPIO_PORTF_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
    HWREG(GPIO_PORTF_BASE + GPIO_O_CR) = 0x01;

    //
    // Configure GPIO pin for PWM
    //
    GPIOPinConfigure(GPIO_PF0_M0PWM0);
    GPIOPinConfigure(GPIO_PF1_M0PWM1);

    GPIOPinTypePWM(GPIO_PORTF_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    //
    // Configure PWM
    //
    PWMGenConfigure(PWM0_BASE, PWM_GEN_0, PWM_GEN_MODE_DOWN | PWM_GEN_MODE_NO_SYNC);

    //
    //Setting PWM Period
    //
    PWMGenPeriodSet(PWM0_BASE, PWM_GEN_0, ceil(Ticks));

    //
    //Setting duty cycle
    //
    PWMPulseWidthSet(PWM0_BASE, PWM_OUT_0 , ceil(Ticks/2));
    PWMPulseWidthSet(PWM0_BASE, PWM_OUT_1 , ceil(Ticks/2));

    //
    // Enable PWM
    //
    PWMGenEnable(PWM0_BASE, PWM_GEN_0);
    PWMOutputInvert(PWM0_BASE, PWM_OUT_1_BIT, true);
    PWMOutputState(PWM0_BASE, PWM_OUT_0_BIT | PWM_OUT_1_BIT, true);

}

int
main(void)
{
    g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
                                                 SYSCTL_OSC_MAIN |
                                                 SYSCTL_USE_PLL |
                                                 SYSCTL_CFG_VCO_480), 120000000);


    configurePWM();
    configureUART();

    while(1)
    {
        UARTprintf("UART is successful\n");
    }
}

OPA551: Buffer application

$
0
0

Part Number:OPA551

Some more questions about the amplifier OPA551:

The data sheet says that pins 1 and 5 should not be connected to negative supply. But the layout for both PDIP and SOIC shows connection between pins 1-4-5. How much of a factor can this be with my performance issue?

Also if I intent to use the OPA551 as a voltage follower, I plan to connect the output directly to the inverting input in my non inverting configuration. How practical do you think this technique will be?

CC3200MODLAUNCHXL: SPI and DMA

$
0
0

Part Number:CC3200MODLAUNCHXL

Hello -

I am trying to get an SPI using DMA working and I am having trouble with it.

Here is the code:

//*****************************************************************************
// main.c
//
// The demo application focuses on showing the required initialization
// sequence to enable the CC3200 SPI module in full duplex 4-wire master
// and slave mode(s).
//
// Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/
//
//
//  Redistribution and use in source and binary forms, with or without
//  modification, are permitted provided that the following conditions
//  are met:
//
//    Redistributions of source code must retain the above copyright
//    notice, this list of conditions and the following disclaimer.
//
//    Redistributions in binary form must reproduce the above copyright
//    notice, this list of conditions and the following disclaimer in the
//    documentation and/or other materials provided with the
//    distribution.
//
//    Neither the name of Texas Instruments Incorporated nor the names of
//    its contributors may be used to endorse or promote products derived
//    from this software without specific prior written permission.
//
//  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
//  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
//  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
//  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
//  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
//  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
//  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
//  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
//  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
//  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//*****************************************************************************

#include <string.h>
#include "hw_types.h"
#include "hw_memmap.h"
#include "hw_common_reg.h"
#include "hw_mcspi.h"
#include "hw_ints.h"
#include "spi.h"
#include "pin.h"
#include "rom.h"
#include "rom_map.h"
#include "utils.h"
#include "prcm.h"
#include "interrupt.h"
#include "pinmux.h"
#include "uart.h"
#include "udma.h"
#include "uart_if.h"
#include "udma_if.h"


//*****************************************************************************
//
// Application Master/Slave mode selector macro
//
// MASTER_MODE = 1 : Application in master mode
// MASTER_MODE = 0 : Application in slave mode
//
//*****************************************************************************
#define MASTER_MODE      0


#define SPI_IF_BIT_RATE  100000
#define TR_BUFF_SIZE     20

#define MASTER_MSG "This is CC3200 SPI Master Application\n\r"
#define SLAVE_MSG "This is CC3200 SPI Slave Application\n\r"

//*****************************************************************************
// Global variables
//*****************************************************************************
static unsigned char g_ucTxBuff[TR_BUFF_SIZE];
static unsigned char g_ucRxBuff[TR_BUFF_SIZE];
static unsigned char ucTxBuffNdx;
static unsigned char ucRxBuffNdx;

#if defined(ccs)
extern void (* const g_pfnVectors[])(void);
#endif

#if defined(ewarm)
extern uVectorEntry __vector_table;
#endif

//*****************************************************************************
//
//! SPI Slave Interrupt handler
//!
//! This function is invoked when SPI slave has its receive register full or
//! transmit register empty.
//!
//! \return None.
//
//*****************************************************************************
static void SlaveIntHandler()
{
  unsigned long ulRecvData;
  unsigned long ulStatus;

  ulStatus = MAP_SPIIntStatus(GSPI_BASE,true);

  MAP_SPIIntClear(GSPI_BASE,SPI_INT_DMARX|SPI_INT_DMATX);

#if 1
  if(ulStatus & SPI_INT_TX_EMPTY)
  {
    MAP_SPIDataPut(GSPI_BASE,g_ucTxBuff[ucTxBuffNdx%TR_BUFF_SIZE]);
    ucTxBuffNdx++;
  }

  if(ulStatus & SPI_INT_RX_FULL)
  {
    MAP_SPIDataGetNonBlocking(GSPI_BASE,&ulRecvData);
    g_ucTxBuff[ucRxBuffNdx%TR_BUFF_SIZE] = ulRecvData;
    Report("%c",ulRecvData);
    ucRxBuffNdx++;
  }
#endif
}

//*****************************************************************************
//
//! SPI Master mode main loop
//!
//! This function configures SPI modelue as master and enables the channel for
//! communication
//!
//! \return None.
//
//*****************************************************************************
void MasterMain()
{

  unsigned long ulUserData;
  unsigned long ulDummy;

  //
  // Initialize the message
  //
  memcpy(g_ucTxBuff,MASTER_MSG,sizeof(MASTER_MSG));

  //
  // Set Tx buffer index
  //
  ucTxBuffNdx = 0;
  ucRxBuffNdx = 0;

  //
  // Reset SPI
  //
  MAP_SPIReset(GSPI_BASE);

  //
  // Configure SPI interface
  //
  MAP_SPIConfigSetExpClk(GSPI_BASE,MAP_PRCMPeripheralClockGet(PRCM_GSPI),
                     SPI_IF_BIT_RATE,SPI_MODE_MASTER,SPI_SUB_MODE_0,
                     (SPI_SW_CTRL_CS |
                     SPI_4PIN_MODE |
                     SPI_TURBO_OFF |
                     SPI_CS_ACTIVEHIGH |
                     SPI_WL_8));

  //
  // Enable SPI for communication
  //
  MAP_SPIEnable(GSPI_BASE);

  //
  // Print mode on uart
  //
  Message("Enabled SPI Interface in Master Mode\n\r");

  //
  // User input
  //
  Report("Press any key to transmit data....");

  //
  // Read a character from UART terminal
  //
  ulUserData = MAP_UARTCharGet(UARTA0_BASE);


  //
  // Send the string to slave. Chip Select(CS) needs to be
  // asserted at start of transfer and deasserted at the end.
  //
  MAP_SPITransfer(GSPI_BASE,g_ucTxBuff,g_ucRxBuff,50,
            SPI_CS_ENABLE|SPI_CS_DISABLE);

  //
  // Report to the user
  //
  Report("\n\rSend      %s",g_ucTxBuff);
  Report("Received  %s",g_ucRxBuff);

  //
  // Print a message
  //
  Report("\n\rType here (Press enter to exit) :");

  //
  // Initialize variable
  //
  ulUserData = 0;

  //
  // Enable Chip select
  //
  MAP_SPICSEnable(GSPI_BASE);

  //
  // Loop until user "Enter Key" is
  // pressed
  //
  while(ulUserData != '\r')
  {
    //
    // Read a character from UART terminal
    //
    ulUserData = MAP_UARTCharGet(UARTA0_BASE);

    //
    // Echo it back
    //
    MAP_UARTCharPut(UARTA0_BASE,ulUserData);

    //
    // Push the character over SPI
    //
    MAP_SPIDataPut(GSPI_BASE,ulUserData);

    //
    // Clean up the receive register into a dummy
    // variable
    //
    MAP_SPIDataGet(GSPI_BASE,&ulDummy);
  }

  //
  // Disable chip select
  //
  MAP_SPICSDisable(GSPI_BASE);
}

//*****************************************************************************
//
//! SPI Slave mode main loop
//!
//! This function configures SPI modelue as slave and enables the channel for
//! communication
//!
//! \return None.
//
//*****************************************************************************
void SlaveMain()
{
  unsigned long ulNdx;

  //
  // Initialize the message
  //
  for(ulNdx=0; ulNdx < TR_BUFF_SIZE; ulNdx++)
  {
    g_ucTxBuff[ulNdx] = ulNdx;
  }

  //
  // Set Tx buffer index
  //
  ucTxBuffNdx = 0;
  ucRxBuffNdx = 0;

  //
  // Reset SPI
  //
  MAP_SPIReset(GSPI_BASE);

  //
  // Initialize UDMA
  //
  UDMAInit();

  //
  // Configure SPI interface
  //
  MAP_SPIConfigSetExpClk(GSPI_BASE,MAP_PRCMPeripheralClockGet(PRCM_GSPI),
                     SPI_IF_BIT_RATE,SPI_MODE_SLAVE,SPI_SUB_MODE_0,
                     (SPI_HW_CTRL_CS |
                     SPI_4PIN_MODE |
                     SPI_TURBO_OFF |
                     SPI_CS_ACTIVELOW |
                     SPI_WL_8));

  //
  // Register Interrupt Handler
  //
  MAP_SPIIntRegister(GSPI_BASE,SlaveIntHandler);

  UDMASetupTransfer(UDMA_CH30_GSPI_RX,UDMA_MODE_BASIC,TR_BUFF_SIZE,
                UDMA_SIZE_8,UDMA_ARB_1,
                (void *)(GSPI_BASE + MCSPI_O_RX0),UDMA_SRC_INC_NONE,
                &g_ucRxBuff,UDMA_DST_INC_8);

  UDMASetupTransfer(UDMA_CH31_GSPI_TX,UDMA_MODE_BASIC,TR_BUFF_SIZE,
                UDMA_SIZE_8,UDMA_ARB_1,
                &g_ucTxBuff,UDMA_SRC_INC_8,(void *)(GSPI_BASE + MCSPI_O_TX0),
                UDMA_DST_INC_NONE);

#if 1
  SPIWordCountSet(GSPI_BASE,TR_BUFF_SIZE);

  SPIFIFOLevelSet(GSPI_BASE,1,1);


  SPIFIFOEnable(GSPI_BASE, SPI_RX_FIFO|SPI_TX_FIFO);
#endif

  SPIDmaEnable(GSPI_BASE,SPI_RX_DMA|SPI_TX_DMA);


  //
  // Enable Interrupts
  //
  MAP_SPIIntEnable(GSPI_BASE,SPI_INT_DMATX|SPI_INT_DMARX);

  //
  // Enable SPI for communication
  //
  MAP_SPIEnable(GSPI_BASE);

  //
  // Print mode on uart
  //
  Message("Enabled SPI Interface in Slave Mode\n\rReceived : ");
}

//*****************************************************************************
//
//! Board Initialization & Configuration
//!
//! \param  None
//!
//! \return None
//
//*****************************************************************************
static void
BoardInit(void)
{
/* In case of TI-RTOS vector table is initialize by OS itself */
#ifndef USE_TIRTOS
  //
  // Set vector table base
  //
#if defined(ccs)
    MAP_IntVTableBaseSet((unsigned long)&g_pfnVectors[0]);
#endif
#if defined(ewarm)
    MAP_IntVTableBaseSet((unsigned long)&__vector_table);
#endif
#endif
  //
  // Enable Processor
  //
  MAP_IntMasterEnable();
  MAP_IntEnable(FAULT_SYSTICK);

  PRCMCC3200MCUInit();
}

//*****************************************************************************
//
//! Main function for spi demo application
//!
//! \param none
//!
//! \return None.
//
//*****************************************************************************
void main()
{

  //
  // Initialize Board configurations
  //
  BoardInit();

  //
  // Muxing UART and SPI lines.
  //
  PinMuxConfig();

  //
  // Enable the SPI module clock
  //
  MAP_PRCMPeripheralClkEnable(PRCM_GSPI,PRCM_RUN_MODE_CLK);

  //
  // Initialising the Terminal.
  //
  InitTerm();

  //
  // Clearing the Terminal.
  //
  ClearTerm();

  //
  // Display the Banner
  //
  Message("\n\n\n\r");
  Message("\t\t   ********************************************\n\r");
  Message("\t\t        CC3200 SPI Demo Application  \n\r");
  Message("\t\t   ********************************************\n\r");
  Message("\n\n\n\r");

  //
  // Reset the peripheral
  //
  MAP_PRCMPeripheralReset(PRCM_GSPI);

#if MASTER_MODE

  MasterMain();

#else

  SlaveMain();

#endif

  while(1)
  {

  }

}

For some reason, I am unable to see anything on the receive side.  When I type on the master terminal, it should be showing up on the slave terminal but it is not.

Any help would be great.  

Thanks

CCS/CC3200: I2C demo with EEPROM is not working

$
0
0

Part Number:CC3200

Tool/software: Code Composer Studio

I am interfacing CC3200 with below EEPROM (AT24C) . It is obvious that I2C demo should work fine for any I2C device  by just putting correct device id  (Here for me Device id is 0x50) in example code.

Below are  my observation/ problems

1, If i am writing  in EEPROM by either write cmd or write reg cmd in tera term   result is  I2C write complete. 

2. Now after writing if i am reading by either read or read reg command in tera team  always i get 0XFF.

3. If i read full 255 location of EEPROM  result are 0Xff always.

4. It seems that i am not able to write anything in EEPROM. So i tried to 7 bit addressing by replacing device id 0x50 to 0x51 for write operation but its result says ERROR IN PROCESSING CMD.  WP pin of EEPROM is grounded .

5. I am using 3.3volt pullup for SDA and SCL line . I got from data sheet for FST mode 400kbps speed  VCC should be 5 volt hence i have replaced fast mode to std mode in the code.

I struggled alot can anybody  tell me what is the problem in writing I2C EEPROM ??

screen shot are 

 

CCS/TMS320F2808: Unexpected code execution

$
0
0

Part Number:TMS320F2808

Tool/software: Code Composer Studio

Hi,

I am using CCS V7.4 and a Digital Spectrum XDS200 debug probe.

I have successfully created a CCS project which loads and stops at main() as expected.

My test code simply increments an int variable in a do {} while(1) loop which never returns from main().

I am able to single-step (F5) the code and see the variable increment as expected.

The problem is that when I run the code and then stop again I am no longer in the main() function and find that the program counter (PC) is now running code in the range 0x66 to 0x6A continually in a loop.

This is a standard CCS project which has had no changes made to it in any way other than to add a small piece of code to the main() function.

Why is the PC leaving the main() function and what is it executing in the new address range?

Any help would be appreciated.

Regards

FarmerJo


BQ40Z50-R1: Fault Interrupt

$
0
0

Part Number:BQ40Z50-R1

Hello Team,

Besides the BTP_INT pin, is there any way to map out a fault interrupt signal from bq40z50-r1 to the host for other faults besides the low battery trip point? Can BTP_INT be mapped to trigger any other faults besides that low battery point?

If not, what is the typical method for the host to interface with the pack manager? Is the host expected to continuously poll the status registers to find fault indications?

Thanks,

Casey 

Linux/DAC38J82: Can dac38j82 work in subclass 0?

$
0
0

Part Number:DAC38J82

Tool/software: Linux

Hello. I have difficult with datasheet for dac38j82

1. I can't find information about subclass 0.

Can dac38j82 work in subclass 0?

2. Which of the four output channels should I use in the two-channel model dac38j82?

CC2640R2F: Few Question on AoA/AoD solution

$
0
0

Part Number:CC2640R2F

Hello,

Do we have any information on AoA/AoD/location? . It appears evaluation hardware is available for the chip. However, is there anything special needed besides antennas to enable the AoA/AoD functionality? If we need to purchase it, what exactly do we need to purchase?  What software tools are available for controlling the equipment, and how do we go about getting those?

Regards,

David

EK-TM4C1294XL: ADS7142 Manual Mode with AUTO Sequencing

$
0
0

Part Number:EK-TM4C1294XL

Hello,  

I have attached the TM4C1294NCPDT datasheet for reference into the following issue as well as the ADS7142 datasheet.  The following code should place the ADS7142 in Manual Mode scanning CH0 only.  However, stepping through the code in Code Composer Studio is showing that the master MCU is losing i2c bus arbitration for whatever reason.  This error does not seem to make sense in a single-master system but it is the error since my error check routine in the code is where the debugger is getting stuck.  

On pages 1291-1293 are the Master Tx/Rx software flow charts I have used to develop the three functions I call in main.  The code is getting stuck inside the first call of ADS7142SingleRegisterWrite(). 

Any insight as to this problem is appreciated, thanks

(Please visit the site to view this file)(Please visit the site to view this file)

//*****************************************************************************
//
// ADS7142_ManualMode_CH0Scan.c - Example demonstrating a simple I2C
// transmission and reception.
//
// Copyright (c) 2010-2016 Texas Instruments Incorporated. All rights reserved.
// Software License Agreement
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the
// distribution.
//
// Neither the name of Texas Instruments Incorporated nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// This is part of revision 2.1.3.156 of the Tiva Firmware Development Package.
//
//*****************************************************************************

#include <stdbool.h>
#include <stdint.h>
#include "inc/hw_i2c.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/gpio.h"
#include "driverlib/i2c.h"
#include "driverlib/i2c.c"
#include "driverlib/pin_map.h"
#include "driverlib/sysctl.h"
#include "driverlib/uart.h"
#include "utils/uartstdio.h"
#include "ADS7142registermap.h"


//*****************************************************************************
//
//! \addtogroup i2c_examples_list
//!
//!
//! This example shows how to configure the I2C8 module for connection/communication
//! with the ADS7142 Boosterpack.
//! This includes setting up the master and slave module. Loopback mode
//! internally connects the master and slave data and clock lines together. This example
//! does not use loopback mode is communication is being performed with an external device
//! to the TM4C1294NCPDT microcontroller.
//! The address of the slave module is set in order to read data from the
//! master. Then the data is checked to make sure the received data matches
//! the data that was transmitted. This example uses a polling method for
//! sending and receiving data.
//!
//! This example uses the following peripherals and I/O signals. You must
//! review these and change as needed for your own board:
//! - I2C8 peripheral
//! - GPIO Port A peripheral (for I2C8 pins)
//! - I2C8SCL - PA2
//! - I2C8SDA - PA3
//!
//! This example uses the following interrupt handlers. To use this example
//! in your own application you must add these interrupt handlers to your
//! vector table.
//! - None.
//
//*****************************************************************************


//*****************************************************************************
//
// Set the address for slave module. This is a 7-bit address sent in the
// following format:
// [A6:A5:A4:A3:A2:A1:A0:RS]
//
// A zero in the "RS" position of the first byte means that the master
// transmits (sends) data to the selected slave, and a one in this position
// means that the master receives data from the slave. The slave address of
// the ADS7142 in this example is set by hardware on the ADS7142boostxl
//
//*****************************************************************************
#define SLAVE_ADDRESS 0x18

void
ADS7142SingleRegisterWrite (uint8_t RegisterAddress, uint8_t RegisterData)
{
//ADS7142 Single Register Write

//
// Tell the master module what address it will place on the bus when
// communicating with the slave. Set the address to SLAVE_ADDRESS
// (as set in the slave module). The receive parameter is set to false
// which indicates the I2C Master is initiating a writes to the slave. If
// true, that would indicate that the I2C Master is initiating reads from
// the slave.
//

I2CMasterSlaveAddrSet(I2C8_BASE, SLAVE_ADDRESS, false);

//Place the first byte to be transmitted into the I2CMDR Register of the TM4C1294
//The first byte to be transmitted following the SLAVE Address is the Single Register Write opcode
I2CMasterDataPut(I2C8_BASE, SINGLE_WRITE);

//Check the I2C Bus to ensure it is not busy
while(I2CMasterBusBusy(I2C8_BASE))

{
//Read I2CMCS
}

//I2C Master Command for the Start of BURST Send of 3 bytes
I2CMasterControl(I2C8_BASE, I2C_MASTER_CMD_BURST_SEND_START);

//Implement delay
SysCtlDelay(100);

//Wait for the I2CMaster to finish transmitting before moving to next byte
while(I2CMasterBusy(I2C8_BASE))

{
//Read I2CMCS
}

//Check for errors in the I2C8 Module
while (I2CMasterErr(I2C8_BASE) != I2C_MASTER_ERR_NONE)

//Error branching
{

//Check for Arbitrary Lost error condition
if(I2CMasterErr(I2C8_BASE) == I2C_MASTER_ERR_ARB_LOST)

{
//Error service
}

//Write I2C Master Command for receive error stop
else if (I2CMasterErr(I2C8_BASE) != I2C_MASTER_ERR_ARB_LOST)

{

I2CMasterControl(I2C8_BASE, I2C_MASTER_CMD_BURST_RECEIVE_ERROR_STOP);

//Implement Delay
SysCtlDelay(100);

{
//Error service
}

}
}

//Place the next byte into I2CMDR, the register address of desired data write
I2CMasterDataPut(I2C8_BASE, RegisterAddress);

//I2C Master Command for continued BURST send of the next byte
I2CMasterControl(I2C8_BASE, I2C_MASTER_CMD_BURST_SEND_CONT);

//Implement Delay
SysCtlDelay(100);

//Wait for the I2CMaster to finish transmitting before moving to next byte
while(I2CMasterBusy(I2C8_BASE))

{
//Read I2CMCS
}

//Check for errors in the I2C8 Module
while (I2CMasterErr(I2C8_BASE))

//Error branching
{


//Check for Arbitrary Lost error condition
if(I2CMasterErr(I2C8_BASE) == I2C_MASTER_ERR_ARB_LOST)

{
//Error service
}

//Write I2C Master Command for receive error stop
else if (I2CMasterErr(I2C8_BASE) != I2C_MASTER_ERR_ARB_LOST)
{

I2CMasterControl(I2C8_BASE, I2C_MASTER_CMD_BURST_RECEIVE_ERROR_STOP);

//Implement Delay
SysCtlDelay(100);

{
//Error service
}

}
}


//Place the final byte into I2CMDR, the register data to be placed in the desired register address
I2CMasterDataPut(I2C8_BASE, RegisterData);

//I2C Master Command for the finished BURST send of the data
I2CMasterControl(I2C8_BASE, I2C_MASTER_CMD_BURST_SEND_FINISH);

//Implement delay
SysCtlDelay(100);

//Wait for the I2C Master to finish transmitting
while(I2CMasterBusy(I2C8_BASE))

{
//Read I2CMCS
}

//Check the error flag in the I2C8 Module
while (I2CMasterErr(I2C8_BASE))

{
//Error service
}

}

void
ADS7142SingleRegisterRead(uint8_t RegisterAddress)
{
//ADS7142 Single Register Read
//
// Tell the master module what address it will place on the bus when
// communicating with the slave. Set the address to SLAVE_ADDRESS
// (as set in the slave module). The receive parameter is set to false
// which indicates the I2C Master is initiating a writes to the slave.
// To perform a register read, the Master must first transmit the desired SLAVE address for communication.
// Following the Slave address, the single register read opcode will be transmitted.
// If true, that would indicate that the I2C Master is initiating reads from
// the slave.
//
//
I2CMasterSlaveAddrSet(I2C8_BASE, SLAVE_ADDRESS, false);

//Place the Single Register Read opcode into the I2CMDR Register
I2CMasterDataPut(I2C8_BASE, SINGLE_READ);

//Check the I2C Bus to ensure it is not busy
while(I2CMasterBusBusy(I2C8_BASE))

{
//Read I2CMCS
}

//Initiate the BURST Send of two data bytes
I2CMasterControl(I2C8_BASE, I2C_MASTER_CMD_BURST_SEND_START);

//Implement Delay
SysCtlDelay(100);

//Wait for the I2C Master to finish transmitting
while(I2CMasterBusy(I2C8_BASE))

{
//Read I2CMCS
}

//Check for errors in the I2C8 Module
while (I2CMasterErr(I2C8_BASE))

//Error branching
{

//Check for Arbitrary Lost error condition
if(I2CMasterErr(I2C8_BASE) == I2C_MASTER_ERR_ARB_LOST)

{
//Error service
}

//Write I2C Master Command for receive error stop
else if (I2CMasterErr(I2C8_BASE) != I2C_MASTER_ERR_ARB_LOST)
{

I2CMasterControl(I2C8_BASE, I2C_MASTER_CMD_BURST_RECEIVE_ERROR_STOP);

//Implement Delay
SysCtlDelay(100);

{
//Error service
}

}

}

//Place the Register Address to be communicated with into the I2CMDR Register
I2CMasterDataPut(I2C8_BASE,RegisterAddress);

//I2C Master Command for finished Burst Send of the two bytes required for register read
I2CMasterControl(I2C8_BASE, I2C_MASTER_CMD_BURST_SEND_FINISH);

//Implement Delay
SysCtlDelay(100);

//Wait for the I2C Master to finish transmitting the data
while(I2CMasterBusy(I2C8_BASE))

{
//Read I2CMCS
}

//Check the error flag in the I2C8 Module
while(I2CMasterErr(I2C8_BASE))

{
//Error service
}

//Set the receive parameter to true in order to receive data from the desired register address
I2CMasterSlaveAddrSet(I2C8_BASE, SLAVE_ADDRESS, true);

//Check the I2C Bus to ensure it is not busy
while(I2CMasterBusBusy(I2C8_BASE))

{
//Read I2CMCS
}

//I2C Master Command for the Single Byte Receive from the register address
I2CMasterControl(I2C8_BASE, I2C_MASTER_CMD_SINGLE_RECEIVE);

//Implement Delay
SysCtlDelay(100);

//Wait for the I2C Master to finish transmitting the data
while(I2CMasterBusy(I2C8_BASE))

{
//Read I2CMCS
}

//Check the error flag in the I2C8 Module
while(I2CMasterErr(I2C8_BASE))

{
//Error service
}

//Get the data placed into the I2CMDR Register from the ADS7142
I2CMasterDataGet(I2C8_BASE);
}

void
StartSampling()
{
//Provide Device Address and Read Bit to Start Conversions
I2CMasterSlaveAddrSet(I2C8_BASE, SLAVE_ADDRESS, true);

//Check the I2C Bus to ensure it is not busy
while(I2CMasterBusBusy(I2C8_BASE))

{
//Read I2CMCS
}

//Write the Burst receive I2C Master Command to I2CMCS
I2CMasterControl(I2C8_BASE, I2C_MASTER_CMD_BURST_RECEIVE_START);

//Implement Delay
SysCtlDelay(100);

{
//Read I2CMCS
}

//Allow the Master to finish receiving the first byte
while(I2CMasterBusy(I2C8_BASE))

{
//Read I2CMCS
}

//Check for errors in the I2C8 Module
while (I2CMasterErr(I2C8_BASE))

//Error branching
{

//Check for Master Arbitration Lost error condition
if(I2CMasterErr(I2C8_BASE) == I2C_MASTER_ERR_ARB_LOST)

{
//Error service
}

//Write I2C Master Command for receive error stop
else if (I2CMasterErr(I2C8_BASE) != I2C_MASTER_ERR_ARB_LOST)
{

I2CMasterControl(I2C8_BASE, I2C_MASTER_CMD_BURST_RECEIVE_ERROR_STOP);

//Implement Delay
SysCtlDelay(100);

{
//Error service
}

}

}

//Read data from I2CMDR
I2CMasterDataGet(I2C8_BASE);

while(1)
{

//Continue receiving the burst data
I2CMasterControl(I2C8_BASE, I2C_MASTER_CMD_BURST_RECEIVE_CONT);

//Implement Delay
SysCtlDelay(100);

{
//Read I2CMCS
}

//Allow the Master to finish receiving each byte
while(I2CMasterBusy(I2C8_BASE))

{
//Read I2CMCS
}

//Check for errors in the I2C8 Module
while (I2CMasterErr(I2C8_BASE) != I2C_MASTER_ERR_NONE)

//Error branching
{

//Check for Arbitrary Lost error condition
if(I2CMasterErr(I2C8_BASE) == I2C_MASTER_ERR_ARB_LOST)

{
//Error service
}

//Write I2C Master Command for receive error stop
else if (I2CMasterErr(I2C8_BASE) != I2C_MASTER_ERR_ARB_LOST)
{

I2CMasterControl(I2C8_BASE, I2C_MASTER_CMD_BURST_RECEIVE_ERROR_STOP);

//Implement Delay
SysCtlDelay(100);

{
//Error service
}

}

}

}
}
//*****************************************************************************
//
// Configure the I2C8 master and slave and connect them to the ADS7142 Boosterpack
//
//*****************************************************************************
int
main(void)
{
#if defined(TARGET_IS_TM4C129_RA0) || \
defined(TARGET_IS_TM4C129_RA1) || \
defined(TARGET_IS_TM4C129_RA2)
uint32_t ui32SysClock;
#endif

//
// Set the clocking to run directly from the external crystal/oscillator.
// TODO: The SYSCTL_XTAL_ value must be changed to match the value of the
// crystal on your board.
//
#if defined(TARGET_IS_TM4C129_RA0) || \
defined(TARGET_IS_TM4C129_RA1) || \
defined(TARGET_IS_TM4C129_RA2)
ui32SysClock = SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
SYSCTL_OSC_MAIN |
SYSCTL_USE_OSC), 25000000);
#else
SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
SYSCTL_XTAL_16MHZ);
#endif

//
// The I2C8 peripheral must be enabled before use.
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_I2C8);

//
// For this example I2C8 is used with PortA[3:2]. The actual port and
// pins used may be different on your part, consult the data sheet for
// more information. GPIO port A needs to be enabled so these pins can
// be used.
// TODO: change this to whichever GPIO port you are using.
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

//
// Configure the pin muxing for I2C8 functions on port A2 and A3.
// This step is not necessary if your part does not support pin muxing.
// TODO: change this to select the port/pin you are using.
//
GPIOPinConfigure(GPIO_PA2_I2C8SCL);
GPIOPinConfigure(GPIO_PA3_I2C8SDA);

//
// Select the I2C function for these pins. This function will also
// configure the GPIO pins pins for I2C operation, setting them to
// open-drain operation with weak pull-ups. Consult the data sheet
// to see which functions are allocated per pin.
// TODO: change this to select the port/pin you are using.
//
GPIOPinTypeI2CSCL(GPIO_PORTA_BASE, GPIO_PIN_2);
GPIOPinTypeI2C(GPIO_PORTA_BASE, GPIO_PIN_3);

//
//Enable master interrupts. This function will enable all interrupts
//available to the I2C Master.
// I2CMasterIntEnable(I2C8_BASE);
// I2CSlaveIntEnable(I2C8_BASE);

#if defined(TARGET_IS_TM4C129_RA0) || \
defined(TARGET_IS_TM4C129_RA1) || \
defined(TARGET_IS_TM4C129_RA2)
I2CMasterInitExpClk(I2C8_BASE, ui32SysClock, false);
#else
I2CMasterInitExpClk(I2C8_BASE, SysCtlClockGet(), false);
#endif


//Let's put the device into Manual Mode with a Single Channel Single-Ended Configuration
//for conversion of data

//Select the channel input configurations
ADS7142SingleRegisterWrite(ADS7142_REG_CHANNEL_INPUT_CFG, ADS7142_VAL_CHANNEL_INPUT_CFG_1_CHANNEL_SINGLE_ENDED);

//Confirm the input channel configuration
ADS7142SingleRegisterRead(ADS7142_REG_CHANNEL_INPUT_CFG);

//Select the operation mode of the device
ADS7142SingleRegisterWrite(ADS7142_REG_OPMODE_SEL, ADS7142_VAL_OPMODE_SEL_I2C_CMD_MODE_W_CHANNEL_0);

//Confirm the operation mode selection
ADS7142SingleRegisterRead(ADS7142_REG_OPMODE_SEL);

//Begin manual mode operation
//Start Scanning Ch0
StartSampling();

return(0);

}

AWR1443BOOST: demoVisualizer, cfarCfg' is not recognized as a CLI command

$
0
0

Part Number:AWR1443BOOST

Hi everyone,

I have trouble running the TI demovisualizer for my awr1443 boost. I keep getting "cfarCfg' is not recognized as a CLI command" message in the console output, and nothing is plotted in the plots tab. 

Thanks in advance for your help.

zheng

BQ2980EVM-883: Request for EVM Gerber Files

$
0
0

Part Number:BQ2980EVM-883

Hello,

I want to test the BQ2980 IC, to certain whether it satisfies our design requirements.

We are short of time and not in a position to wait for the BQ2980EVM to be shipped to India.

In this regard, is it possible to get a gerber files of  the BQ2980EVM?

Kindly update us in the regard at the earliest.

regards

Swaroop

BQ2980EVM-883: How to change OCC and OCD setting?

$
0
0

Part Number:BQ2980EVM-883

Hello,

In the BQ2980EVM, the OCC and OCD is factory set at -8A and +8A respectively.

My question is;

Q1. How to change the OCC and OCD setting to 6A?

regards

Swaroop


BQ2980: Fixed or variable VDD?

$
0
0

Part Number:BQ2980

Hello,

In the data sheet of bq2980 the supply voltage VDD range is mentioned as MIN=1.5V to MAX=5.5V.

Q1. As VDD is obtained from the cell, does the varying voltage of the cell have any impact on the performance of the IC bq2980?

Regards

Swaroop

TMS320F28075: Arbitration Scheme on Local Shared Memories

$
0
0

Part Number:TMS320F28075

Hello everyone,

I would like to understand the consequences of the arbitration scheme on LSRAM described in Figure 2-15 of the TMS320F2807x Technical Reference Manual.

Let's assume the CLA tries to read an address at the exact same cycle the CPU writes to that address. Does the existence of round-robin arbitration imply that, depending on the previous round-robin state, the CLA Read might be stalled for one cycle waiting for the CPU Write to go through?

Regards,

Pierre

PGA411-Q1: The power supply design guide

$
0
0

Part Number:PGA411-Q1

Hi, 

I am trying to use the PGA411-Q1 chip for my resolver sensing application. I want to make sure if I understood the power supply requirements correctly. 

I am trying to run this chip at 7 Vrms mode.

So the connections will be :

VCCSW (pin 4) is connected to external 5 V. Populate boost components (Inductor and Diode). VSW (pin 6)  tied between this inductor and diode and connects to VEXT (pin 24) ? 

Will the chip supply 15 V (voltage value adjustable through software)  to V EXT is through internal boost supply or VEXT requires an external 15 V supply? And VEXTS tied to VEXT outside the chip?

 Please let me know if this ^ is correct.

Thanks,

AM3358: Ethernet Switch Subsystem security concern

$
0
0

Part Number:AM3358

Hi All,

Our design might possibly use an AM3358 which has an Ethernet Switch Subsystem with two external ports. One of the external ports (port 1) we would use for communicating with another processor. But, the other (unused) external port (port 2) could be used by a malicious entity to sniff the communications on that network.

Is there a way to configure the Ethernet Switch Subsystem to effectively block port 2 from any network traffic? What other network security provisions does this system provide for?

Is there a different TI processor that might be more suitable for the design description provided above?

Best regards and thanks in advance!

BQ24650: Solar PV and protection on the panel side

$
0
0

Part Number:BQ24650

Hello,

This is the set-up I am planning, to charger my 10000mAh Li-ion 1s5p 18650 cell battery pack;

I have opted for BQ24650 as my solar charger for Li-ion battery pack. I have selected BQ2980 for protection of the battery pack. And TPS61089 will give an output of Vout=5V @Iload=2A.

I have few questions regarding the above;

Q1. What is meaning of "Solar Cell Half Panel" as mentioned at point VIN in the Figure 15 of the datasheet of bq24650?

Q2. What all protection I need to provide on the solar panel side to any damage to bq24650?

regards

Swaroop

Viewing all 262198 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>