What is the best signal interface for PC ? | Page 5 | 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
268
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.
 
Not read yet what you posted recently but this is the transistor and resistor hardware to interpret the 16 bit data word I mentioned earlier. The pnp transistor is a BC557B.
 

Attachments

  • [ElectriciansForums.net] What is the best signal interface for PC ?
    B8549068-84EC-42EA-9092-338B1EF8AD20.jpeg
    290.7 KB · Views: 36
You can use NPN as well. Depends what you have more.
Also dont forget each resistor to each matrix board pin !!! You should include resistors for each pin, in your circuit. 1k is good enough.
Also very important, make your circuit as logical and simple to follow as possible, as much intuitive you can make it. You really have to put your neurons to work for this part. I know for sure. It will pay up for you in the near future and for others that are reading your circuit.
 
This led matrix pin number assignment is pretty much like a code.
All that I did was to 'decode' it into a human easy to understand and intuitive way of dialing.
If you remember in WW2 - the german made 'Enigma Machine' ? Pretty cool device. This was pretty similar to that. In my mind at least.
You basically have to link 7 positive (+5V) pins that will represent your lines and 5 negative (0V) pins that will represent your columns. All passing through transistors (whatever they are, doesn't matter) to be able to command each pin separately from your future hardware code.
You know what is interesting and relatively fast? to put buttons and press them all at once to get ...well, only 1 line at a time. pretty much like I did in my code at very low fv. Or simple mechanical switches !!! So --12-- in total.
 
You have it. The column Cn and line Ln (my row Rn) bits in the 16 bit data word at the output of the MCP2017 select the column and line transistor switches as on or off. This is done column by column as you see in my earlier video with all Ln set to logic O so all 7 LEDs in a column light up as a test.
 
q12x good afternoon to Romania. I have attached a short video of the eeprom programmer I made today which demonstrates the first five memory locations loaded with different test patterns for the 8 bit Line (my Row) data words - only 7 bits actually used. The top set of dip switches sets the data word to be stored and the lower set selects the address to store the data word. The small black button generates a pulse to tell the eeprom to store the data as detailed on the dip switches. I will build next some sequential logic counters to address the eeprom to retrieve a particular group of 5 L/R data words to drive the 7 x 5 LED display and produce the image I want. In my case the 16 letters a through to n for the earlier Gray Code project so there will be 16 groups of L/R data words.

The test patterns would display the third attachment - note drawn for 8 lines/rows.
 

Attachments

  • IMG_0820.mp4
    16 MB
  • [ElectriciansForums.net] What is the best signal interface for PC ?
    C3A3CE21-99C3-404C-BB95-CD6DB3195678.jpeg
    429.7 KB · Views: 29
  • [ElectriciansForums.net] What is the best signal interface for PC ?
    9C2BDDC4-DB66-4C14-B81E-F0F994BF0955.jpeg
    181.8 KB · Views: 32
Last edited:
Hi there,

Looks like you're using a single ATMEGA328 for each 16 LEDs? This is completely unnecessary. If the only requirement is to drive multiple LEDs in a sequence, then you could do this using a shift register, like in this example:


You can get multiple shift registers, or shift registers with more parallel output pins to drive the number of LEDs which you need.

I believe you can even chain them to get more output.

This will be a) cheaper and b) more energy efficient than powering multiple 328p's.
 
I reinstalled back my arduino Uno and everything is working as before.
But in my latest program that I made, I can obtain a diagonal line on a Led Dot Matrix as a test program, but its refresh rate can not be lower than 1ms as arduino is restricting. MCP chip is minimum 100kHz (actually has higher values specified) which means 10μs per cycle.
- Do anyone know how to lower arduino fv to μs instead of ms ?
In the movie here I present using it's internal fuction
delay(dly);
which is a ms function, I read about it and I get that. I tried also its other function as well, named
delayMicroseconds(dly);
and the result is exactly as the delay(dly); in ms and not under 1ms, to it's promoted μs.
This is a 2min video where I explain the entire problem, please watch it.
Thank you.
 
5x7 DOT Matrix - https://fontstruct.com/fontstructions/show/847768/5x7_dot_matrix

Today, I programmed the eeprom with the 7 x 5 fonts for the capital letters A to P. Now I will look at your latest video.

My initial reaction to the word 'delay' is that you may be using the wrong command. A delay is just that - it does something later than demanded. This may be your problem because the delay is slowing things down such as data transfers.. eg: The data transfers occur every 10 microseconds (say) and then you delay each transfer by 10milli seconds. The delay will dominate. But as I say I am not at all versed in the arduino you are using.

For most people a refresh rate of 50 to 100Hz fools the eye and brain to see a flicker free image as in a conventional TV picture - but modern TV's may do something different these days.

You could average over time the output in software to remove the flicker to make the output virtually constant until there is a change in output. Write a new sub-routine which takes your current sub-routines output as its input and produces an output which is flicker-free.
 
