WaveDac + ADC + UART, 5LP Prot. Kit

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
cadi_1014291
Level 6
Level 6
25 likes received 10 likes received 10 likes given

Hi all,

   

I'm making a easy project, but i haven't the results i'm expecting. In few days i will use a analog transducer, it give me back a voltage, around 100mV peak to peak, so i'm trying to 'simulate' it with the WaveDac component (generating a 0.5 volts sine wave), attached to a ADC_DeltaSigma configured to 16 bits, continuous mode, 16 bits.

   

The convertion is sent via UART to my pc, i'm expecting a voltage from 0.250 v - 0.750, all i get is 0.350 and 0.650 results printed on the terminal.

   

Any suggestions on this topic? It seems like i'm getting a 300 mV sine wave, i already try it with the buffered output on the WaveDac component with no improvements.

   

Find attached my project.

   

 

   

Carlos

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
cadi_1014291
Level 6
Level 6
25 likes received 10 likes received 10 likes given

Hi Bob and Dana,

   

Just increase the size of str, made it 20, i see improvement, also changed the ADC resolution to 17 bits, Input Range to Vssa to 2.048V, Buffer Mode to Bypass Buffer. I had test this configuration with 5 000 sps and 10 000 sps, it seems better, i take the data printed on the terminal and make a graph with it, it looks like a sine wave now!!

   

return value of ADC_CountsTo_Volts() is float32, just check it on the component datasheet. Just ADC_CountsTo_mVolts() and ADC_CountsTo_uVolts() returns integers.

   

Attached the project, maybe you can see any improvement.

   

Thanks

   

Carlos

View solution in original post

0 Likes
4 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Your sprintf result buffer str[10] is quite too small, so you will overwrite some data.

   

 

   

Bob

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Your WaveDAC8 is running at 500 Hz, the sample rate of ADC at 4x that, 2 Khz.

   

Should they be in exact sync you would get 4 repetitive samples, yet you are only

   

reporting 2 ? That seems odd. Just for drill make either component at some non

   

related rate, see if that affects your output.

   

 

   

Place an additional pin and look at the sine you are digitizing, to make sure its

   

what you expect. Look at WaveDAC8 out both buffered and un-buffered. Although

   

as you observed values do not change as you are using the input buffer of ADC.

   

Note that using ADC buffer limits input common mode range per the graphic in

   

the properties configurator, eg. 100 mV off the ground rail.

   

 

   

In this line of code -

   

 

   

        ADCVolts = ADC_CountsTo_Volts(ADC_GetResult32());

   

 

   

ADCVolts is a float, but the return from the function is int32, maybe you should cast it

   

 

   

        ADCVolts = (float)  ADC_CountsTo_Volts(ADC_GetResult32());

   

 

   

Regards, Dana.

0 Likes
lock attach
Attachments are accessible only for community members.
cadi_1014291
Level 6
Level 6
25 likes received 10 likes received 10 likes given

Hi Bob and Dana,

   

Just increase the size of str, made it 20, i see improvement, also changed the ADC resolution to 17 bits, Input Range to Vssa to 2.048V, Buffer Mode to Bypass Buffer. I had test this configuration with 5 000 sps and 10 000 sps, it seems better, i take the data printed on the terminal and make a graph with it, it looks like a sine wave now!!

   

return value of ADC_CountsTo_Volts() is float32, just check it on the component datasheet. Just ADC_CountsTo_mVolts() and ADC_CountsTo_uVolts() returns integers.

   

Attached the project, maybe you can see any improvement.

   

Thanks

   

Carlos

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Thanks Carlos for pointing out my error, must have done post with my

   

eyes closed.

   

 

   

Bypass buffer mode yields true R-R input performance.

   

 

   

Regards, Dana.

0 Likes