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

MSP4305529 float conversion

$
0
0

I am using the MSP4305529's  12 bit ADC to acquire voltage readings. 8 samples are taken then averaged by a SCALE_FACTOR of 3. The result is then stored in sum_adc_data. 

sum_adc_data >>= SCALE_FACTOR;

I wanted to output the value as a voltage, so we stored the value in vout. In order to get the correct voltage we multiplied by the appropriate ADC12_RATIO (2500/4095).

 vout = sum_adc_data * ADC12_RATIO;

the problem is that when I check the registers in CCS vout does not give me the appropriate value. I decided to just copy the value from the sum_adc_data to vout.

 vout = sum_adc_data ;

 I still obtained the same result for vout. Below I have provided the code and a screenshot of the registers:

#include <msp430.h> 
#include <stdint.h>
#include "TI_LMP91000.h"
#include "TI_LMP91000_register_settings.h"
#include "TI_MSP430.h"
#include "TI_MSP430_hardware_board.h"
#include "TI_MSP430_i2c.h"

/*----------------------------------------------------------------------------*/
void ADC12_Init(void);                                                         // To init MSP430F5528 ADC12 & Start Conversion
/*----------------------------------------------------------------------------*/
#define NUM_OF_RESULTS  8                                                      // Number of temp sensor samples to take
#define SCALE_FACTOR    3                                                      // For averaging converted samples
#define ADC12_RATIO     0.61035                                                // 2500/4096 (2.5V reference & 12bit converter)
//******************************************************************************
void main(void)
{

  uint8_t status = TI_LMP91000_NOT_READY;
  uint8_t read_val[2];                                                         // buffer to store register values

  WDTCTL = WDTPW + WDTHOLD;                                                    // Stop watchdog timer

  TI_LMP91000_LED_PxOUT |= TI_LMP91000_LED_PIN;                                // Set LED ON
  TI_LMP91000_LED_PxDIR |= TI_LMP91000_LED_PIN;                                // Set pin direction is output

  I2CSetup(LMP91000_I2C_Address);                                              // Initialize I2C module

  TI_LMP91000_MENB_PxOUT &= ~TI_LMP91000_MENB_PIN;                             // Enable \MENB Pin
  TI_LMP91000_MENB_PxDIR |= TI_LMP91000_MENB_PIN;                              // Set pin direction is output

  while (status == TI_LMP91000_NOT_READY)
    status = LMP91000_I2CReadReg(TI_LMP91000_STATUS_REG);                      // Read device ready status

  LMP91000_I2CWriteReg(TI_LMP91000_LOCK_REG, TI_LMP91000_WRITE_UNLOCK);        // unlock the registers for write

  LMP91000_I2CWriteReg(TI_LMP91000_TIACN_REG, TI_LMP91000_TIACN_REG_VALUE);    // Modify TIA control register
  LMP91000_I2CWriteReg(TI_LMP91000_REFCN_REG, TI_LMP91000_REFCN_REG_VALUE);    // Modify REF control register

  read_val[0]   = LMP91000_I2CReadReg(TI_LMP91000_TIACN_REG);                  // Read to confirm register is modified
  read_val[1]   = LMP91000_I2CReadReg(TI_LMP91000_REFCN_REG);                  // Read to confirm register is modified

  if ((read_val[0] != TI_LMP91000_TIACN_REG_VALUE) ||
      (read_val[1] != TI_LMP91000_REFCN_REG_VALUE))                            // test values took effect
    while (1);                                                                 // otherwise error

  LMP91000_I2CWriteReg(TI_LMP91000_LOCK_REG, TI_LMP91000_WRITE_LOCK);          // lock the registers
  LMP91000_I2CWriteReg(TI_LMP91000_MODECN_REG, TI_LMP91000_MODECN_REG_VALUE);  // 3-lead amperometric cell

  ADC12_Init();                                                                // Initialize MSP430F5528 ADC12 & Start Conversion
  __bis_SR_register(LPM0_bits + GIE);                                          // Enter LPM0, Enable interrupts
  __no_operation();                                                            // For debugger

}

