Discuss What is the best signal interface for PC ? in the Electrical Forum area at ElectriciansForums.net

Welcome to ElectriciansForums.net - The American Electrical Advice Forum
Head straight to the main forums to chat by click here:   American Electrical Advice Forum

_q12x_

DIY
Reaction score
212
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.
 
What are you trying to do with it?

Easiest and most universal these days is USB, but it is far from simple/easy to program at a low level. However, most common interfaces come with some sort of driver to avoid that pain, and in some cases it appears as RS232 via an FTDI interface chip.
 
Thank you mister @pc1966 i already discus this problem to death yesterday on another forum and the conclusion was to use an I2C chip. Its a new thing for me so I will shoot 2 rabbits with 1 shot - learning a new method to address multiple I/O's and secondly, making my device. Now I wait for the components to arrive from china via aliexpress. Everything will be hooked up on my arduino uno that I already have near me and is working ok, I made a test yesterday to be sure.
And you are right, usb is the way at least for using arduino, I plan to expand from arduino if possible and program it using my trusty environment in C#. I hope I can do it... its a challenge task.
Thanks for your answer !
 
Just to brag with my current progress so far...hehehehehe
I finished 4 of them at this point. Notice how well they fit inside one A4 page; as a perspective size overall. Im very proud so far.
I worked like a slave for them. With many-many breaks and come backs. I also tested everything, every wire and every led assemble immediately after I soldered. Precaution never killed anyone.
Very cool so far, right?
What is the best signal interface for PC ? IMG_20220729_230051 - EletriciansForums.net
 
Thank you mister @pc1966 i already discus this problem to death yesterday on another forum and the conclusion was to use an I2C chip
I'd agree with that, subject to how many IO lines you need.
Some of the Teensy boards (very similar to Arduino) have a large number of IO pins.
You might also find this helpful when you play with your I2C.

 
...Some of the Teensy boards (very similar to Arduino) have a large number of IO pins.
Im actually interested into the smallest SIZE W/H arduino board that can do the same thing as 'Arduino Uno' that I currently have. This smaller board will stay all the time connected to these boards I made. That's the idea.
Your Teensy board looks very tiny, close to what I want. But your reason showing it to me was because it already has a large number of IO pins on it. How many? One MCP chip has 16xIO pins on it.
 
Im actually interested into the smallest SIZE W/H arduino board that can do the same thing as 'Arduino Uno' that I currently have. This smaller board will stay all the time connected to these boards I made. That's the idea.
Your Teensy board looks very tiny, close to what I want. But your reason showing it to me was because it already has a large number of IO pins on it. How many? One MCP chip has 16xIO pins on it.
I've used the 3.2 model a lot, and that has 34 digital IO pins..
The latest model has 55 digital IO pins.
The other thing I like about Teensy's is that it's VERY simple to make them emulate USB devices such as MIDI, Serial, Keyboard etc and that can make interfacing very simple.

 
I've used the 3.2 model a lot, and that has 34 digital IO pins..
The latest model has 55 digital IO pins.
  • You come VERY-VERY late with these things....This is very bad news for me, because I invested already a lot of money(from my economy perspective) in these MCP's chips alone and also a TON of work time and I only finished half of them. I have another half to finish the whole lot.
  • From another perspective, it is good you mention them to me, as late as it is, is always good to know what else is there. So in this sense, I thank you. But I am not happy, how late they got mentioned. Eh well.
  • By pure curiosity, how much it cost one with 55 IO? Also its complete name and how easy is to program through it? So far, with what I have already, these MCP chips, I am pretty happy how easy the code goes, but Im limited to arduino, which is fine I guess, but my very original thought was to link "somehow" to my C# that Im used to for decades.
 
Heh, scratch that, i didnt look on time on the list of prices&specifications you give me already ! Sorry... but now I find it . Also I can see 58 IO's for Teensy 3.5 and 3.6.
At first impression, I see a slight inconvenience, that 3.3V, but that can be fixed back to 5V with an additional circuit (if becomes a problem). Very interesting devices !!! (A bit too late for me now, but still an eye to keep on them as well)
 
Last edited:
I have to admit I didn't notice your post when it first appeared, and when I saw the update this week I thought the whole thread had been this week.
So, apologies for mentioning another approach at this stage, it was not intentional.
By the way I tend to buy things like this from the hobbytronics website.
I have previously used several MCP23017 chips connected to a micro-controller for a project.
(another way of doing it is with 74HC165 shift registers, but that is a lot more work, balanced by the fact the chips that are cheaper)

Purely for academic interest, the same arduino development environment is used to program Teensy boards.
I wish you well with your project and it's looking very good!
 
Also... over 1h long movie, that is covering about 11h of hard work in one night to make a single board like this. If you are curious what it takes to be made, the patience, dedication and too numerous hidden skills, see it here. Also, you can skip parts of the video if something is too boring, because this is 1h long and is good to be smart about it. Thank you.
 
Last edited:
Mister @timhoward , you are good.
I am VERY Curious how simple your code is for the Teensy 3.2 board. Put here an example for me, please. Something small and simple. Like a test code.
Here is my test code I used called "movingLight" in the video, using the MCP chip through Arduino:
This code is only for 2 boards, not 4.
#include <Adafruit_MCP23X17.h> //this include is using Adafruit-MCP23017-Arduino-Library version 2.1.0 (from 2022)
Adafruit_MCP23X17 mcp1; //Instantiate mcp1 object
Adafruit_MCP23X17 mcp2; //Instantiate mcp2 object

void setup()
{
Serial.begin(19200);
mcp1.begin_I2C(0x20);
mcp2.begin_I2C(0x21);

/* configuring ALL GPIO as output. */
for(int i = 0; i <= 15; i++)
{
mcp1.pinMode(i, OUTPUT);
mcp2.pinMode(i, OUTPUT);
mcp1.digitalWrite(i, LOW);
mcp2.digitalWrite(i, LOW);
}


int dly = 100;
void loop()
{
for(int i = 0; i <=15; i++)
{
mcp1.digitalWrite(i, HIGH);
delay(dly);
mcp1.digitalWrite(i, LOW);
delay(dly);
}

for(int i = 0; i <=15; i++)
{
mcp2.digitalWrite(i, HIGH);
delay(dly);
mcp2.digitalWrite(i, LOW);
delay(dly);
}

}
 
Last edited:
Here's a quick copy and paste from a very old project
Code:
void setup() {
  Wire.begin();
  seti2cbyte(device,GPPUA,0xFF);  //enable pull-up resistors on port A
  seti2cbyte(device,GPPUB,0xFF);  //enable pull-up resistors on port B
}

byte geti2cbyte(byte address, byte ptr) {
  Wire.beginTransmission(address);
  Wire.write(ptr);
  Wire.endTransmission();
  Wire.requestFrom(address, 1); // request one byte of data from MCP20317
  byte inputs=Wire.read();
  return inputs;
}

void seti2cbyte(byte address, byte ptr, byte value) {
  Wire.beginTransmission(address);
  Wire.write(ptr); // set MCP23017 memory pointer to GPPUA address
  Wire.write(value); // enable pull up resistors
  Wire.endTransmission();
}

void loop() {

  byte port_a = geti2cbyte(device,GPIOA); //get status of pins 1-8
  byte port_b = geti2cbyte(device,GPIOB); //get status of pins 21-28

//do something....

}
 
(here is the blog post from 8 years ago that the code is an excerpt from:


_
 
mister @timhoward in the comments of your code I see its for MCP23017
Is this really for your Teensy 3.2 board ? oooor... this teensy is using already an MCP23017 inside it????
ooor, you used the teensy with an MCP 23017 like in the second link example you give me? I think this last one may be it.
And also it appears that your code is made in C++ ? Not in arduino.
 
Last edited:
mister @timhoward in the comments of your code I see its for MCP20317
Is this really for your Teensy 3.2 board ? oooor... this teensy is using already an MCP20317 inside it????
And also it appears that your code is made in C++ ? Not in arduino.
Teensy connected to MCP20317 like this:

What is the best signal interface for PC ? 1659309640372 - EletriciansForums.net

I can't remember what I wrote it in, sorry. It was definitely written using the arduino development environment, with the Teensy board selected.
 
Thank you very much for the code and the explanations... I like it !
This will be a "plan B" that I have to put my hands on it and try it, because practice is the best teacher for me.
Very intriguing board and very new (for me ) !
Thank you !
I regret I didn't knew about your Teensy boards before buying the MCP's, but...its an experience I will never forget at least.
 
Last edited:
mister @timhoward these Teensy boards, can be linked in series like my MCP's? One after another? or each has to be addressed through USB?
Can you put here a short pro and contra comparation between MCP and Teensy ? Talking from your experience of course, what you like/dislike on both. It will help me see more clearly through your experience. Thank you.
 
I think there’s a fundamental misunderstanding. I believe you are using an Arduino to connect to your boards using I2C protocol.
I am using Teensy to do exactly the same.
Both Teensy and Arduino are very very similar in lots of ways including sharing the same IDE.
The reason I went for Teensy is that you can make it present itself to a PC as a midi device or a keyboard. It also had more IO pins. This suited my application perfectly. My code can send MIDI messages to the PC (or can emulate key presses).

Unless you were starting completely again without MCPs relying entirely on IO pins that were on the microcontroller I can’t see any reason to swap now.
Sorry if this line of conversation has been a pointless distraction, I had thought it was a more recent post and thought the Teensy technology might help.
 
New posts

Reply to What is the best signal interface for PC ? in the Electrical Forum area at ElectriciansForums.net

OFFICIAL SPONSORS

Electrical Goods - Electrical Tools - Brand Names Electrician Courses Green Electrical Goods PCB Way Electrical Goods - Electrical Tools - Brand Names Pushfit Wire Connectors Electric Underfloor Heating Electrician Courses
These Official Forum Sponsors May Provide Discounts to Regular Forum Members - If you would like to sponsor us then CLICK HERE and post a thread with who you are, and we'll send you some stats etc

Electrical Forum

Welcome to the Electrical Forum at ElectriciansForums.net. The friendliest electrical forum online. General electrical questions and answers can be found in the electrical forum.
This website was designed, optimised and is hosted by Untold Media. Operating under the name Untold Media since 2001.
Back
Top
AdBlock Detected

We get it, advertisements are annoying!

Sure, ad-blocking software does a great job at blocking ads, but it also blocks useful features of our website. For the best site experience please disable your AdBlocker.

I've Disabled AdBlock