Potentiometer DIP switch?

Go To Last Post
12 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have an AVR project where most all my I/O is used up. But, I still need to add an address selector like a BCD or hex switch. I have an available A/D channel and was thinking there could be a pot out there with 10 or 16 detents that could be used.

I did some google searching and found some patents for the idea, but no actual components. Has anybody seen such an animal?

The problem is that if one actually exists, it'll probably be cheaper to upgrade the micro than to upgrade the switch. The switches I'm looking at all cost more than the micro in the first place. That really grinds my gears.

Thanks,

Mike.

official AVR Consultant
www.veruslogic.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A hct165 ??

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A normal rotary switch which selects between different resistances so this determines what voltage to feed to AVR?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There have been posts on this before--try to search them out.

For a few address switches, you can make a resistance ladder and read the resulting voltage and decode. Others have reported doing quite a few switches/levels that way.

[If you add say $0.10 cost per resistor/board space/mounting/etc. then if you had x5 say--how mych more does the next bigger AVR cost you?]

If you only have a couple of switches then share some of your app pins. Use a diode on each to separate them. Run them into a single AVR "common" pin that is made a low output at startup and high-Z otherwise.

If you have a bank of LED or a 7-seg or similar the whole bank could be used that way at startup.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In the October 2nd issue of EDN a Design Idea was posted that used
only a single I/O pin to read a 74HC165 Parallel-Load 8-Bit Shift Register.

Microcontroller inputs parallel data using one pin

The article is best viewed in the pdf version from the linked page.

Stan

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

the 1-wire 74HC165 is a nice idea if it does not need to be read very often, like only once after powering up. I'd hate to think if interrups would mess the read, or if interrupts are disabled during the read, some important interrupts are missed.

I'd just put there a 4-bit dip switch and five resistors so the AD channel can read 16 different levels.

Even if it was not an AD pin, you could read the resistance by discharging a capacitor and measuring time of discharge, but it would be less accurate maybe.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How about 9 1K resistors in series and an 8-position dip switch? Connect each switch to one of the taps on the resistive divider string. Connect all other sides together and to ADC input.

Dip switch will cost you more than the upgrade to a larger AVR, betcha.

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ka7ehk wrote:

Dip switch will cost you more than the upgrade to a larger AVR, betcha.

Well, no matter how large AVR, he still needs some way of setting the address - like a DIP switch :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

EDIT: I posted the wrong thread!! There was a thread where daqq was looking for a a ten step pot and now...I have lost the thread!! Maybe David will remember his request and post the link!!

John

Just some guy

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for the suggestions. The problem with getting more pins is that it comes with more flash as well. So, to upgrade to a larger part increases the micro cost by 90%. For a 50% cost increase, I can add an 8 pin part to handle the DIP.

However, my question was "Has anybody seen a pot with 10 or 16 detents?" We all seem related, because I have the same character trait.

Thanks,

Mike.

official AVR Consultant
www.veruslogic.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, there are pot like rotary switches with 10 or 16 detents/positions, but they output a binary code. With a couple of resistors you can make an analogue value of this.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jayjay1974 wrote:
Yes, there are pot like rotary switches with 10 or 16 detents/positions, but they output a binary code. With a couple of resistors you can make an analogue value of this.

Where couple means four resistors in case of binary code output, and 10 if you use normal 10 position rotary switch.

And since the rotary switch connects resistors together in different configurations, what you get out of it is a resistance, like in a potentiometre, and you can do whatever you want with the resistance, like convert to voltage with another resistance and feed to ADC.