Jump to content

Simple PIC Project? Read a pot, output a value.


nebula

Recommended Posts

The Juno-106 sure has had its share of problems.  The voice chips started to fail way back in the 1980s.  By the last 1990s / early 2000s, another component started to fail:

 

It is the HPF slider.  On the front panel, all of the sliders are 50 K pots, except for the HPF slider, which is a 4-position slide switch.  They have all either oxidized or deteriorated internally, and so they're all failing!

 

Technology Transplant has effectively recreated the slide pots, but no switch is available.

 

Here is my idea:

The pot form factor is VERY similar to the switch.  In fact, it would be pretty easy for an experienced technician to modify the board by snipping the traces from the 4-position switch - then, you could solder a slide pot into its place.  Of course, since we cut all the traces, it won't be connected to anything.  Now, we'll take some wire and solder the top and bottom pins of the pot to 0V and +5V, just like the rest of the pots.  Then we'll create a little circuit that reads the value of the pot, and outputs the value by setting any of 3 pins high.

Position 1 would be from 0% to 24%  of 5V.  For this position, no pins would be high.

Position 2 would be from 25% to 49% of 5V.  For this position, the circuit would set output pin 1 high.

Position 3 would be from 50% to 74% of 5V.  For this position, the circuit would set output pin 2 high.

Position 4 would be from 75% to 100% of 5V.  For this position, the circuit would set output pin 3 high.

 

The output pins would be connected to a CMOS CD4016 bilateral switch, from which 3 switches would be connected to the Juno's panel board.  The only caveat (and it is a small one) would be that the slider wouldn't have that nice "click" into each of the 4 positions.

 

I thought of 3 different ways this could be done:

  1. With discrete voltage divider circuitry for each output.
    Unfortunately this would take a lot of work to get the component values perfect, and you wouldn't want the possibility of gaps between the values (like at 49%, maybe you'd see no output, or maybe you'd see pin 1+2 high at the same time. Bad.
  2. LED bar graph driver like LM3916.
    Set the IC to "dot" mode.  With the correct reference voltage, you could probably set this IC to output in 4 discrete, evenly-spaced steps from 0-5V.  These outputs would be suitable to drive a CD4016 quad bilateral switch.  I don't know, I've never tried one.
  3. PIC microcontroller. 
    I just don't have the experience to program one of these from scratch.  Even though I don't need the power of MIOS, it would probably be easier for me to use a MIOS-programmed PIC, because I could then modify an existing MIDIbox app to achieve this function in a quick-and-dirty fashion.  The PIC should be able to draw power from the Juno's regulated 5V, and it wouldn't need MIDI i/o, so I could probably just build it on a small piece of perfboard instead of a Core PCB.

 

What do you think?  If you wanted to make a simple circuit to replace a 4-position switch with a slide pot, which method would you use?  Or would you use something else (Arduino?  Other?)   If you like the MIDIbox PIC idea, what software would you receommend I start with?

LM3916-datasheet.pdf

Link to comment
Share on other sites

Hi nebula,

#1 I would avoid. Though it could work it would be a pain to setup. #2 is novel but seems like it could be complicated also.

  My preference would be to implement this in a PIC. I have seen this technique used many times to supplement projects, with a single pin you can simulate 4,5 or 6 pins reading switches. This could be designed with one of the low pin count PICs; 3 outputs, 1 analog Input, internal RC Osc, internal MCRL and Vcc and Gnd. Would have to check but I believe there is an 8 pin mid range PIC that fits this list. Very minimal build: the PIC, a filter cap and the wires. 

    It's very simple. Init the device, start an ADC reading cycle, spin in place till it completes, evaluate the reading and output the desired pattern on the pins, repeat.

   While you could do this within MIOS, in some ways it could be harder. Just depends if you are familiar with Asm or more comfortable with MIOS. If you are new to both, I would recommend learning assembly but thats a personal choice.

  Are you able to burn a fresh chip? I could have a go at the code in the next few days if you like and I may have a spare chip around here also :)

Yogi

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...
×
×
  • Create New...