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.

CCS/MSP430FG6626: Visibility and access to CTSD16 registers

Part Number: MSP430FG6626


Tool/software: Code Composer Studio

Hi,

I’m working with the MSP430FG6626 and I have 2 questions concerning the visibility of registers of the CTSD16 in debugging mode and the access to these registers in general:

1. When I’m debugging I can only view registers of Channel 0 in the register tab, e.g. CTSD16CCTL0.

How can I make the registers of the other AD-channels visible, e.g. CTSD16CCTL1?

As an IDE I’m using CCS 10.1.0.

 

 

2. How can I get access to the registers of the other channels?

I defined the ADC-registers of channel 1 in the msp430fg6626.h file of the include folder in ...ti/ccs1010/ccs/ccs_base/msp430/include and tried to debug the example project msp430fg662x_ctsd16_04 by replacing channel 0 registers with channel 1 registers. Unfortunately the results variable is always 0. How can I solve this problem?

#include <msp430.h>

unsigned int  results;                          // CTSD16 Conversion Results

void main(void) {
    WDTCTL = WDTPW | WDTHOLD;                   // Stop WDT

    P6SEL |= BIT6 | BIT7;                       // Select AD1+/- analog input pins

    CTSD16CTL = CTSD16REFS;                     // Internal ref
    CTSD16CCTL1  |= CTSD16SNGL | CTSD16DF;      // Single sample, 2's complement
    CTSD16INCTL1 |= CTSD16INCH_11;               // Select AD1+ / AD1- for CH1

    __delay_cycles(2000);                   // Delay ~120us for 1.2V ref to settle

    while(1) {
        CTSD16CCTL1 |= CTSD16SC;                // Set bit to start conversion
        while(!(CTSD16IFG & CTSD16IFG));      // Poll IFG until conversion completes
        results = CTSD16MEM1;                   // Save CTSD16 conversion results
        __no_operation();                       // SET BREAKPOINT HERE
    }
}

