Multiple digital inputs to one output

Thread Starter

PapaWacc

Joined Sep 14, 2018
4
I need to be able to expand my inputs on a PIC it has 3 analogue inputs, ideally an IC which has around 8 inputs to one output in the form of 1-wire, serial, I2C or just an analogue signal. The PICs I can use are Genie 18 or Genie E28. I have tried using a resistor network with switches in circuit wizard which wouldn't work as when any of the switches were pressed the voltage would just act as a digital input at the full 6v instead of different values for each switch. (https://i0.wp.com/www.g7smy.co.uk/gallery/var/resizes/blog/resistor_ladder2.png)
 

KeithWalker

Joined Jul 10, 2017
3,097
I have only ever used pics in digital applications. I checked the use of the analog pins and the only applications I could find used the inputs as comparators. I can not find a way to read the voltage level. This is not what you need.
I have used arduinos extensively for analog measurements. Each of its 10 analog inputs has a built-in 10 bit adc. The voltage on a pin can be read using a simple "analogRead" command. Arduino micro clones are available for a few dollars.
http://www.farnell.com/datasheets/1685581.pdf
 

AnalogKid

Joined Aug 1, 2013
11,055
What is the voltage range of the analog signals?

What is the max frequency?

Are these specific signal types, like audio or a temperature sensor?

What power voltages are available to run the multiplexer?

ak
 

Reloadron

Joined Jan 15, 2015
7,523
I have used arduinos extensively for analog measurements. Each of its 10 analog inputs has a built-in 10 bit adc.
Does each analog input have its own 10 bit ADC or do the analog channels get multiplexed on board the chip to a single ADC? The designation PIC:
PIC is a family of microcontrollers made by Microchip Technology, derived from the PIC1650 originally developed by General Instrument's Microelectronics Division. The name PIC initially referred to Peripheral Interface Controller, then it was corrected as Programmable Intelligent Computer.
So if a PIC is a Programmable Intelligent Computer then isn't an Arduino a PIC? Just a different manufacturer?

Ron
 

Thread Starter

PapaWacc

Joined Sep 14, 2018
4
https://www.genieonline.com/files/genie-18-microcontroller.pdf

https://www.rapidonline.com/pdf/13-6005.pdf

They're the PICs I have available.

I can get a multiplexer to work the way I want by using something like a 4510 and counting up the 4051 inputs while keeping my PIC tracking each pulse using a variable.

I don't want have to check if a specific input each time, the easiest way to explain what I want is each input mapped to a value which I can compare to see if it's on or off e.g button 1 = analogue value 1, button 2 = analogue value 2.

Thanks for all replies.
 

Reloadron

Joined Jan 15, 2015
7,523
https://www.genieonline.com/files/genie-18-microcontroller.pdf

https://www.rapidonline.com/pdf/13-6005.pdf

They're the PICs I have available.

I can get a multiplexer to work the way I want by using something like a 4510 and counting up the 4051 inputs while keeping my PIC tracking each pulse using a variable.

I don't want have to check if a specific input each time, the easiest way to explain what I want is each input mapped to a value which I can compare to see if it's on or off e.g button 1 = analogue value 1, button 2 = analogue value 2.

Thanks for all replies.
OK, I get it. Just a short read and these little micro-controllers bear a similarity to the PICAXE line of micro-controllers. The PICAXE use PIC Basic and these use Geni Basic. Just forms of basic. IF you have 3 I/O lines available you can eliminate the use of a 4510 and just address the 4051 directly. Just increment a binary count using 3 I/O pind as a Digital Out. Count 0 through 7 and reset, do it again.

Ron
 

Thread Starter

PapaWacc

Joined Sep 14, 2018
4
OK, I get it. Just a short read and these little micro-controllers bear a similarity to the PICAXE line of micro-controllers. The PICAXE use PIC Basic and these use Geni Basic. Just forms of basic. IF you have 3 I/O lines available you can eliminate the use of a 4510 and just address the 4051 directly. Just increment a binary count using 3 I/O pind as a Digital Out. Count 0 through 7 and reset, do it again.

Ron
Yup, that's the idea I had in mind although I need to read from 24 buttons so I'm planning on using 3 of these hence the 4510. It would be ideal for a single IC to do this though. Thanks for the reply.
 

Reloadron

Joined Jan 15, 2015
7,523
Yup, that's the idea I had in mind although I need to read from 24 buttons so I'm planning on using 3 of these hence the 4510. It would be ideal for a single IC to do this though. Thanks for the reply.
You could look at cascading a few 16 channel MUX chips like the CD74HC4067 shown here on a breakout board. Another option you may want to consider for 24 channels is reading your switches as a matrix. The Matrix is where your micro controller scans your switches as columns and rows.I just don't know how it would be coded with the chips you have. Matrix might be a viable solution as you are only looking at zero or one.

Ron
 

danadak

Joined Mar 10, 2018
4,057
PSOC 4 low end can handle this quite easily. Shown is low end part.
Also onchip is UART, various serial busses, to get the data out.

PSOC 5LP can add digital filter to LPF the data, and tons other stuff,
USB, DMA, LCD....

If 12 bit SAR not enough resolution PSOC 5LP also has 20 bit DelSig.

Attached is component list. A component is an onchip resource. The
list is for 5LP, 4 has less capability but still many of the functions.

See attached project.

If you want to do buttons via capsense both 4 and 5LP support capsense
on pins.


Regards, Dana.
 

Attachments

Last edited:
Top