dsPIC sYNCHRONISING 2 A/D Channels

For general Flowcode discussion that does not belong in the other sections.
DAVIDJOINER
Posts: 140
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 7:35 pm
Been thanked: 18 times

dsPIC sYNCHRONISING 2 A/D Channels

Post by DAVIDJOINER »

Hi

I am using a dsPIC ECIO and 2 EB085 A/D boards

I understand how to read these channels in normally using your component but i wish to synchronise the A/D inputs ie read both at same time point

I require to sample at around 20k not too fast for the chips (100k) so i am sure it can be done

Any ideas

David

BenR
Matrix Staff
Posts: 1951
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 510 times
Been thanked: 697 times

Re: dsPIC sYNCHRONISING 2 A/D Channels

Post by BenR »

Hi David,

I've not tested this on hardware but this should hopefully do what you need, or at least show you the way.
ECIO_EB085.fcfx
(14.78 KiB) Downloaded 606 times

DAVIDJOINER
Posts: 140
Joined: Wed Dec 02, 2020 7:35 pm
Been thanked: 18 times

Re: dsPIC sYNCHRONISING 2 A/D Channels

Post by DAVIDJOINER »

Hi Ben

That's great

Understand your logic and will try out on the hardware later this week


Many thanks
David

DAVIDJOINER
Posts: 140
Joined: Wed Dec 02, 2020 7:35 pm
Been thanked: 18 times

Re: dsPIC sYNCHRONISING 2 A/D Channels

Post by DAVIDJOINER »

Hi Ben

I tried your idea today

Does not appear to work (Note i am injecting 1khz into the EB805 card)

However if i disable your loop and enable the normal EB085 component i get the 1Kz tone out of the EB086 so the rest of the setup appears to be working okay

Note i am currently only using 1 EB085 for test purposes so i have // the 2nd EB085 in the c code

Any further ideas

David
Attachments
ECIO_SDR_001_REV_01.fcfx
(25.62 KiB) Downloaded 550 times

BenR
Matrix Staff
Posts: 1951
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 510 times
Been thanked: 697 times

Re: dsPIC sYNCHRONISING 2 A/D Channels

Post by BenR »

Hi David,

I got the upper and lower bytes reversed, Please can you try this instead and hopefully it will work better.
ECIO_SDR_001_REV_01.fcfx
(25.71 KiB) Downloaded 619 times

DAVIDJOINER
Posts: 140
Joined: Wed Dec 02, 2020 7:35 pm
Been thanked: 18 times

Re: dsPIC sYNCHRONISING 2 A/D Channels

Post by DAVIDJOINER »

Ben

Great now works fine on the single EB085 configuration i tested

Will try with 2 EB085's configuration next week

Many thanks for fast response

Excellent service as usual

David

DAVIDJOINER
Posts: 140
Joined: Wed Dec 02, 2020 7:35 pm
Been thanked: 18 times

Re: dsPIC sYNCHRONISING 2 A/D Channels

Post by DAVIDJOINER »

Ben

Tried the second A/D converter in hardware that works fine in synchronising and i can output each to the EB086 output as required

However when i try to add the 2 waveforms together using the DSP Math + funcion i have a problem

It only appears to see input on the A channel

It does not appear to see any input i put into the B channel

Can you check the math + function

I do note that in the simulation mode it does appear to see both A & B inputs if i use the sinewave generator to test it

Any ideas

David
Attachments
SDR_REV_02.fcfx
(30.14 KiB) Downloaded 662 times

BenR
Matrix Staff
Posts: 1951
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 510 times
Been thanked: 697 times

Re: dsPIC sYNCHRONISING 2 A/D Channels

Post by BenR »

Hi David,

I can't see anything incorrect in the code generation of the math function. It seems to be working correctly.

I wonder if there is a gain problem or something similar on the channel B input hardware?

The generated code looks like this.

DSPBuff_6_Put(FCV_05d31_DSP_Math1__INDEXOUT, DSP_Math1_Ref1_Get(FCV_05d31_DSP_Math1__INDEXA) + DSP_Math1_Ref2_Get(FCV_05d31_DSP_Math1__INDEXB));

which boils down to

MathBuffer[0] = DSPInput1[0] + DSPInput2[0];

DAVIDJOINER
Posts: 140
Joined: Wed Dec 02, 2020 7:35 pm
Been thanked: 18 times

Re: dsPIC sYNCHRONISING 2 A/D Channels

Post by DAVIDJOINER »

Ben

I had already tried that ie I fed the same channel to A & B seperately and even the same channel to both A & B at the same time and in all cases the input on the B channel had no affect on the output ?

David

BenR
Matrix Staff
Posts: 1951
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 510 times
Been thanked: 697 times

Re: dsPIC sYNCHRONISING 2 A/D Channels

Post by BenR »

Hi David,

Many thanks for chasing this one, I've replicated the problem and beleive I have now spotted the issue and am in the process of a fix. Hopefully I'll have one for you shortly. I beleive it's a case of a semi colon in the wrong place ending the command too early before the B input gets added.

Post Reply