Last edited:
For most people a refresh rate of 50 to 100Hz fools the eye and brain to see a flicker free image as in a conventional TV picture - but modern TV's may do something different these days.
100Hz not 100kHz! - VERY Interesting that you mention this! This is helpful. So my 1ms delay in code might not be a real 1ms at all. The speed in reality is probably somewhere at 20Hz now that I think about it. Hmmmm... very intriguing. They definitely have some issues on their I2C pins on that arduino board.
I just google a bit and I find and confirm with: "most humans can't easily distinguish individual frames at 30 hz."
The visible fast flickering is under 30Hz !
So the SCL pin from arduino is simply under 30Hz and not even close to 1ms which is 1000Hz. Hmmm, very interesting.
 
Last edited:
Exactly.
Here is the actual program for 'letter A' that I made and presented in the movie.
You may not understand everything but read the entire program anyway and you will get something out of it. I've also put notes what is line and what is column.
(it was imperative to switch to Input everything after each step, with my custom Reset(); method, otherwise it was liting up the entire next line or column)
Remember a line is HIGH because is +5V and a column is LOW because is 0V. So we lit a single line putting +5V on line01(for ex) and 0v on each desired column.
Code:
#include "Arduino.h"                    //core library that contains all of the Arduino’s built-in functions (from 2022)
#include <Adafruit_MCP23X17.h>          //this is Adafruit-MCP23017-Arduino-Library version 2.1.0
 
Adafruit_MCP23X17 mcp1; //Instantiate mcp1 object
 
void setup()
{
  Serial.begin(19200);
  mcp1.begin_I2C(0x20);
  for(int i = 0; i <= 15; i++)
  {
    mcp1.pinMode(i, INPUT);
  }
  for(int i = 0; i <=15; i++)
  {
    mcp1.digitalWrite(i, LOW);
  }


//LED MATRIX DISPLAY - Single LED - one by one
/*  LOGIC:
//Columns----------------------------------------
//  mcp1.digitalWrite(1, LOW); //A1=1=column A
//  mcp1.digitalWrite(10, LOW);//B1=10=column B

//  mcp1.digitalWrite(3, LOW); //A3=3=column C middle
//  mcp1.digitalWrite(11, LOW);//B2=11=column C middle

//  mcp1.digitalWrite(4, LOW); //A4=4=column D
//  mcp1.digitalWrite(13, LOW);//B6=13=column E

//Lines----------------------------------------
//  mcp1.digitalWrite(5, HIGH);//Line1
//  mcp1.digitalWrite(0, HIGH);//Line2
//  mcp1.digitalWrite(6, HIGH);//Line3

//  mcp1.digitalWrite(2, HIGH);//Line4
//  mcp1.digitalWrite(12, HIGH);//Line4

// mcp1.digitalWrite(8, HIGH);//Line5
//  mcp1.digitalWrite(14, HIGH);//Line6
//  mcp1.digitalWrite(9, HIGH);//Line7
*/

}

void Reset()
{
 for(int i = 0; i <=15; i++)
 {
   mcp1.pinMode(i, INPUT);
   mcp1.digitalWrite(i, LOW);
 }
}


int dly = 1;
void chr_A()
{
  //line1
 mcp1.pinMode(5, OUTPUT);   //line
 mcp1.digitalWrite(5, HIGH);
 mcp1.pinMode(10, OUTPUT);   //column
 mcp1.digitalWrite(10, LOW);
 mcp1.pinMode(3, OUTPUT);   //column
 mcp1.digitalWrite(3, LOW);
 mcp1.pinMode(4, OUTPUT);   //column
 mcp1.digitalWrite(4, LOW);
 delay(dly);
 Reset();
 
  //line2
 mcp1.pinMode(0, OUTPUT);   //line
 mcp1.digitalWrite(0, HIGH);
 mcp1.pinMode(1, OUTPUT);   //column
 mcp1.digitalWrite(1, LOW);
 mcp1.pinMode(13, OUTPUT);   //column
 mcp1.digitalWrite(13, LOW);
 delay(dly);
 Reset();

  //line3
 mcp1.pinMode(6, OUTPUT);   //line
 mcp1.digitalWrite(6, HIGH);
 mcp1.pinMode(1, OUTPUT);   //column
 mcp1.digitalWrite(1, LOW);
 mcp1.pinMode(13, OUTPUT);   //column
 mcp1.digitalWrite(13, LOW);
 delay(dly);
 Reset();

  //line4-midle
 mcp1.pinMode(2, OUTPUT);   //line
 mcp1.digitalWrite(2, HIGH);
 mcp1.pinMode(1, OUTPUT);   //column
 mcp1.digitalWrite(1, LOW);
 mcp1.pinMode(10, OUTPUT);   //column
 mcp1.digitalWrite(10, LOW);
 mcp1.pinMode(3, OUTPUT);   //column
 mcp1.digitalWrite(3, LOW);
 mcp1.pinMode(4, OUTPUT);   //column
 mcp1.digitalWrite(4, LOW);
 mcp1.pinMode(13, OUTPUT);   //column
 mcp1.digitalWrite(13, LOW);
 delay(dly);
 Reset();

  //line5
 mcp1.pinMode(8, OUTPUT);   //line
 mcp1.digitalWrite(8, HIGH);
 mcp1.pinMode(1, OUTPUT);   //column
 mcp1.digitalWrite(1, LOW);
 mcp1.pinMode(13, OUTPUT);   //column
 mcp1.digitalWrite(13, LOW);
 delay(dly);
 Reset();

  //line6
 mcp1.pinMode(14, OUTPUT);   //line
 mcp1.digitalWrite(14, HIGH);
 mcp1.pinMode(1, OUTPUT);   //column
 mcp1.digitalWrite(1, LOW);
 mcp1.pinMode(13, OUTPUT);   //column
 mcp1.digitalWrite(13, LOW);
 delay(dly);
 Reset();

  //line7
 mcp1.pinMode(9, OUTPUT);   //line
 mcp1.digitalWrite(9, HIGH);
 mcp1.pinMode(1, OUTPUT);   //column
 mcp1.digitalWrite(1, LOW);
 mcp1.pinMode(13, OUTPUT);   //column
 mcp1.digitalWrite(13, LOW);
 delay(dly);
 Reset();
 
}



