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.
Hello
I am working whit MSP430FR2355 Lunch pad and using Code Composer Studio 10.3.1.
I want to have DAC as input and then give output of DAC to ADC and to display output of ADC on LCD
Know I have some problem:
1- Do you have example code to have DAC input and ADC as output?
2- Is there any software or schematic environment that I can simulate and test my code to see result before using Micro?
3- Do you have something like project wizard to produce code according to schematics?
Best Regards
Hadi
Hi Hadi,
I am sorry for don't understand your requirement.
You need generate a voltage via DAC? and capture this voltage via ADC?
There are some example code as your reference:
https://dev.ti.com/tirex/explore/node?node=ANb170XIJpeepYK6GrY-ew__IOGqZri__LATEST
Thanks!
Best Regards
Johnson
Hello,
Hi Hadi,
We provide some examplde code in the pervious link:
https://dev.ti.com/tirex/explore/node?node=ANb170XIJpeepYK6GrY-ew__IOGqZri__LATEST
And for applicaiton code maybe need you to implement using those example.
And maybe this application note is useful for you:
https://www.ti.com/lit/an/slaae25/slaae25.pdf
Thanks!
Best Regards
Johnson
Hi Johnson
Thanks for replay.
My problem in ADC and DAC was solved. Thanks a lot.
Know I have a ADC digit and I want to display on LCC (Sharp128),
My ADC output, is in
unsigned int ADC_Result;
I used this query for display on LCD, but I have some error.
GrStringDrawCentered(&g_sContext, " my ADC Value" <<ADC_Result , AUTO_STRING_LENGTH, 65, 20,TRANSPARENT_TEXT);
My error is: #31 expression must have integral type
Best Regards
Hadi
Hi
I am using C.
My problem was not solved. I want display (string + int) in this query.
unsigned int ADC_Result;
I used this query for display on LCD, but I have some error.
GrStringDrawCentered(&g_sContext, " my ADC Value" <<ADC_Result , AUTO_STRING_LENGTH, 65, 20,TRANSPARENT_TEXT);
BR
I understand that, but << is a shift operator in C.
Try including stdio.h and use sprintf() with a separate buffer:
char buffer[32]
sprintf(buffer, "My ADC Value: %d", ADC_Result);
GRStringDrawCentered(&g_sContext, buffer....
I couldn't understand your answer. Can you explain it completely to me and to write complete code .Thanks alot
#include <stdio.h>
int main()
{
char buff[32];
uint16_t data;
// Read ADC
sprintf(buff. "ADC Value = %ud", data);
GrStringDrawCentered(&g_sContext,buff, AUTO_STRING_LENGTH, 65, 20, TRANSPARENT_TEXT);
}
Not that hard, really. You used a C++ construct - the overloaded << operator - in what appears to be pure C code. You need to use C, which means using stdio.h and sprintf(). Any C resource should show you how this code works.
**Attention** This is a public forum