// Description: Initialization of the ADC12 Module & Start Conversion
/*----------------------------------------------------------------------------*/
void ADC12_Init(void)
{
  TI_LMP91000_VOUT_ADC12_PxSEL |= TI_LMP91000_VOUT_ADC12_PIN;                  // Enable A/D channel A0
  REFCTL0 &= ~REFMSTR;                                                         // Reset REFMSTR to hand over control to
                                                                               // ADC12_A ref control registers
  ADC12CTL0 = ADC12ON+ADC12SHT0_8+ADC12MSC;                                    // Turn on ADC12, set sampling time
                                                                               // set multiple sample conversion
  ADC12CTL0 |= ADC12REFON+ADC12REF2_5V;                                        // Turn on Ref Gen & set to 2.5V
  ADC12MCTL0 = ADC12SREF_1;                                                    // Vr+ = Vref+ and Vr- = AVSS
  ADC12CTL1 = ADC12SHP+ADC12CONSEQ_2;                                          // Use sampling timer, set mode
  ADC12IE = ADC12IE0;                                                          // Enable ADC12IFG.0
  __delay_cycles(500);                                                         // delay to allow Ref to settle
  ADC12CTL0 |= ADC12ENC;                                                       // Enable conversions
  ADC12CTL0 |= ADC12SC;                                                        // Start conversion

}
/*----------------------------------------------------------------------------*/
// Description:
//   ADC12 Interrupt Service Routine 
/*----------------------------------------------------------------------------*/

#pragma vector=ADC12_VECTOR
__interrupt void ADC12ISR (void)
{
  static uint8_t index = 0;
  static volatile uint16_t results[NUM_OF_RESULTS];                            // To store ADC output
  static uint32_t sum_adc_data = 0;                                            // accumulate and avg adc results
  static volatile float vout;                                                  // lmp91000 vout

  switch(__even_in_range(ADC12IV,34))
  {
  case  0: break;                                                              // Vector  0:  No interrupt
  case  2: break;                                                              // Vector  2:  ADC overflow
  case  4: break;                                                              // Vector  4:  ADC timing overflow
  case  6:                                                                     // Vector  6:  ADC12IFG0
    results[index] = ADC12MEM0;                                                // Move results
    sum_adc_data += ADC12MEM0;
    index++;                                                                   // Increment results index, modulo;

    if (index == NUM_OF_RESULTS)
    {
      sum_adc_data >>= SCALE_FACTOR;                                           // Divide by NUM_OF_RESULTS
      vout = sum_adc_data * ADC12_RATIO;                                       // LMP91000 vout
      sum_adc_data = 0;                                                        // Set Breakpoint here & see measured vout
      index = 0;
    }
    break;
  case  8: break;                                                              // Vector  8:  ADC12IFG1
  case 10: break;                                                              // Vector 10:  ADC12IFG2
  case 12: break;                                                              // Vector 12:  ADC12IFG3
  case 14: break;                                                              // Vector 14:  ADC12IFG4
  case 16: break;                                                              // Vector 16:  ADC12IFG5
  case 18: break;                                                              // Vector 18:  ADC12IFG6
  case 20: break;                                                              // Vector 20:  ADC12IFG7
  case 22: break;                                                              // Vector 22:  ADC12IFG8
  case 24: break;                                                              // Vector 24:  ADC12IFG9
  case 26: break;                                                              // Vector 26:  ADC12IFG10
  case 28: break;                                                              // Vector 28:  ADC12IFG11
  case 30: break;                                                              // Vector 30:  ADC12IFG12
  case 32: break;                                                              // Vector 32:  ADC12IFG13
  case 34: break;                                                              // Vector 34:  ADC12IFG14
  default: break;
  }
}

here are the results when we multiply with the ADC12_RATIO:

here are the results when the ratio is removed

shouldn't my vout have the same value as sum_adc_data since all i did was assign the value to vout? Is there a problem with float types in the msp430? How can I fix this issue?


