Jump to content

MBHP_AINSER64


TK.
 Share

Recommended Posts

As a workaround for the noisy 3.3V ADC of STM32 and LPC17, I developed a new solution with an external ADC.

I selected the MCP3208, since it's available for only 2.75 EUR at Reichelt. It offers a resolution of 12bit.

The driver development was straightforward, and I must say that I'm very satisfied with the results! :)

mbhp_ainser64_proto.jpg

The ADC is accessed via SPI (e.g. J19 of the MBHP_CORE_LPC17 module).

A 74HC595 has been added and is accessed via SPI as well, so that no additional IO pins of the microcontroller have to be sacrificed for the MUX control.

By using a nice trick, only a single chip select line is required to access both serial devices.

This makes the solution scalable: multiple MBHP_AINSER64 modules can be accessed from a single core. The driver is prepared for 2 modules (= 128 pots), but scanning even more pots is no problem as long as dedicated uC outputs for chip selects are available.

Alternatively, a 3-to-8 MUX could be used for accessing 8 modules via 3 output pins! -> for scanning 512 pots/faders ;-)

Also the accuracy is quite nice: if directly powered from the MBHP_CORE_LPC17 module, values are jittering by only ca. +/-1..3 LSBs

For comparison: the ADCs of STM32 and LPC17 are jittering by +/- 16, which means that even if the conversion result is converted to 7bit resolution there is a risk for unstable values.

If the module is externally powered, the jitter is +/- 1 LSB!

Means: 64 pots can be sampled with ca. 11bit accuracy - with a DIY friendly design! :)

Here the first applications:

Tutorial (self-explaining): http://svnmios.midibox.org/listing.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Ftutorials%2F012b_ainser_muxed%2F

Jitter Monitor (for testing purposes): http://svnmios.midibox.org/listing.php?repname=svn.mios32&path=%2Ftrunk%2Fapps%2Ftroubleshooting%2Fainser_jitter_mon%2F

Driver: http://svnmios.midibox.org/listing.php?repname=svn.mios32&path=%2Ftrunk%2Fmodules%2Fainser%2F

Schematic: http://www.ucapps.de/mbhp/mbhp_ainser64.pdf

PCB: this time I will create the layout by myself, because I need some practice ;)

Update: PCB up & running -> new website http://www.ucapps.de/mbhp_ainser64.html

Best Regards, Thorsten.

Link to comment
Share on other sites

Schematic: http://www.ucapps.de/mbhp/mbhp_ainser64.pdf

Layout (preliminary, because headers are too close together, this has to be fixed!)

/edit: removed old layout, new snapshot below

This was my first selfmade layout after more than 5 years, but it seems that I haven't lost the skills. ;)

First I tried it with Kicad, but quickly changed back to Eagle since I don't like the schematic entry - it slows down the process too much.

Using the freeware version of Eagle forced me to limit the size to 100x80, but the circuit still fits into this area! :)

Best Regards, Thorsten.

Link to comment
Share on other sites

Thorsten,

it looks as if spacing might be a little tight for Reichelt WSL type headers - have you checked that they fit? I would definitely prefer them over regular simple headers just because it is easier to get the cabling right again in case one ever has to remove cables.

Best, ilmenator

Link to comment
Share on other sites

  • 3 weeks later...

Hi TK,

I haven't read the thread twice yet, but a couple of questions. I have a lpc core and the mcu at my desk now, but I ain't gonna do much about it for the next six months though, but my plan for the lpc was to build a cs for my daw, atm cubase.

Does this design replace the regular ain?

And will this be the way to go for future projects like the one I mentioned above?

Will it be compatible for a long time like the other ain design has been?

If this is the case and the design works good in your opinion, I will be joining a bulk order ;-)

Ingebret

Link to comment
Share on other sites

Does this design replace the regular ain?

Yes, but only for MIOS32 based cores.

The accuracy is much better, and the wiring is simpler than with the old MBHP_AIN modules (just a serial connection between J19 and the MBHP_AINSER64 module(s))

And will this be the way to go for future projects like the one I mentioned above?

yes

Will it be compatible for a long time like the other ain design has been?

yes!

If this is the case and the design works good in your opinion, I will be joining a bulk order ;-)

Meanwhile I think it would be better if I just order two cheap prototype boards at Olimex.

When all checks passed, the PCB will be available in SmashTV's Shop (I'm sure ;))

Best Regards, Thorsten.

Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...

Hey,

I did a small PCB layout for a "ainser8" with only one 4051, since I only need 8 analog ins. Haven't etched it yet, but will do in the next few days...

I connected CH0 of the MCP3208 to Pin 3 of the 4051, and CH1-7 to ground.

Then I noticed in the AINSER64 schematic that CH0 is actually connected to the last one of the 4051s (IC11 / J13), not the first one.

Does this matter at all? Or is it better to use CH7 with a single 4051 setup?

Link to comment
Share on other sites

It means that analog inputs will be available at pin number #56..63 - thats ok

But please note: you don't need a 4051 multiplexer if only 8 channels are required.

You even don't need a 74HC595 for this minimal solution.

Instead you would only need the MCP3208, pots can be directly connected to the 8 ADC inputs!

+ J2, R1, C4, C5, C6 - done!

Normally it's faster to build such a circuit on verboard instead of doing the timeconsuming layout + etching.

Best Regards, Thorsten.

Link to comment
Share on other sites

  • 2 weeks later...

Hey,

I built my small "Ainser8" on breadboard today and it all works perfectly!

At first I wondered why a single pot would send 8 values at a time, but then I figured out that I had to disable all the pins which were on by default.

btw I bought my MCP3208 from Segor, and they have two different versions (C and B, which has slightly better specs) of the chip. In the store I was unsure what to buy so I just got the B version to be on the safe side, but maybe that's not necessary at all.

anyway, no more jitter!

Thanks!

post-6075-0-33694200-1332125289_thumb.jp

Edited by rvlt
Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...