ADC input

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
philip davies
Flowcode v5 User
Posts: 118
Joined: Wed Jun 29, 2011 1:09 pm
Has thanked: 17 times
Been thanked: 6 times
Contact:

ADC input

Post by philip davies »

Hi,

Is there somewhere on this forum that I can read/learn on how to use the ADC input using flowcode?

Its for an old amplifier that I am restoring. I would like to be able to use the volume control pot to display its set position on the display in dB.

Many thanks in advance :D

Phil

User avatar
Nico595
Posts: 84
Joined: Mon Jan 23, 2012 6:46 pm
Location: France
Has thanked: 12 times
Been thanked: 10 times
Contact:

Re: ADC input

Post by Nico595 »

Hi Phil,

If you want just display volume in dB without control you can use ADC but you must add a Continue Current in your audio input line with capacitor in input and ouput of potentiometer.


If you want control volume, you can use AD5204 digital potentiometers in SPI with Pic or Attiny
http://www.google.fr/url?sa=t&rct=j&q=& ... 3115,d.d2k

Your old potentiometer connected on ADC but without audio, just Continue Current.




Regards
Nico.

philip davies
Flowcode v5 User
Posts: 118
Joined: Wed Jun 29, 2011 1:09 pm
Has thanked: 17 times
Been thanked: 6 times
Contact:

Re: ADC input

Post by philip davies »

Hi Nico,

Many thanks for your reply. That's an interesting looking digital potentiometer. The original circuit uses a 4-gang motorised pot. Two of the four gangs were used for carrying the L and R audio channels and the third used for adc input and the fourth is just a spare. I would like to keep to the original design as it would require modifying of the preamp board.

Many thanks

Phil

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: ADC input

Post by medelec35 »

Hi Phil,
When you use and ADC component and use:
ReadAsByte, the the value retrieved will be 0 to 255 (0 to 5V)
ReadAsInt, the the value retrieved will be 0 to 1023 (0 to 5V)
So you can use one of the above and convert from bytes or int direct to dB's

I did create a flowchart that works as a volume control which can be found here:
http://www.matrixmultimedia.com/mmforum ... 99&#p45599
instead of volume you can have dB's
My guess the easiest way is to use the fourth gang of the pot and feed it with +5V one end and 0V the other, then the voltage out from the wiper will be proportional to the how far spinal has been rotated.
E.g if using ReadAsByte, and spindle is rotated a quarter of the way then
Voltage on the wiper = 1/4 * 5 = 1.25
Bytes = 255/5 * 1.25 = 64 or 255/4 =
Or if using ReadAsInt:
Int = 1023/5 * 1.25 = 256

Next thing to work out is the relationship between bytes (or int ) and dB's
There may not be so then you will need to use look-up tables (information on LUT's can be found by searching the forum)
Then you can directly enter the value of dB and the corresponding value of bytes.

There are free online courses and examples of different flowcharts in the learning centre:
http://www.matrixmultimedia.com/lc_index.php?p=12

Martin
Martin

philip davies
Flowcode v5 User
Posts: 118
Joined: Wed Jun 29, 2011 1:09 pm
Has thanked: 17 times
Been thanked: 6 times
Contact:

Re: ADC input

Post by philip davies »

Many thanks Martin for your help and suggestions. That's quite an interesting volume control that you have put together there.

I will also look at the learning centre of this website and see what I can find :D

Phil

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: ADC input

Post by medelec35 »

Thanks Phil,
Once you know what value of dB you want for each pot position, 'If you give it a go and create your flowchart, Im sure we can help you procedure further.

Martin
Martin

Post Reply