Position Control with InstaSPIN-MOTION

$
0
0

Hi,

Just saw this announcement in an email from LineStream 

Advanced Position Control Now Available on InstaSPIN-MOTION

This looks very interesting but I really need an Idiot's Guide as to how to evaluate this with a direct-drive PMSM motor I'm working on. I have no knowledge of using TI processors, so it looks like a pretty daunting task. 

Can you help me out ?

Thanks,

Geoff

IAC problem in TELNET Firmware lm3s6432

$
0
0

Hi,

I am developing the S2E converter using stelleries LM3s6965/6432 WITH ITS READY firmware. I use this converter between the PC based modbus software & a Datalogger. When I send a WRITE query to datalogger, which has data 225(0xFF), then the converter consider it as IAC command in TELNET & the data is not written in Datalogger. Can anybody suggest me the firmware changes in S2E converter, so that my modbus code in PC or datalogger need not be changed. The IAC command is 255.

Ti Resource Explorer, AM3359, Generic Example, Hello Example, configured as Cortex M3

$
0
0

Start from installer, TI Resource Explorer, AM3359, Generic Example, Hello Example,

result configured as Cortex M3

with clean install of 5.5.0.00077

Easy flash programming for mass production

$
0
0

Hello,

Considering mass production what is the easy way of flash programming for piccolo microcontrollers? Is easy serial flash programming is possible? If possible which pins and which program is used for that purpose?

Best Regards,

#10010 and #10056 erorrs in ALL example programs

$
0
0

I am pretty disappointing that TI is unable to provide CCS tutorials that don't work without having to do a whole bunch of things that are not even discussed or covered in the tutorials. I have finally at least gotten to the point that the example projects will load into the work space. But none of them will run according to the instructions in any tutorial I have found (e.g. http://www.ti.com/lit/ml/spmu352/spmu352.pdf).

I am trying to get running on Windows XP and CCS 5.5.

Hello has five errors when building and Blinky gets three. All the other ones have errors too. Here are the errors in Blinky:

#10010 errors encountered during linking; "blinky.out" not built blinky C/C++ Problem

#10056 symbol "g_pfnVectors" redefined: first defined in "./tm4c123gh6pm_startup_ccs.obj"; redefined in "./startup_ccs.obj" blinky C/C++ Problem

#10056 symbol "ResetISR" redefined: first defined in "./tm4c123gh6pm_startup_ccs.obj"; redefined in "./startup_ccs.obj" blinky C/C++ Problem

The driverlib, usblib and grlibs all have errors like...

"This project was created for a device that is not currently recognized: Cortex M.LM4F110B2QR. Please install the device descriptor, or migrate the project to the closest match from the supported devices by adjusting project properties."

...and when I try to select the TIVA C series and the appropriate board, that produces yet another error.

AND, there are a bunch of TM4C123G choices available, but none match the board. I finally figured out by studying the pamphlet that came with the board that the "closest" match is TM4C123GH6PM, but that doesn't change the result when selected.

Okay fine, so I installed the Energia IDE, followed their Windows instructions and tried it, and of course it fails with a cryptic error as well.

So, I moved over to a Macbook, downloaded Energia for Mac, followed their instructions and had it working in less that 5 minutes (including download time)!

Seriously? Is this the best you can do?

Is there some reason for all this "not working" experience and what is the fix?

Thanks.

Filtering the Acquired analog signal

$
0
0

Hello,

I am acquiring the analog signal using ADC channel at a 500Hz sampling rate using cc430F5137. I am new to digital filters so need guidance with the implementation of Lowpass filter.Can anyone explain how to implement the low pass filter for the obtained values of ADC12MEM0.How the ADC12MEM0 values are to be used or processed,what should be the sampling frequency should be taken if the signal is obtained using a sample rate of 500Hz and if the desired cutoff freq of 3Hz.

Can anyone provide information on the LPfilter implementation and also provide some materials and examples on the implementation method.

