What is the best signal interface for PC ?

Thread Starter

q12x

Joined Sep 25, 2015
965
I mean.... the best and the easiest to use.
I remember back in the 2000's I used a serial interface, I think it was the printer serial port, 25 pins or similar. I believe I even used a mouse port as well, that versatile those systems were back then.
What I could do with it was ... program in C++ and pascal back then, using some imported dll's specific for communication with this serial port, I think it was port 40 or 25? It had a number is all I remember. And I could link to it any transistor base, back then I was working exclusively with BJT's, to light LED's, drive motors, beep some 8ohm I think they were speakers, drive a VU-meter LED bar I think directly from the port pins, without transistors, and also drive IC's , that was the time I learned about multiplexers and expanding the number of output pins. Also input sensors like LDR and buttons. I Loved that kind of easy and straight forward communication.
Today I dont know c++ or pascal anymore, but I am very good in c# and still use VS2010 because its very cool interface and very user friendly overall.
So I want you, to help me first of all, to find the hardware, the port I suppose or something more than a printer port, something more advanced and having more in/out's. The more the better. I want the best you can find for the moment. Best ideas or best adaptations, why not. As long as it's easy and stable to install and use.
And then, the software drivers and possible problems will appear along the way. I can debug a large majority of problems, I grow up debugging computer problems, so I have a 5'th sense for them. Im more concerned about the hardware part and the integration with my win7 that I still run today and my VisualStudio2010 for my c#. I know I still run old software but they are extremely stable and they don't f me up.
Thank you and I'm really curious what you will find for me.
 

MrSalts

Joined Apr 2, 2020
1,832
I mean.... the best and the easiest to use.
I remember back in the 2000's I used a serial interface, I think it was the printer serial port, 25 pins or similar. I believe I even used a mouse port as well, that versatile those systems were back then.
What I could do with it was ... program in C++ and pascal back then, using some imported dll's specific for communication with this serial port, I think it was port 40 or 25? It had a number is all I remember. And I could link to it any transistor base, back then I was working exclusively with BJT's, to light LED's, drive motors, beep some 8ohm I think they were speakers, drive a VU-meter LED bar I think directly from the port pins, without transistors, and also drive IC's , that was the time I learned about multiplexers and expanding the number of output pins. Also input sensors like LDR and buttons. I Loved that kind of easy and straight forward communication.
Today I dont know c++ or pascal anymore, but I am very good in c# and still use VS2010 because its very cool interface and very user friendly overall.
So I want you, to help me first of all, to find the hardware, the port I suppose or something more than a printer port, something more advanced and having more in/out's. The more the better. I want the best you can find for the moment. Best ideas or best adaptations, why not. As long as it's easy and stable to install and use.
And then, the software drivers and possible problems will appear along the way. I can debug a large majority of problems, I grow up debugging computer problems, so I have a 5'th sense for them. Im more concerned about the hardware part and the integration with my win7 that I still run today and my VisualStudio2010 for my c#. I know I still run old software but they are extremely stable and they don't f me up.
Thank you and I'm really curious what you will find for me.
USB to serial adapter - FT232 (preferred) or CH340 (code will be up to you)
or
Use the C++ and widely available libraries for Arduino development boards ($3 to $20)
Arduino has its own IDE that is very well developed and reliable. Thousands of libraries (one for any device you want to connect is likely available).

Arduino with on-board FT232 USB-Serial (genuine Arduino is preferred - clones often have CH340)
or
ESP32 development board with on-board USB to serial adapter chip
or
ESP32 board and communicate with wifi

Best and Easiest to Use would be an "Arduino Nano Every" As the first attempt.
super easy, lots of IO and standard communication protocols from there (UART, SPI, I2C, ).
 

Thread Starter

q12x

Joined Sep 25, 2015
965
Yes, I love your options mister @MrSalts !
I just searched for: USB to parallel adapter and is very interesting !!! I was searching originally, just before writing this post on this forum, for boards. But I think I love more the idea of a simple cable with the parallel port ready. Something like this picture:
1654659556379.png
Now... my target is to have 100 I/O ports ! I know, I'm crazy, but I like freedom of expression !!! Haha
This parallel port has 25 pins already.... so theoretically if I link 4 of them I will have those 100 I/O, but on different port numbers I guess and in program it will be a bit messy. So back to strategic board here, help me find a solution, whatever it is, I dont care what brand or how it looks, all I care is expandability - scalability. You are with me? Something that I can LEGO it, board on board and get those 100 I/O or even more, why not. And ideally from a single port number. And very preferably, to be able to do it from my c# environment that I am very comfortable to work into. But I will trade for Arduino as well.... for the moment. Just to find that combination first. I think they may be ways to port into c# after.
 

Thread Starter

q12x