Thank you very much.

 

  • Hi Patrick,

    It seems strange,  it should be able to see all the registers inside the MCU normally. I will check with the team and come back.

    Thanks!

    Best Regards

    Johnson

  • Hi Patrick,

    Have you tried to use a lower version of CCS or IAR? I don’t have this device now. I have already applied, and I will do the test and analysis after receiving it.

    Thanks!

    Best Regards

    Johnson

  • Hi Johnson,

    thanks for your reply.

    I tried versions CCS 8.3.0 and CCS 9.3.0 but unfortunately it didn't work.

    As mentioned above I defined the registers of channel 1 in the CTSD16 section of the msp430fg6626.h file and the msp430fg6626.cmd file in the folder include in ...ti/ccs1010/ccs/ccs_base/msp430/include with the given offsets of the MSP430x6xx Family User's Guide. 

    Is it possible that I forgot to define something here so that I'm not able to see the registers?

    /************************************************************
    * CTSD16 - Sigma Delta 16 Bit
    ************************************************************/
    CTSD16CTL          = 0x0A80;
    CTSD16CTL_L        = 0x0A80;
    CTSD16CTL_H        = 0x0A81;
    CTSD16IFG          = 0x0AAC;
    CTSD16IFG_L        = 0x0AAC;
    CTSD16IFG_H        = 0x0AAD;
    CTSD16IE           = 0x0AAE;
    CTSD16IE_L         = 0x0AAE;
    CTSD16IE_H         = 0x0AAF;
    CTSD16IV           = 0x0AB0;
    CTSD16IV_L         = 0x0AB0;
    CTSD16IV_H         = 0x0AB1;
    CTSD16CCTL0        = 0x0A82;
    CTSD16CCTL0_L      = 0x0A82;
    CTSD16CCTL0_H      = 0x0A83;
    CTSD16MEM0         = 0x0AB2;
    CTSD16MEM0_L       = 0x0AB2;
    CTSD16MEM0_H       = 0x0AB3;
    CTSD16INCTL0       = 0x0A84;
    CTSD16INCTL0_L     = 0x0A84;
    CTSD16INCTL0_H     = 0x0A85;
    CTSD16PRE0         = 0x0A86;
    CTSD16PRE0_L       = 0x0A86;
    CTSD16PRE0_H       = 0x0A87;
    
    CTSD16CCTL1		   = 0x0A88;//new
    CTSD16CCTL1_L      = 0x0A88;//new
    CTSD16CCTL1_H      = 0x0A89;//new
    CTSD16MEM1         = 0x0AB4;//new
    CTSD16MEM1_L       = 0x0AB4;//new
    CTSD16MEM1_H       = 0x0AB5;//new
    CTSD16INCTL1       = 0x0A8A;//new
    CTSD16INCTL1_L     = 0x0A8A;//new
    CTSD16INCTL_1_H    = 0x0A8B;//new
    CTSD16PRE1         = 0x0A8C;//new

    #define __MSP430_HAS_CTSD16_1__ //new SFR_16BIT(CTSD16CCTL1); /* CTSD16 Channel 1 Control Register */ //new SFR_8BIT(CTSD16CCTL1_L); /* CTSD16 Channel 1 Control Register */ //new SFR_8BIT(CTSD16CCTL1_H); /* CTSD16 Channel 1 Control Register */ //new SFR_16BIT(CTSD16MEM1); /* CTSD16 Channel 1 Conversion Memory */ //new SFR_8BIT(CTSD16MEM1_L); /* CTSD16 Channel 1 Conversion Memory */ //new SFR_8BIT(CTSD16MEM1_H); /* CTSD16 Channel 1 Conversion Memory */ //new SFR_16BIT(CTSD16INCTL1); /* CTSD16 Channel 1 Input Control Register */ //new SFR_8BIT(CTSD16INCTL1_L); /* CTSD16 Channel 1 Input Control Register */ //new SFR_8BIT(CTSD16INCTL1_H); /* CTSD16 Channel 1 Input Control Register */ //new SFR_16BIT(CTSD16PRE1); /* CTSD16 Channel 1 Preload Register */ //new SFR_8BIT(CTSD16PRE1_L); /* CTSD16 Channel 1 Preload Register */ //new SFR_8BIT(CTSD16PRE1_H); /* CTSD16 Channel 1 Preload Register */ //new /* CTSD16IFG */ #define CTSD16IFG1 (0x0002) /* CTSD16 Channel 1 Interrupt Flag */ //new #define CTSD16OVIFG1 (0x0200) /* CTSD16 Channel 1 Overflow Interrupt Flag */ //new #define CTSD16IFG1_L (0x0001) /* CTSD16 Channel 1 Interrupt Flag */ //new #define CTSD16OVIFG1_H (0x0001) /* CTSD16 Channel 1 Overflow Interrupt Flag */ //new /* CTSD16IE */ #define CTSD16IE2 (0x0004) /* CTSD16 Channel 2 Interrupt Enable */ //new #define CTSD160VIE2 (0x0400) /* CTSD16 Channel 2 Overflow Interrupt Enable */ //new #define CTSD16IE1_L (0x0001) /* CTSD16 Channel 0 Interrupt Enable */ //new #define CTSD16OVIE1_H (0x0001) /* CTSD16 Channel 0 Overflow Interrupt Enable */ //new /* CTSD16IV Definitions */ #define CTSD16IV_NONE (0x0000) /* No Interrupt pending */ #define CTSD16IV_CTSD16OVIFG (0x0002) /* CTSD16OVIFG */ #define CTSD16IV_CTSD16MEM0 (0x0004) /* CTSD16MEM0-CTSD16IFG0 */ #define CTSD16IV_CTSD16MEM1 (0x0006) //new

    Thank you!

    Best regards

    Patrick

  • Hi Patrick,

    I think you shouldn't miss anything. I will test and verify the CTSD16 register after I receive samples.

    The problem may be related to CCS, but it is not very sure yet. I will update here after testing.

    Thanks!

    Best Regards

    Johnson

  • Hi Patrick,

    I check this device (FG6626) and found there is only one CTSD16 module in FG6626, thus you can only/use the CH0 register.

    Thanks!

    Best Regards

    Johnson

  • Hi Johnson,

    thanks for your reply.

    I think you are right but I'm still a bit confused because the registers are specified in the MSP430x5xx and MSP430x6xx Family
    User's Guide.

    So this means I can't use them or don't they even exist?

    Thank you!

    Best regards

    Patrick

  • Patrick Bisinger said:
    I think you are right but I'm still a bit confused because the registers are specified in the MSP430x5xx and MSP430x6xx Family

    User's Guide.

    So this means I can't use them or don't they even exist?

    The Family User's Guide section 30.1 CTSD16 Introduction contains:

    Up to seven independent simultaneously-sampling ADCs (the number of channels is device dependent, see the device-specific data sheet)

    And the MSP430FG6626 datasheet section 9.12.16.1 CTSD16 contains:

    The CTSD16 module integrates a single sigma-delta ADC with ten external inputs and four internal inputs.

    Patrick Bisinger said:
    So this means I can't use them or don't they even exist?

    I take it as meaning the CTSD16 module inside the MSP430FG6626 only contains a single ADC (channel), as thus only the CTSD16 Channel zero registers exist in the device.

**Attention** This is a public forum