Thanks.

EMAC and PHY

$
0
0

Hi all, 

I'm using Hercules TMS570 kit.  I would like to send few bits of information from one board to another just using EMAC, MDIO and PHY and without using any standard ethernet protocol. I took the PHYdp83640 file from the lwIP example software, to use for my work. But, i don't understand how are the EMAC or the MDIO and PHY connected. Is there any PHY register where i need to copy the data in order to put that into the bus ? 
 Is there any document where i could get detailed information on Ethernet functionality on this device ? 


Msp430G2553 multiple ADC operating at the same time?

$
0
0

Hi,

I'm trying to ADC sample at least two pins simultaneously, but I saw only one ADC10MEM register. 

I also tried this code but it does not seem to be working. the values in memory address 0x0200 to 0x0206 does not make any sense. 

One way to work around it might be use ADC10 and ADC12 at the same time? 

#include <msp430.h>

int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
ADC10CTL1 = INCH_3 + CONSEQ_1; // A3/A2/A1, single sequence
ADC10CTL0 = ADC10SHT_2 + MSC + ADC10ON + ADC10IE;
ADC10DTC1 = 0x03; // 3 conversions
ADC10AE0 |= 0x0E; // P1.3,2,1 ADC10 option select
P1DIR |= 0x40; // Set P1.0 output

while(1)
{
ADC10CTL0 &= ~ENC;
while (ADC10CTL1 & BUSY); // Wait if ADC10 core is active
ADC10SA = 0x200; // Data buffer start
P1OUT |= 0x40; // P1.0 = 1
ADC10CTL0 |= ENC + ADC10SC; // Sampling and conversion start
//__bis_SR_register(CPUOFF + GIE); // LPM0, ADC10_ISR will force exit
P1OUT &= ~0x40; // P1.0 = 0
}
}

// ADC10 interrupt service routine
#pragma vector=ADC10_VECTOR
__interrupt void ADC10_ISR(void)
{
//__bic_SR_register_on_exit(CPUOFF); // Clear CPUOFF bit from 0(SR)
}

Thanks!

Holly

Serializer/Deserializer Compatibility

$
0
0

I read a post today about trying to connect a DS90UB913Q serializer to a DS90UB926Q deserializer.  The TI response is that they are incompatible.  I need to understand the serializer/deserializer combinations that do work together.  I need to understand this for both FPDLink II and III.  Is there a table or cross reference that I can use to understand this?

The link between the serializer and deserializer is defined as FPDLink III LVDS.  There must be more to the link that makes these devices incompatible.  Can you please explain?

Mick

 

 

BDC24_RDK EK-TM4C123GXL

$
0
0

Hi All

I would like to built my DC brushed motor control board 24V based on BDC24_RDK jaguar board. Is it possible to control it with EK-TM4C123GXL board? Is it possible to adapt SW package Stellaris for it for EK-TM4C123GXL?
Thank you.

Re: Connecting DRV8432 to a 3-phase BLDC motor

$
0
0

Kim,

Do you guys have DRV8432 Evaluation Kit? I can find one for DRV8402 but not 32.

Thanks,

Ivan.

[ADC08D1520RB] - Data width from FPGA to Cypress and WaveVision 5

$
0
0

Dear All,

Wishes for a prosperous new year ! (Better late than never... :) )

I have a rather simple question this time.

The FPGA sends 4 bytes at each go to the Cypress's data lines and from there to WV5.

In the Verilog code these bytes are : data_3, data_2, data_1, data_0; where 3 and 1 are set to zero (only 8 bits from the ADC).

(1) As it comes to be I need to use all 4 bytes for my application. When I try to send something else (i.e. set data_3 to 0F) this does not produce the expected result on the WV5 plot. I tried looking into the scripts but could not find anything. I also checked the scripts for the 12 bit devices. My guess is that WV5 never sends the address to read (data_3 and data_1).

(2) If (1) is true; Is there a way to trick WV5 into thinking I am using a 12 bit board ?