Joined Sep 25, 2015
965
mister @MrSalts , I totally forgot to mention that I have an arduino Uno already, that is what google results give me for your "Arduino development boards". I thought development boards will have already those 100 pins... and be bigger. I know they were in the past but they were extremely expensive.
- I really dont know how to make 100 ports from my arduino Uno. I can make my own boards, no problem, using IC's to expand the total number of pins.... its an idea I have.
 

MrSalts

Joined Apr 2, 2020
1,832
Yes, I love your options mister @MrSalts !
I just searched for: USB to parallel adapter and is very interesting !!! I was searching originally, just before writing this post on this forum, for boards. But I think I love more the idea of a simple cable with the parallel port ready. Something like this picture:
View attachment 268972
Now... my target is to have 100 I/O ports ! I know, I'm crazy, but I like freedom of expression !!! Haha
This parallel port has 25 pins already.... so theoretically if I link 4 of them I will have those 100 I/O, but on different port numbers I guess and in program it will be a bit messy. So back to strategic board here, help me find a solution, whatever it is, I dont care what brand or how it looks, all I care is expandability - scalability. You are with me? Something that I can LEGO it, board on board and get those 100 I/O or even more, why not. And ideally from a single port number. And very preferably, to be able to do it from my c# environment that I am very comfortable to work into. But I will trade for Arduino as well.... for the moment. Just to find that combination first. I think they may be ways to port into c# after.
Looks like you've found an answer that fits your ecosystem of knowledge and comfort. In the end, it all seems to come back to Serial (USB) to some break-out of addressable pins. Another option is a raspberry pi with the 40-pins on the header all addressable. From there you can parallel the Pis to get as many I/O pins as you want. Not going to be C# but C/C++ or even Python are easy enough to learn.
 

MrSalts

