Not applicable
Jul 02, 2013
07:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 02, 2013
07:38 PM
after I use ADC001 to store the analog signal into channel A memory, how do get the data that I have stored?
I like to get the data directly through USB so that I can plot the data to mathlab.
Thanks guys!
I like to get the data directly through USB so that I can plot the data to mathlab.
Thanks guys!
- Tags:
- IFX
5 Replies
Jul 02, 2013
07:59 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 02, 2013
07:59 PM
Hi,
You can use the below API.
void ChannelA_ISR(void)
{
status_t status;
uint8_t EvtStatus;
status = ADCCH001_GetResultEvtFlag(&ADCCH001_Handle0, &EvtStatus);
if((status == DAVEApp_SUCCESS) && (EvtStatus == 0x01))
{
//Do something
status = ADCCH001_GetResult(&ADCCH001_Handle0, &Result_ChA);
status = ADCCH001_ClearResultEvtFlag(&ADCCH001_Handle0);
IO004_TogglePin(IO004_Handle0); // P1.3
}
}
You can use the below API.
void ChannelA_ISR(void)
{
status_t status;
uint8_t EvtStatus;
status = ADCCH001_GetResultEvtFlag(&ADCCH001_Handle0, &EvtStatus);
if((status == DAVEApp_SUCCESS) && (EvtStatus == 0x01))
{
//Do something
status = ADCCH001_GetResult(&ADCCH001_Handle0, &Result_ChA);
status = ADCCH001_ClearResultEvtFlag(&ADCCH001_Handle0);
IO004_TogglePin(IO004_Handle0); // P1.3
}
}
Not applicable
Jul 14, 2013
07:09 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 14, 2013
07:09 AM
Travis wrote:
Hi,
You can use the below API.
void ChannelA_ISR(void)
{
status_t status;
uint8_t EvtStatus;
status = ADCCH001_GetResultEvtFlag(&ADCCH001_Handle0, &EvtStatus);
if((status == DAVEApp_SUCCESS) && (EvtStatus == 0x01))
{
//Do something
status = ADCCH001_GetResult(&ADCCH001_Handle0, &Result_ChA);
status = ADCCH001_ClearResultEvtFlag(&ADCCH001_Handle0);
IO004_TogglePin(IO004_Handle0); // P1.3
}
}
sorry for replying back so late.
I'm not sure how/where to get the data after using this API.
Thanks for the reply once again
Jul 16, 2013
08:07 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 16, 2013
08:07 PM
The ADC result is copied to "Result_ChA". This is a variable you had to create in advance.
Not applicable
Aug 24, 2013
07:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 24, 2013
07:14 AM
int WaveOnOff=1;
int main(void)
{
// status_t status; // Declaration of return variable for DAVE3 APIs (toggle comment if required)
DAVE_Init(); // Initialization of DAVE Apps
while(1)
{
}
return 0;
}
void ERU_ISR (void)
{
uint32_t status;
//Reads Status Flag
status = RD_REG(ERU001_Handle0.ERURegs->EXICON[ERU001_Handle0.InputChannel],ERU_EXICON_FL_Msk , ERU_EXICON_FL_Pos);
if(status)
{
IO004_TogglePin(IO004_Handle0); //Toggle LED P1.0
ERU001_ClearFlag(ERU001_Handle0); // Clears the Status Flag
if(WaveOnOff)
{
DACWG001_Start(&DACWG001_Handle0);
ADC001_EnableBackGroundEvent(&ADC001_Handle0);
WaveOnOff = 0;
}
else
{
DACWG001_Stop(&DACWG001_Handle0);
ADC001_DisableBackGroundEvent(&ADC001_Handle0);
WaveOnOff = 1;
}
}
}
void ChannelA_ISR(void)
{
status_t status;
uint8_t EvtStatus;
status = ADCCH001_GetResultEvtFlag(&ADCCH001_Handle0, &EvtStatus);
if((status == DAVEApp_SUCCESS) && (EvtStatus == 0x01))
{
//Do something
status = ADCCH001_GetResult(&ADCCH001_Handle0, &Result_ChA);
status = ADCCH001_ClearResultEvtFlag(&ADCCH001_Handle0);
IO004_TogglePin(IO004_Handle0); // P1.3
}
}
This is the whole set of Main.c code and these are the errors
../Main.c:57:1: warning: implicit declaration of function 'ADCCH001_GetResultEvtFlag' [-Wimplicit-function-declaration]
../Main.c:57:37: error: 'ADCCH001_Handle0' undeclared (first use in this function)
../Main.c:57:37: note: each undeclared identifier is reported only once for each function it appears in
../Main.c:61:1: warning: implicit declaration of function 'ADCCH001_GetResult' [-Wimplicit-function-declaration]
../Main.c:61:49: error: 'Result_ChA' undeclared (first use in this function)
../Main.c:63:1: warning: implicit declaration of function 'ADCCH001_ClearResultEvtFlag' [-Wimplicit-function-declaration]
make: *** [Main.o] Error 1
int main(void)
{
// status_t status; // Declaration of return variable for DAVE3 APIs (toggle comment if required)
DAVE_Init(); // Initialization of DAVE Apps
while(1)
{
}
return 0;
}
void ERU_ISR (void)
{
uint32_t status;
//Reads Status Flag
status = RD_REG(ERU001_Handle0.ERURegs->EXICON[ERU001_Handle0.InputChannel],ERU_EXICON_FL_Msk , ERU_EXICON_FL_Pos);
if(status)
{
IO004_TogglePin(IO004_Handle0); //Toggle LED P1.0
ERU001_ClearFlag(ERU001_Handle0); // Clears the Status Flag
if(WaveOnOff)
{
DACWG001_Start(&DACWG001_Handle0);
ADC001_EnableBackGroundEvent(&ADC001_Handle0);
WaveOnOff = 0;
}
else
{
DACWG001_Stop(&DACWG001_Handle0);
ADC001_DisableBackGroundEvent(&ADC001_Handle0);
WaveOnOff = 1;
}
}
}
void ChannelA_ISR(void)
{
status_t status;
uint8_t EvtStatus;
status = ADCCH001_GetResultEvtFlag(&ADCCH001_Handle0, &EvtStatus);
if((status == DAVEApp_SUCCESS) && (EvtStatus == 0x01))
{
//Do something
status = ADCCH001_GetResult(&ADCCH001_Handle0, &Result_ChA);
status = ADCCH001_ClearResultEvtFlag(&ADCCH001_Handle0);
IO004_TogglePin(IO004_Handle0); // P1.3
}
}
This is the whole set of Main.c code and these are the errors
../Main.c:57:1: warning: implicit declaration of function 'ADCCH001_GetResultEvtFlag' [-Wimplicit-function-declaration]
../Main.c:57:37: error: 'ADCCH001_Handle0' undeclared (first use in this function)
../Main.c:57:37: note: each undeclared identifier is reported only once for each function it appears in
../Main.c:61:1: warning: implicit declaration of function 'ADCCH001_GetResult' [-Wimplicit-function-declaration]
../Main.c:61:49: error: 'Result_ChA' undeclared (first use in this function)
../Main.c:63:1: warning: implicit declaration of function 'ADCCH001_ClearResultEvtFlag' [-Wimplicit-function-declaration]
make: *** [Main.o] Error 1
Aug 25, 2013
08:25 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 25, 2013
08:25 PM
Did you actually include the ADC apps? Errors / warning is giving you a hint that these are missing.