Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

MAX6953 input

Status
Not open for further replies.

AtomSoft

Well-Known Member
Hey just wanted to share this recent project. Its really cool. I used a MAX6953 to controll a 2 digit custom 5x7 matrix. I even made it look like its scrolling :D what cha think?
matrix-jpg.23270


[embed]http://www.youtube.com/v/Fhgz1Y5KZsU[/embed]

EDIT:
I will be sure to add a Schematic(gota make it now lol) and some code.
 

Attachments

  • matrix.jpg
    matrix.jpg
    292.2 KB · Views: 1,363
Last edited:
Thats cool, only thing I would add is smoother scrolling, eg 1 colum at a time instead of 1 character, unless of course your gonna add more characters. but for a 2 char display smooth scrolling would be much more readasble.

is the max6953 the charlieplexed chip?
 
SMUGangsta : Im not sure i can smooth scroll like that. Since the MAX6953 from what i know doesnt have that command in it. It does have 24 RAM spots for custom characters .. with some special coding i can create 5 custom characters for every character i send out put it in the buffer and load then 1 by 1 so it looks like its scrolling but thats hard work :D Ill try it and make a sample.

Mike: thanks! to embed the video is simple...
REMOVE THE "*" of course. :D

[*embed*]URL[/*embed*]

Be sure when you add the URL it is NOT i repeat NOT the one with the word WATCH in it:
YouTube - 2 Digit 5x7 Matrix

That would be a bad URL.

A Good URL would be like:
https://www.youtube.com/v/Fhgz1Y5KZsU

So remove the "watch?" add a "/" after the "v" and your set.

TIP: You can just get the EMBED URL from youtube. It is right under the URL box.
 
Here is the code:
Code:
#include <p18f2455.h>
#include <stdio.h>
#include <i2c.h>
#include "asdelay.h"

#pragma config WDT = OFF, LVP = OFF, FOSC = HS

#define SDA_PORT PORTCbits.RC7
#define SDA LATCbits.LATC7
#define SDA_TRIS TRISCbits.TRISC7
#define SCL LATBbits.LATB1

void main(void);
void i2c_byte(char addr);
void i2c_start(void);
void i2c_ack(void);
char i2c_input(void);
void i2c_clock(void);
void i2c_stop(void);
char snft_write(char offset, char data);
char snft_read(char offset);
void delay_800ms(void);

char MAX6953R = 0b10100001; //1 = READ
char MAX6953W = 0b10100000; //0 = WRITE


void main (void){

    char x,i,y = 0;

    TRISB = 0;
    LATB = 0b00000100;

    snft_write(0x07,0x00);  //TEST OFF
    snft_write(0x04,0b00000101);

while(1){
    snft_write(0x20,'J');
    snft_write(0x21,'A');
        delay_800ms();
    snft_write(0x20,'A');
    snft_write(0x21,'S');
        delay_800ms();
    snft_write(0x20,'S');
    snft_write(0x21,'O');
        delay_800ms();
    snft_write(0x20,'O');
    snft_write(0x21,'N');
        delay_800ms();
    snft_write(0x20,'N');
    snft_write(0x21,0x20);
        delay_800ms();
    snft_write(0x20,0x20);
    snft_write(0x21,0x20);
        delay_800ms();
}
}

void delay_800ms(void){
    Delay10KTCYx(200);
    Delay10KTCYx(200);
}
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
////            I2C FUNCTIONS
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
void i2c_clock(void)
{
    SCL = 1;
    Delay10TCY();
    SCL = 0;
}

void i2c_start(void){
    SDA_TRIS=0;   //SDA Output
    SCL=0;        //Clock Low
//Start - 5us
    SDA=1;        //SDA High
    SCL=1;        //Clock high
    Delay10TCY();
    SDA=0;        //SDA Low
    Delay10TCY();
    SCL=0;        //Clock Low
}

void i2c_byte(char addr){
    char bl;
    for(bl=0;bl<8;bl++){

        if((addr & 0x80) != 0)
            SDA = 1;
        else
            SDA = 0;

    i2c_clock();
    addr=addr<<1;
    }
}

void i2c_ack(void){
    SDA_TRIS = 1;   //SDA Input
    i2c_clock();
    Delay10TCY();
    //while(SDA);
    SDA_TRIS = 0;
}

char i2c_input(void){
    char temp;
    char i;

    SDA_TRIS = 1;

    temp=0;  
    i = 0;           
    for(i=0;i<8;i++){  
        temp=temp<<1;   

        if(SDA_PORT) 
            temp|=1;

        i2c_clock();
    }

    SDA_TRIS = 0;
    return temp;
}

void i2c_stop(void){
    SDA = 0;
    SCL = 1;
    Delay10TCY();
    SDA = 1;
    SCL = 0; 
}
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
////            MAX6953 FUNCTIONS
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
char snft_write(char offset, char data){ //snft = MAX (6953)

    char temp;
    i2c_start();                //Start
    i2c_byte(MAX6953W);          //Slave Byte
    i2c_ack();                  //ACK
    i2c_byte(offset);           //Address Offset
    i2c_ack();                  //ACK
    i2c_byte(data);          //Slave Byte
    i2c_ack();                  //ACK
    i2c_stop;                    //Stop
    return temp;
}
char snft_read(char offset){

    char temp;
    i2c_start();                //Start
    i2c_byte(MAX6953W);          //Slave Byte
    i2c_ack();                  //ACK
    i2c_byte(offset);           //Address Offset
    i2c_ack();                  //ACK
    i2c_start();                //Start
    i2c_byte(MAX6953R);          //Slave Byte    
    i2c_ack();                  //ACK
    temp = i2c_input();         //Get Data
    i2c_ack();                  //ACK
    i2c_stop;                    //Stop
    return temp;
}
Schematic:
 

Attachments

  • MATRIX01.png
    MATRIX01.png
    56.3 KB · Views: 380
Last edited:
SMUGangsta:
I just realized it would be impossible to smooth scroll without making my own character on the pic. Since the way the MAX6953 stores data is um... sideways...

For instance... The letter "J" would be:
j-jpg.23274
 

Attachments

  • J.jpg
    J.jpg
    32.7 KB · Views: 1,069
Just had a lookie at the datasheet,, its niot the chip I was thinking of. Looks like a nice chip none the less - will have to get me one of these!

I see what you mean about the smooth scrolling, it would be possible, but would probably require loads of space in your uP as you would probably have to keep a local copy of the entire character set and build each custom character from it directly before displaying it - which is probably a lot of work - i guess it depends on the application.

What are you going to use it for - just playing or do you have something in mind?
 
Just had a lookie at the datasheet,, its niot the chip I was thinking of. Looks like a nice chip none the less - will have to get me one of these!

I see what you mean about the smooth scrolling, it would be possible, but would probably require loads of space in your uP as you would probably have to keep a local copy of the entire character set and build each custom character from it directly before displaying it - which is probably a lot of work - i guess it depends on the application.

It's really pretty easy to do, check my 8x8 LED tutorial - you just make a table in program memory containing the character set (I 'stole' the character set from a text LCD module :D ). The displayed text is stored in another table, the only slightly 'tricky' part is using extended length tables.

Don't know about this particular chip, but my tutorial scrolls in all four directions, which is easy to do in the software.
 
Nigel you are correct. You can store a character set on the PIC and display it but the only issue is to display a character from a table/array you have to load the character into one of the RAM fields on the MAX chip. Hence a scroll would look like this:

1. Get character from table/array
2. decide which way to scroll and shift character data 1 time over
3. Send character to max ram00
4. shift over again
5. send the newly shifted data to ram01
6. shift over again
7. send to ram02
8. shift over again
9. send to ram03
10. shift over again
11. send to ram04
12. display character (normal)
13. display ram00
14. display ram01
15. display ram02
16. display ram03
17. display ram04
18. Repeat step 1 if it is a string.

You see the issue now?

Also as for the character set. You would have to make a complete set. I am sure i can make a program in VB to create my own characters like i did for the LCD module. I cant use the one for the LCD because for the MAX6953 the characters are loaded sideways(like rotated 90 degrees).

Its not to hard to do but not sure how it would look. Ill try it with about 5 letters. "Hello" to see if its worth creating a whole character set.
 
Last edited:
Here is a small app i made:
maxgen-jpg.23285


Here is the program.
 

Attachments

  • MaxGen.zip
    17.1 KB · Views: 243
  • maxGen.jpg
    maxGen.jpg
    61.5 KB · Views: 1,042
Last edited:
you work fast buddy!!

Thats why I love VB, its so easy to knock something up, and you only need to think about the details.

Are you using .NET or another version - I use VB6 Enterprise Edition

I cant get my head round .NET - i'll change to that when i find something that I cant do in VB6
 
I got it to scroll nicely but the issue is the code has to be worked on ALOT! lol like it need to be fixed for better looping and stuff... I only tried 1 letter.
I also took a small video here:
Code:
void ShiftIt(char *image, char letter){
    char x;
    snft_write(0x20,letter);
    snft_write(0x05,0x80);

    letter -= 0x41;
    image = image + letter;

    for(x=0;x<5;x++){
        snft_write(0x05,*image++);
    }
    image = image - 4;

    for(x=0;x<4;x++){
        snft_write(0x05,*image++);
    }
    snft_write(0x05,0x00);
    image -= 3;

    for(x=0;x<3;x++){
        snft_write(0x05,*image++);
    }
    snft_write(0x05,0x00);
    snft_write(0x05,0x00);
    image -= 2;

    for(x=0;x<2;x++){
        snft_write(0x05,*image++);
    }
    snft_write(0x05,0x00);
    snft_write(0x05,0x00);
    snft_write(0x05,0x00);
    image -= 1;

    for(x=0;x<1;x++){
        snft_write(0x05,*image++);
    }
    snft_write(0x05,0x00);
    snft_write(0x05,0x00);
    snft_write(0x05,0x00);
    snft_write(0x05,0x00);
    
    delay_800ms();

    snft_write(0x20,0x00);
    delay_800ms();
    snft_write(0x20,0x01);
    delay_800ms();
    snft_write(0x20,0x02);
    delay_800ms();
    snft_write(0x20,0x03);
    delay_800ms();
    snft_write(0x20,0x04);
    delay_800ms();

}
[embed]http://www.youtube.com/v/XzYRetm248E[/embed]


The issue is that you would have to buffer as many characters that you are displaying to smooth scoll them all. If you have a 4 digit display then you have to buffer 4 digits where each digit takes 5 RAM locations for a full scroll. Then you have to think about it good.

The hardest part would be MERGING letters. If i had the word "OK" i would have to buffer the O and the K that alone would be 5 RAM locations for each a total of 10 you would think. But the issue here is i have to merger the lettering now so it scrolls over both digits. You follow?
 
Last edited:
Thats excellent - it does look much better with smooth scrolling!

Are you just playing or do you have something in mind?
 
Right now playing lol. But im waiting for my real dot matrix displays to come in the mail. I will make a nice scrolling display ... Maybe USB so i can get email alerts and weather and such from PC (internet) and send to PIC to my scrolling display. Cool right!

Oh i made a longer message with the old scroll. I think it doesnt look too good because there is only 2 digits so you have to imagine the rest of the scroll. If i had more it would look fine im sure.

[embed]http://www.youtube.com/v/55AfuUeOWlk[/embed]
 
Im in the same boat, im helping out a guy in another thread with his RGB woes, but cant wait for his sample to arrive - so ive decided to simulate it best as I can - but I dont have enough LEDs here and only 6 MAX7219s but with what I do have can simulate the full RGB and cascading - and for laughs im gonna use a 12F629 I found in my box.

Im loving the big display idea, I have a little LCD that I fitted to the front of my Desk PC that tells me about new email, running from a systray prog I wrote, but to have a big scrolling display would be awsome - no more excuses for not answering my email - haha

Im thinking my church would love one of them too, to let the congregation know how much we still need to raise for projects etc.
 
Cool.

I know waiting sucks a lot! lol Im waiting for so many things its not even funny. I have no switches, LM7805s nothing lol all is in the mail on the way :D

I have so many PICs tho lol.
2x dsPIC304013
3x PIC16F267A
2x PIC18LF4620
3x PIC18LF2550
2x PIC18LF4525
3x PIC18LF2525
5x PIC18F1320
1x PIC18F1330
1x PIC10F206
1x PIC10F222
1x PIC18F2455
2x PIC18F448
and more on the way...

The issue is parts for projects now lol
 
you have a lot of 18s, I have mostly 16s - about 200 in all, I was being serrious though - im using the 12F for laughs and also because I wanna try a distributed approach - eg a few low cost PICs driving the MAX7219s, mabey each 12F driving about 1024 leds each (256 leds of each colour RRGB) and some kind of more powerful processor doing the real work (taking an input picture, dividing it to RGB, and sending the data out to the 12Fs)

Is this a hobby for you? or do you use it for work?
 
Its a hobby im trying to turn into work. Im trying to grasp alot before diving into a job. I was thinking about opening a store (online) and selling parts. I can save about $5000-$10,000 a year and open the store.

The store was mainly for parts like Passive , Optical and etc... but the main thing i wanted to have also was widgets. Like small things i would make myself and sell online for a extra profit. Like this LED display... I would make a 8x1 5x7 Matrix and sell it as cheap as i can while making a profit.

Cheap is a big picture in this world. I noticed its not how much you can sell i item for but how many you sell.

If i sell a resistor 10 pack for $2 i would probably sell them but if i sell a 10pack for $0.50 then ill sell way more while still making profit.

I own not 1 12F. The lowest i have programmed for was the 16F... The 2 10F i own i never even tried to use. They are both 8Pin DIPs and i have no clue what i can use them for :D
 
Lols at your last comment - My 12F is an 8 pin, and it'll be running 1024 leds :eek:
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top