(3) Is there a way to setup the script so that one sample consists of two bytes instead of one ?

Thanks in advance,

Evros

 

USB to Serial Module (FT232) with Beaglebone black Host mode

$
0
0

Hello

My android compile from this link http://processors.wiki.ti.com/index.php/TI-Android-JB-4.2.2-DevKit-4.1.1_DeveloperGuide and i want to connect my BBB with USB to Serial Module via USB host on my BBB.

I try to configure kernel by enable Device Drivers->USB Support->USB serial converter support->FTDI Single port but that still not working, Please help

Thank you.

PCM 1798 application circuit substitutes

$
0
0

Hi, I am trying to recreate the application circuit in the pcm1798 datasheet.  In order to save cost, want to replace the recommended op-amps in the application circuit with opa604 (the recommended ones are NE5534).   I happen to already have some opa604's in the correct package.  I don't mind if my application circuit doesn't meet the target specifications initially, I just want to verify that my circuit is indeed assembled and working in the way that is recommended in the datasheet.

Thanks, 

Michael


cc1100 not stay in RX mode to wait for a packet

$
0
0

Hi Forum,


Got a cc1100 in working condition.

My goal is to enter RX and stay there. If a packet arrives, an interrupt via GDO-pin is signaled to receive the packet.

I enter RX by issueing the SRX strobe command.

But i only stay in RX for about 2msecs or so, when it returns to IDLE.

( I monitored the MARCSTATE, seeing first the calibration stage, then RX-state, then IDLE-state)

I tried many different configs, also via smartRF studio-settings....nada.

MCSM2 = 0x07 sets timeout to indefinite, as i understand.

am i missing something?

thanks!

Issue with compiler for a F28035

$
0
0

Hi all,

So I am a little new to embedded programming.  I am working with a F28035 chip and using Code Composer studio 5.1 to develop software.  I am trying to build my project, and found I am getting this error:

Description Resource Path Location Type
This project was created using a version of compiler that is not currently installed: 6.1.4 [C2000]. Another version of the compiler will be used during build: 6.1.3. Please install the compiler of the required version, or migrate the project to one of the available compiler versions by adjusting project properties. DSP28035-empty properties TI Problem Marker

This project used to build, when I was using Code Composer 5.4.  I downgraded because I was having an issue with an ARM compiler.  When I reverted, this code stopped working.  I have gone through the Install New Software, and am on the C2800 6.1.6 version.  I also have the 6.0.6 version installed.  Any help on getting this project up and running would be great.

Thanks,

Seth

Meaning of Rotor flux

$
0
0

Hi Chris,

It is stated that the FAST estimates the rotor flux and the rotor angle.

what do you mean by rotor flux ?

For example, in PMSM/synchronous motors, if you write the stator equations in the rotor frame, you get the stator flux in the rotor frame... I'm not familiar with the term "rotor flux"...

Q:

1. can you please explain the term "rotor flux" with respect to the motor equations (I assume stator voltage equation in the d-q frame attached to the rotor)

2. is it possible to calculate the "load angle" - that is, the angle between the stator flux vector and the d-axis of the rotor, from estimated variables ?

thanks a lot

Info on MSP-FET430U28A and MSP430F2121

$
0
0

hi team,
please, i need your help, regard the  MSP-FET430U28A, it is an  KIT Emulator and programmer .
My question is: this kit is right for to develop on platform MSP430F2121PW.

best regards
Pierluigi

Source file issue

$
0
0

Hello,

I've builed my project without any errors and then when I'm trying to run and debug it shows an error:

Can't find a source file at "/tmp/TI_MKLIBxSQht7/SRC/exit.c"
Locate the file or edit the source lookup path to include its location.

My Code Composer Studio Version is: 5.5.0.00077

My Operating system is Windows 8 (32bit).

I've already seen this problem at http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/247877.aspx

and I just can't ignore it, because when I do, the program stays at the begining and deasn't work properly.

Cheers,
Peter

Viewing all 262198 articles
Browse latest View live


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