- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using delta sigma adc of 18 bit resolution, I tried to convert the data into string format and print in serial. But did not get result.
This is my code:
#include <project.h>
#include <stdio.h>
int main()
{
CyGlobalIntEnable; /* Enable global interrupts. */
int16 result=0;
float result1 = 0u;
char8 resultStr[16u];
char *resultstr= NULL;
/* Place your initialization/startup code here (e.g. MyInst_Start()) */
PWM_Start();
ADC_Start();
PGA_Start();
UART_Start();
ADC_StartConvert();
PWM_WritePeriod(100);
PWM_WriteCompare(50);
for(;;)
{
if(ADC_IsEndConversion(ADC_RETURN_STATUS))
{
result=ADC_GetResult32();
result1=ADC_CountsTo_Volts(result);
CyDelay(3000);
sprintf((char *)resultStr,"%+1.2f",1.2663);
CyDelay(1000);
UART_PutString(resultStr);
}
}
/* Place your application code here. */
}
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is always advisable to post the complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.
Did you set "Use nelwlib nano float formatting" to true?
Did you set the heap size to >= 0x200 ?
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have fixed the issue following the configuration here: