What is the best signal interface for PC ? | on ElectriciansForums

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

_q12x_

DIY
Joined
Jan 22, 2021
Messages
587
Reaction score
212
Location
New York
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?
[ElectriciansForums.net] What is the best signal interface for PC ?
 
...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:

[ElectriciansForums.net] What is the best signal interface for PC ?


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.
 
Thank you mister @timhoward, and thank you for replying back.
  • Do not overthink it, every bit of new information for new tools is gold for me. Yes, I present in my movie I posted here in this thread, that I work in arduino and I also posted a recent code I already used also made in arduino. What is very novel to me is this teensy boards. I start to believe, from your last explanations, that arduino Board and teensy Board are 2 similar things but made by different companies. I think I get it now. The difference between arduino Uno and Teensy 3.2 is more IO ports and also your MIDI encoding system that you mentioned.
  • My target for my project, that I probably failed to mention in this thread, is to have 100 (or more) IO's. So far, using my arduino Uno board, 8xMCP23017 (8 being maximum allowed), and the I2C communication between all of them, I can reach to 128 IO's in the end. Which means the project mission is completed succesfully and in parameters. Not there yet, right now Im at 50% of the building process, literally, which took me a ton of time, because , again, I present it already in my last movie I posted in this page, I make everything manually and is hell, but is also --possible--, to model the board as much as I like. Its very hard to do it my way, but also very intuitive and customizable.
- Your idea was a good one, and now I understand is something of an alternative but for arduino board itself.
- My question to you, or anyone really, is how you will make 100 (or more) IO's ? Excepting 8xMCP23017 because Im into them right now. So an alternative to them somehow. Also to be easy to wire them up, and also easy to code them.
Thank you.
 
I would be looking at being somewhat more specific with the IO count and potentially using a scanning solution.

For example, the Max6818 debouncer has a change output line (to indicate it a change in state has been detected) and an output enable line (which resets the change indicator), so you could use those in combination to scan a number of inputs. 8 bits for the data lines, say 4 bits for the change detection (which you should be able to hook up to trigger an interrupt) and then say 4 bits to drive the enable lines. 32 debounced inputs with 16 bits of IO, but you could reduce the IO count if you just want to scan them and do the change detection yourself. 16 bits could then get you 64 debounced inputs.

But it all comes down to how general purpose you want the interfacing to be. If you can specify you want X number of inputs and Y number of outputs then you could probably optimise quite a bit.

A different microcontroller could provide more direct IO... the PIC18F97J94 for example can have upto eleven 8 bit I/O ports available (depending on what other on-board peripherals you are using). Clearly, if you use things like the SPI/I2C interfaces you're going to loose some of that, but depending on whether you really need that many outputs, depending on what you're driving there may be a single chip solution.

Another option could be a CAN bus based solution. I believe Microchip have a general purpose IO chip that literally just connects to a CAN bus and will send messages when inputs change or set outputs when it receives a message. It's a been a long time since I've looked seriously at any of this, but much of the design work I did was very targeted, meaning I had specific IO counts.
 
This is me in HERO mode. All 4 at once. The last 4. After they are finished, I will complete the entire project.
This picture is all 4 drawn and 1 of them starting to get metal pads.
[ElectriciansForums.net] What is the best signal interface for PC ?

This is all 4 starting to get some wires on them. You can see the small diagram, where I marked with red, the location and how many wires are placed at this stage. Very hard work I tell you, but it is possible, is all that I can show here.
You can also see my dezizolator machine, without it I could not start this project.
[ElectriciansForums.net] What is the best signal interface for PC ?

Pretty cool so far. Im working with numerous breaks because this is more intense than usual.
Thank you.
- Im also curious if is a possibility to replace arduino UNO that I have, with a --permanent smaller board--, more compact in size, but essentially to do exactly the same thing this UNO is doing. Is it possible? I am no expert with arduino, this UNO board is all I have all my life, but watching some youtube videos, it appears that it is possible as I say. If not, then I think on an alternative that is a bit more crazy, to buy the arduino UNO MCU, program it with this UNO code, and use only the pins I need, just to cut down in size. But I really think it is possible with somethng already made, like PICO or something. Which is the smallest you recommend?(but doing the same thing as UNO) Thank you !
 
q12x: Good morning from London. I have just read through this thread. You never fail to impress me. I am glad some other top folk are engaging with you as you work through your project. What is the final outcome please?

PS: I am not engaging because as you know I spend quite a bit of time helping another chap.
 
q12x: Good morning from London. I have just read through this thread. You never fail to impress me. I am glad some other top folk are engaging with you as you work through your project. What is the final outcome please?

PS: I am not engaging because as you know I spend quite a bit of time helping another chap.
Good morning London, here is Romania. Over. Haha.
Hello, it is no problem, and thanks for the comment mister @marconi . The final outcome of this project is very simple. I will have 100x I/O's from my PC that I can play with. I've already put LEDs on each IO pad, so when a pad is activated, it's corresponding LED will light. And because this is a digital communication, this means everything will be at its extremes, either +5V or 0V, but nothing in between as in an analog situation. Im not sure (yet) how some analogue Input will be resolved.... like a button, LDR, senzors,(if I will have to put in the middle some ADC- I hope not) but for sure the Output will be a train of digital impulses so the extremes, +5&0V. Because all this arrangement is quite new to me (the MCP chips + Arduino) and very different from the old way I did it back in 1995-2005-ish times, with a 20 or something IO's back then and I said "I want more IO's !!!" but never get to it. Now, this is that wish, from back then, 55% in reality. And I think is very cool !
I hope is clear enough now.
 
Last edited:

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

Similar Threads

  • Question
I am missing something important and I have no idea what. This cct is working fine in Sim. But in Reality is working with errors. Some other...
Replies
7
Views
2K
  • Question
Post in thread 'Domestic - Voltage fluctuations on a 1000VA 600W UPS with 40% load when on battery' by kuddoo has been reported by kuddoo. Reason...
Replies
0
Views
89
I hear many views of people who believe that DPF's and CDPF's fitted to their vehicles are a problem and many people resort to removing them, or...
Replies
0
Views
8K
  • Question
Yes, when thinking of using an MK module "TWIN OUTLET TV/FM DIPLEXER":-...
Replies
7
Views
14K
electricans_son
E
S
Many thanks to Phil D and others for help here - it was the splitter. I replaced the one I'd been using with the old handset I using for testing...
Replies
22
Views
9K
sparc
S

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

YOUR Unread Posts

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    No Thanks