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

Exceptionally (for me) is to make it how you make it, only from logic chips like you are making it right now. And is terrible challenging for me to do it like you. But it is remained in my mind to do it like that as well. Not sure when exactly....
 
I will respond more completely when I have the time and energy and done some research on the 23017 and 23S17 ics.

For now, the period of a repetitive waveform is the inverse of its frequency. So a 100kHz waveform has a period of

1/100000 = 0.00001s or 10 microseconds. A micro second is 0.000001s - one millionth of a second.
 
- If it helps, for mister @marconi, here is the datasheet for my MCP23017 that I have.
On the very first page you have a summary of what it can do.
Very good math explanation. I like it. I dont do it every day so I tend to forget things. Shame of me. Im mixing colors more often than mixing numbers, haha. Get it? because im a poor artist.
- I start to contemplate the idea of using some faster IC's, like 74HC165 shift registers that @timhoward mentioned already, and most probably more hard to wire in hardware and also much harder to code. Just to have a secondary board. But not 100 I/O pads, just a few, maybe 20 or something. I also remember Teensy board had 40 IO's already and the best one with 58 IO's , which is VERY appealing and also using I2C protocol. Mister @timhoward can confirm it, if is still around.
- Is so disappointing that my Arduino Uno can Not go down under 1ms !!! Ahhhh what a stick in the hearth.
- Also yesterday I received my Arduino Nano board, the replacement for Arduino Uno, and the upgrade for this MCP board I built. I will show some pictures and movie later after I mount everything.
 
To mister @timhoward if you are still around, can you do a test for me? check your maximum fv that you can get from 1 of your I/O from your Teensy board? And dont read it from its datasheet, but do it in reality and tell me if it stops to 1ms like my arduino uno does, or is actually capable to go down to μs(microseconds) ? Thank you !
 
q12 Good morning. To aid help me understand your programming could you slow the scan rate so far that I can see how you select an LED for illumination and post a short video. You can see from my video that I scan the LEDs column by column. In the video I have set the data word for each row as (1111111) so that all 7 LEDs in a column are lit when each of the 5 columns is selected. The data word for the columns follows the sequence (10000), (01000), (00100), (00010), (00001), (10000)......
Thus a sequence of 5 pairs of row and column data words, 10 data words in total, allows me to display any arrangement of LEDs on the display. I want to see what you do.
 
Last edited:
Good morning , where are my manners, right? Hehe.
Remember, this what I do is software programming, but you do it much harder, in hardware !!! Keep this in mind all the time.
Hmmm.... hehe, here is a quick and dirty way of obtaining 1 single led on the matrix, following my already made example.
Just put 5V on pin 3 (with gray) - also dont forget to put resistors !!!! because you will burn the led !!!
and put 0V/ground on pin 11(with gray). Ive also marked with 3red arrows the positions where to put the voltages on which pins.
I will make a more comprehensive explanation for you, but it will take some time, also to make most probably a new drawing, and then the movie and edit it and upload it to yourtube. So until then, at least do this very quick and dirty example here and you will get a procentage of an idea.
1660896916127.png
 
So do you select in software one LED at a time by setting one of the line bits and one of the column bits? And then send this data to the MCP23017? Thus to illuminate say all 35 LEDs you have to sequence through 35 pairs of line and column bits (Column, Line). Each data transfer to the MCP23017 has a cycle time Tc - I have yet to find out what this time is. Thus to refresh completely the 35 LEDs will take a time of 35 x Tc - this is the time necessary to send 35 pairs of (Line, Column) messages. This is a slow way to control the 7 x5 display. You could use the 16 bits data outputs in the format ( C1, C2, C3, C4, C5, X, X, X, L1, L2, L3, L4, L5, L6, L7, X) to illuminate a combination of 7 LEDs in one column using one data transfer, and thus the whole display in 5 data transfers - a considerable reduction in data transfer time from 35 Tc to 5 Tc. (The X means not used).

To do this you would have to add some simple hardware to the 7 x 5 display - some transistors and resistors to interpret the 16 bit data word into switches to control the application of 5V and 0V to the LED array. The scanning has to be done column by column to take advantage of the common cathode arrangement inside the array.
 
So do you select in software one LED at a time by setting one of the line bits and one of the column bits? And then send this data to the MCP23017? Thus to illuminate say all 35 LEDs you have to sequence through 35 pairs of line and column bits (Column, Line). Each data transfer to the MCP23017 has a cycle time Tc - I have yet to find out what this time is. Thus to refresh completely the 35 LEDs will take a time of 35 x Tc - this is the time necessary to send 35 pairs of (Line, Column) messages. This is a slow way to control the 7 x5 display. You could use the 16 bits data outputs in the format ( C1, C2, C3, C4, C5, X, X, X, L1, L2, L3, L4, L5, L6, L7, X) to illuminate a combination of 7 LEDs in one column using one data transfer, and thus the whole display in 5 data transfers - a considerable reduction in data transfer time from 35 Tc to 5 Tc. (The X means not used).

To do this you would have to add some simple hardware to the 7 x 5 display - some transistors and resistors to interpret the 16 bit data word into switches to control the application of 5V and 0V to the LED array. The scanning has to be done column by column to take advantage of the common cathode arrangement inside the array.

Multiplexing in that way is definitely the best way to do it I would say.
 
So do you select in software one LED at a time by setting one of the line bits and one of the column bits? And then send this data to the MCP23017?
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();
}
 
Last edited:
New posts

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

Similar Threads

Hello ! I am building for some time a cct to drive a 3digit multiplexed LCD. (from aliexpress) From the sellers on aliexpress I managed to find...
Replies
7
Views
1K
Hi there, I'm currently working on a project where I'd like to slowly fade the brightness of a series of high brightness RGBW LEDs. Basically...
Replies
3
Views
946
My view on life, in any field, is not to produce more but to consume less. Everybody told me this is a very eccentric weird mentality. Perhaps...
Replies
12
Views
2K
Hello there! To start, I have to say that I'm a very beginner with electrical stuff, I'm working in IT and today I face a challenge that I can...
Replies
2
Views
4K
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

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