void loop()
{
 chr_A();
}
I counted 7 one millisecond delays, one after the other in this sub-routine. I suppose for now that from the start to end of this sub-routine takes of the order 7mS. I cannot quickly work out if 7mS is to generate a single column of 7 LEDs, a single line of 5 LEDs or all 35 LEDs. Please check my analysis because I am pretty sure I have not completely understood your code. You understand how you have written the code so ought to be able to arrive at figure of about 30Hz or lower which you mentioned earlier.

If 7mS is for all 35 LEDs then the refresh rate is 1/0.007 = 140Hz.
If 7mS is for a column of 7 LEDs, and there are 5 columns the refresh rate is 140/5 = 28Hz.
If 7mS is for a line of 5 LEDs and their are 7 lines the refresh rate is 140/7 = 20Hz

Why do have delay command at all in this sub routine?
 
Last edited:
My progress so far. The eeprom addressed by sequential logic to find the five 7 bit data words to form the font for N. Refresh rate is about 200Hz ie A complete N two hundred times every second. Clock is 1kHz and 1000/5 = 200Hz where 5 is number of columns. And letter B too. 😀
 

Attachments

  • [ElectriciansForums.net] What is the best signal interface for PC ?
    A3583F2E-C0FB-4A9A-BD08-0A5449771EC4.jpeg
    566.9 KB · Views: 26
  • [ElectriciansForums.net] What is the best signal interface for PC ?
    D665625C-DA1F-480C-A5C3-A5E7357386BD.jpeg
    523.5 KB · Views: 31
Last edited:
Congratulations mister @marconi
Now put a movie with it and your comments !
I managed to optimize my code and now is less flicker that original. Its still a vibration but really almost not visible at all. I also installed a second mcp23017 library and all last night and until now today, I stay on it, but it has some very-very weird logic inside that I could only partially descypher. So no complete descypher at the moment of this second library that is promising greater potential, since is more close to a PIC program and also closer to our simplified schematic diagram. I literally hammer it last night, im very tired from it. But I learned some interesting stuff doing it, very technical and very in the programming domain. Just putting on the table what I did.
 
Good morning mister @marconi ,
Here is something interesting... Im not sure how much may have been influenced my program testing so far, I will have to make a more extensive research on this particular detail, but in time. For the momment, with the programs I run already, I didnt really observed much of a difference to be honest. But it crossed my mind that this little bugger might be important in some special cases, special programs. Time will tell.
So here it is - full view:
[ElectriciansForums.net] What is the best signal interface for PC ?

The blue lines represent the Ground or 0V. I marked with a square the 0V marking next to the metalic pad from which the wire is going beneath the cardboard to that long track on which, each negative pin for all the LEDs are connected. So what I have there is a pull down connection through each 12k resistor put in series to each LED to ground.
[ElectriciansForums.net] What is the best signal interface for PC ?

This problem I realize it yesterday, when I was programming and was meditating to the fact those pins from the IC are not really floating or inAir. I then realized they are actually pulled to ground through each led. And today, I mounted that little switch only between this rail for all the leds and 0V. I tested a couple of normal programs but no visible difference. Ill have to test some in depth programs that I have 'somewhere' that really needs some floating pins. I really hope it will be a difference this time. If not, then, daaaaeeem.
 

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

News and Offers from Sponsors

  • Article
Join us at electronica 2024 in Munich! Since 1964, electronica has been the premier event for technology enthusiasts and industry professionals...
    • Like
Replies
0
Views
228
  • Sticky
  • Article
Good to know thanks, one can never have enough places to source parts from!
Replies
4
Views
687
  • Article
OFFICIAL SPONSORS These Official Forum Sponsors May Provide Discounts to Regular Forum Members - If you would like to sponsor us then...
Replies
0
Views
641

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