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

Hello mister @marconi
I finally used your led matrix. Not as we originally intended but with interesting results.
I may say, it is a bit dificult component because it has some specific pins for positive and negative connections Aaaand it also has a inverted way of connecting as well. Interesting functionality but hard to pinpoint. It was hard for me because it is my first time with such a thing. The conclusion, it was a success and I am happy with the results. Even if it is a test or a game.
Here is a slight longer movie that I originally intended, with many-many points in it.
Thank you for watching and I will make those letters as we discussed in the beginning when you send me that led matrix.
 
See what happens to the circling led display as you speed up the scan rate. Does this give you a hint on how to use this display?

ps: I am pretty sure I sent you the data sheet for the 7 x 5 matrix. If I remember the LEDs are wired common cathode but do check this - in groups of 5 LEDs, one group to each of the 7 lines.
 
Last edited:
See what happens to the circling led display as you speed up the scan rate. Does this give you a hint on how to use this display?

ps: I am pretty sure I sent you the data sheet for the 7 x 5 matrix. If I remember the LEDs are wired common cathode but do check this - in groups of 5 LEDs, one group to each of the 7 lines.
Oh, this is not new to me at all. I am very aware of cycling rapid times gives you the desired shape or character on the matrix. I know this from when I was 7 or 8 years old. Really, I read some interesting stuff at that age, but... you know, capitalism is keeping me down.
And yes you send me its datasheet, and I did use it but is having some weird circuit schematic inside that I could not use it in practice so I had to re-discover it by trial and error. Eventually this is the secondary role of a bad diagram in a datasheet, to put you to test the thing and figure it out by yourself. Its not the first time and not the last time I get it like this.
I have some real problem here with the arduino, not being able to get lower than 1milisecond down to micro-seconds... and this is leaving me with a very 'flashy' display. I just built the letter-character 'A' and is working but too damn slow "refresh rate". Damn, im upset.
 
I am not familiar with the microprocessor board and its programming you are using. Seems odd to me that you cannot speed up the bit rate from these outputs. Perhaps some more reading of the manual.

In my version I store the character data in an eeprom and then read it out quickly to drive the 7x5 display.

Now the weather has cooled it is comfortable enough in my shed to restart work to finish off the project. I am slower than you though! You can see slow test scanning in the attached video.
 

Attachments

  • FullSizeRender 25.mp4
    6.3 MB
Last edited:
Here, I attach the image I made. See if it is of any help.
You are doing much more harder work than me, you are programming it in hardware. I did it faster because it was in software,and is a big difference.
But yours will be faster and display more better than my results, because the arduino board Im using, has some restrictions I didnt discovered to bypass them, or its just stupidly build like that, with a minimum of 1mHz.
This is a plan for the future, and a serious upgrade. I will have to search and ask around for a solution, to link my entire MCP board to my PC, but NOT using arduino, but something else. I already have some usb to TTL very tiny boards, I think, I have to look and see exactly what I have, but the idea of the upgrade will be that I will put aside the arduino and replace it with something faster in IO department, matching and even better than these MCP's operating fv, which is kind of slow, but fast enough for a lot of stuff. So thats in plan and is a bit more complicated to achieve.
- If anyone else that is reading my progress here, can jump with any idea, please do so. Like @timhoward with Teensy board. More ideas please.
I was unsure and I re-check it with the datasheet of the MCP23017. I got this from it:
High-Speed I2C Interface (MCP23017):
  • 100 kHz
  • 400 kHz
  • 1.7 MHz
I can see diferent values there and they have some specificity I dont know yet. All I know is that this MCP chip, driven from I2C, is doing it at 100kHz.
My math... correct it if you see something wrong, im in the art department:
100 kHz = 100000 cycle/second >> 1cycle is at an interval of 100ms ? Is this right?
Also, this MCP chip has another way of connection:
High-Speed SPI Interface (MCP23S17): - 10 MHz (maximum)
Which I have no idea how I may link it...
The problem is that all the wiring on the boards so far is done for I2C communication ! Not for SPI.
The guy who suggested me these MCP's asked me in the beginning, if speed is a problem, and I said "speed is not a problem" but now... with your project, it starts to be one... damn. But as limited as it is so far, I can reorient to other types of projects. At least I tested some limits so far.
 

Attachments

  • DOT LED MATRIX DISPLAY to MCP copy 1.jpg
    242.8 KB · Views: 18
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:

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
935
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

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