Jump to content

Analouge multiplexer issues


monkeyboy
 Share

Recommended Posts

Hi,

I am attempting to implement a midi box using a PIC16F877A and am having issues with a 74HC4051 8 channel analouge multiplexer.

If i read the POTs straight into the ADCs multiple channels then all works as expected but as soon as i put the multiplexer in the following problems occur:

1. POTs appear to be affecting the values of other POTs (even though the input voltages are not)

2. most of the POTs dont go up to max value 7F but linger around 60 even when they are on 5v

3. A small fluctuating effect which wasnt present when reading directly into the ADC (even though the same circuit is connected)

have tried slowing down sample rates, putting delays between selecting pots and reading them.

all have not helped at all

any pointers greatly appreciated!

thanks

Link to comment
Share on other sites

I am attepting to implement my own code in C as i would like to have the knowledge of how to do it,

and am finally there apart from this  :)

i assume from your reply that this site is only for people having problems with MIOS,

and not for anyone just trying to make a box of midi dials and buttons?

Thanks anyway,

Dale

Link to comment
Share on other sites

i assume from your reply that this site is only for people having problems with MIOS,

and not for anyone just trying to make a box of midi dials and buttons?

mainly it's intented for MIDIbox users, but of course, you can also ask general questions.

In this case it's just useful to know, that you are not using a MIDIbox (in this case I would at least know, that it wouldn't be a software problem ;-))

So, I guess that you are having two main issues.

Software issue: you have to eliminate the 1/2 bit LSB error of the ADC. The easiest way is to propagate value changes only, when the difference between the last, and the new sample is higher than a certain value. By doing so, you will create some kind of deadband, in between changes are not sent (in MIOS this feature is configured with MIOS_AIN_DeadbandSet).

Then higher the jitter, then higher the required deadband.

A deadband will reduce the resolution, but for common MIDI values (which are 7bit) this doesn't matter anyhow.

Hardware issue: do you have a schematic of your circuit?

Best Regards, Thorsten.

Link to comment
Share on other sites

Hi,

Sorry long time for reply, have been away for a while,

am very happy to hear you give non MIOS uses help  :)

here is the schematic,

%7Boption%7D

have tried de coupling the 4051 but didnt seem to help either

there is also buttons in the circuit but i am certain they are not the cause of the problem (hard or soft),

thanks,

Dale

Link to comment
Share on other sites

Hi Dale,

the input which you've marked with STROBE# (pin #6) is not a strobe, but an inhibit signal, which switches off all transmission gates. This signal should be 0 so long an ADC conversion is running, and it's save to let it 0 the whole time (in my own circuit I tied it to ground).

But propably the main problem is that you didn't take the required setup time of the ADC into account: once you've switched to a new input, you have to wait for a certain time before the next conversion can be started, otherwise the voltage at the S&H unit of the ADC is not stable.

In MIOS I've realized a two-step timer driven conversion. An ISR is called each 100 uS, at the first step a new 4051 input is selected, 100 uS later the conversion is started. The value of this conversion is available with the next call of the ISR. The timer delay can be reduced of course, but this would load the CPU much more than really required (no timeslots for other tasks)

Before MIOS I used a method w/o ISR - after the selection of the 4051 input, a dummy conversion was started, just to get some delay. Thereafter a second conversion was started to get a stable value. However, this loads the CPU much more than required, but it's easier to realize

Best Regards, Thorsten.

Link to comment
Share on other sites

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...