Joined Apr 2, 2020
1,832
mister @MrSalts , I totally forgot to mention that I have an arduino Uno already, that is what google results give me for your "Arduino development boards". I thought development boards will have already those 100 pins... and be bigger. I know they were in the past but they were extremely expensive.
- I really dont know how to make 100 ports from my arduino Uno. I can make my own boards, no problem, using IC's to expand the total number of pins.... its an idea I have.
The idea of individual pins has fallen by the wayside. Now you can use four pins to make a bus (I2C on the Arduino) and each device you connect to the bus has an address (two hex digits) and you can pull data from each one - up to 127 devices I think (and you can add I/O expanders - as I2C devices if you really want your 100 pins. But, I really like smaller boards with a good I2C bus or SPI (faster) bus. SPI uses chip-select lines and Data/command lines so it gets a bit messier.
 

Thread Starter

q12x

Joined Sep 25, 2015
965
The idea of individual pins has fallen by the wayside. Now you can use four pins to make a bus (I2C on the Arduino) and each device you connect to the bus has an address (two hex digits) and you can pull data from each one - up to 127 devices I think (and you can add I/O expanders - as I2C devices if you really want your 100 pins.
@MrSalts Ok...excellent answer, "I knew that!" haha, im joking, well I knew it is possible but literally how to make it, that is still the ? question for me. So... how to do it like you said it? By the way, this is probably my first I2C bus I will build. So please give me good resources to follow. I will ask on the way as well.
My arduino Uno is ready right now. I literally took it out from its drawer, plug in the board and install its software and run a blinky program from its examples. And everything is working fine.
Lets make those 100 In/Out's !!!!
 

Thread Starter

q12x

Joined Sep 25, 2015
965
I tried to remember how many IO pins I have on this board. And by the way this is exactly the same board I have in reality, the same SMD procesor/MCU and SMD led's. From ebay and is working great. My board is powered directly from a USB Hub. Not from external PSU.
So in total are 19 IO pins ? im not very sure.. I think they must be only IN and only Out some of them. In total are 30 pins, counting the supply pins as well. I call "pin" only those black square plastic holes. Aparently they call it 'pins' as well so I'm good.
For more help along the way, here is a very good map of the pins numbers and names that I have it saved in my installation kit folder:
I can see what you said about I2C , there are 4 dedicated pins for it, it appears. 2 on the left down corner and 2 on the top right corner.
I really dont know how to use them or to address them.
arduino UNO R3 myBoard -pinout 2.jpg
 
Last edited:

MrSalts

Joined Apr 2, 2020
1,832
You can use up to 8 chips like below on your I2C bus.
https://www.adafruit.com/product/732
You are limited to 8 because there are three pins on the chip that you can use to set the address (2^3=8). Each chip has 16 usable I/O pins as digital in/out. That will give you 128 total digital pins by simply using the 2-I2C pins on your Arduino UNO. Plus your UNO has some ADC pins and more.

what are you building that needs so many i/O pins?
 

Thread Starter

q12x

Joined Sep 25, 2015
965
Thank you very much for your help @MrSalts ! I really appreciate it. So these IC's are linked only to 3 I2C pins on my arduino Uno board. I think I get it. Again, this is my first introduction to what I2C means and is doing. Very new to me. Thank you a lot for your kind help. It means a lot to me.
what are you building that needs so many i/O pins?
Nothing really important. Like I said before, its good to have many options available. It's more to have scalability than anything.
It's an idea I had and probably very much influenced by the old development boards I was looking on internet in the early 2000's and couldn't afford sheit. Its an old desire and old thought I carry. Now you understand.
- For more craziness and more scalability... can I put more after those 128 final IO's ? taking more MCP23017 chips and making an 1028 IO's? Theoretically it should be possible, right? The speed will be slowed down I imagine will be the only problem, but I will be very happy to get at that stage first. Haha.
 

Thread Starter

q12x

Joined Sep 25, 2015
965
@MrSalts listen to this (literally 14 seconds) (starting from 0.48):
"up to 8 MCP23017 can be chain together for a total of 128 pins"
Hmmm... that is terible expensive.... and also ONLY limited to 8?
I looked into MCP23017 datasheet and is from Microchip !!!
I believe you and this presentation guy said the exact same thing that I highlighted with blue in the picture I took from the MCP23017 datasheet:
1654665684559.png
And I start to understand the idea now. These chips have only 16 IO pins on them so 16*8=128 IO pins. Now I totally get it. Ha....
So for my crazy idea with 1024 pins, I would have need a total of 64 blody chips? Ohohoa...yah, now I get it. Also only with 8 IC's is very expensive already.
Microchip is a very expensive brand.
$7 * 8 MCP23017's = $56 - ohoa.
Aren't other cheaper brands out there to do the same task? Or simpler solutions maybe? Using logic gates perhaps? I am really totally uneducated in this side of data transfer thing, so please slap me with the correct answer.
Thank you again, Very interesting results so far. I like it... although a bit too expensive... hmmm.
 
Last edited:

MrSalts

Joined Apr 2, 2020
1,832
Thank you very much for your help @MrSalts ! I really appreciate it. So these IC's are linked only to 3 I2C pins on my arduino Uno board. I think I get it. Again, this is my first introduction to what I2C means and is doing. Very new to me. Thank you a lot for your kind help. It means a lot to me.
Actually, you only need ground, 5v, plus the clock and data pins from your UNO.
https://docs.arduino.cc/learn/communication/wire
 

Thread Starter

q12x

Joined Sep 25, 2015
965
The previous price from adafruit.com were $7 per chip so $7 * 8 MCP23017's = $56 - ohoa. I believe it is like that because its DIP package.
1654667212926.png
Hmmm this latest price is a bit more reasonable, from digikey.com , and I looked and is Surface Mount package. That might be the reason for the difference in price.
1654666855446.png
 
Last edited:

Thread Starter

q12x

Joined Sep 25, 2015
965
Is it possible to convert c# code into Arduino?
Or better,
Code directly the Arduino board pins from c# environment of VS2010?
 

Thread Starter

q12x

Joined Sep 25, 2015
965
@MrSalts thanks so far !!!
I finish read the arduino link for I2C you give me. I understood something, but not all, I have to do something practical with it to completely learn it's power/capability. ( from the reading, AD5171 Digital Potentiometer is interesting chip)
I also read the wiki I2C page. VERY informative.
You really hit the nail in its head suggesting the I2C method. Its exactly what I need. Now... how to escape with cheaper price, at least 100 IO pins and using c# environment. Very challenging...
I expect other opinions, other ideas, this post will stay here for awhile, and if something else pop out, it will be awesome. Its an open question until I decide to buy anything. I higly encourage you, anybody, to post your ideas.
 

Thread Starter

q12x

Joined Sep 25, 2015
965
Another idea I have is to use Demultiplexers.
I believe is a much more cheaper way of having a lot of outputs ! No (feedback) inputs though.
- What is the best demultiplexer that you can recommend? Best, by # of pins ofcourse.
 

MrSalts

Joined Apr 2, 2020
1,832
The previous price from adafruit.com were $7 per chip so $7 * 8 MCP23017's = $56 - ohoa. I believe it is like that because its DIP package.
View attachment 268976
Hmmm this latest price is a bit more reasonable, from digikey.com , and I looked and is Surface Mount package. That might be the reason for the difference in price.
View attachment 268975





i guess you'll have to balance the complexity of a single set of I2C addresses vs the complexity of arrays of multiplexers (depending on the pin assignments used from the Arduino. But the price of through-hole chips and doubling or quadrupling the number of chips needed (and the time and PCB space to mount (and design all of the traces) for those chips ) can create its own complexity. Remember that the I2C bus is easy in both the code design and the board design (a single bus and two wires to each chip (plus power). $20 is much of a price to pay for the 100 I/O pins. But, in the end, chip price, PCB price, time, code complexity, PCB design complexity and the chance of wiring & code errors are all trade-offs that each person must make on their own.

School children are using Arduino every day based on thousands of example "sketches" on the interwebs. I'm sure you can manage the learning curve.
 
Top