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/MSP430G2231: Trying to create multiple function file for a program, need help with ADC10

Part Number: MSP430G2231

Tool/software: Code Composer Studio

Hello everyone

I need some help with coding the ADC10, this is for a program for a sun sensors so I wish to split different function into different file and i'm new to using CCS so i'm not sure what are the ways to call a function, i know i have to first add the header file for the function, but from that I have no idea how to actually call it. Another problem I need help understanding is input to the ADC, in order to read the analog signal with the ADC it must be set with all the parameter first, now do i do it in the ADC file or should it be done in the main file. My assumption is do it in the ADC file, does that mean I just have to call the ADC file first before everything and is defining array to store the ADC digital output required beforehand?

Thanks for your attention

Richard

  • Hi Richard,

    Are you familiar with coding in C in general. Using CCS will not be any different than any other IDE regarding the questions you have. You will need to include (#include) the header file in both the corresponding .c file that implements those functions, as well as in your main file. If you are having troubel calling functions, etc, then I would suggest you look at some tutorials on coding in C. In addition, you can find some software examples on the MSP430G2231 product page. These will all be single file examples, but they should help you get started, and they will include examples on using the ADC. In addition, please see the the User's Guide (www.ti.com/.../slau144) for detailed information on using the ADC. As far as whether to break out the ADC code into its own file, that is entirely up to you.

    Regards,
    Nathan

**Attention** This is a public forum