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.
im not as experienced as you and would love info on how you plan to do that.

Why RRGB? I Know why RBG but why another R?
 
Last edited:
Apparently the second R is something to do with 'Virtual Pixels' - but i dont really get it, but its on the system im trying to emulate so its best be in their.

I will post up a schematic - hopefully later today, but we have guests coming for dinner.

Im hoping to start with 4096 colours per pixel (which is 2R 1G and 1B)

Im not really experienced, I just love leds and led controllers, It was the first thing I learned to do so I have a bit played with it more than anything. I still cant build even basic analog circuits, and I cant get my head round op-amps at all.
 
hi atom,

Seeing how you are getting lit up,:) I thought this link would be useful.

**broken link removed**
 
Thanks Eric ill be sure to look at it right now.

Dude op-amps i have like 4 and not sure how and what they are for lol. I learn quick tho but no time lol.
 
I like:
**broken link removed**

also:



EDIT: Forgot to show the back of the digits. Its like a PIE lol

digitback-jpg.23294
 

Attachments

  • digitBack.jpg
    digitBack.jpg
    162.7 KB · Views: 460
Last edited:
Ok need some help now lol

Trying to make a automatic scroll using 4 digits and is killing me. The below code scrolls the first 4 characters ok but then it just scrolls in another 4 without scrolling out the last 4. Any help please and thanks!

Code:
void dispStr(char *string){
    char tmp;
    char buff, buff2, buff3, buff4;
    char buffa, buffb, buffc, buffd;

    while(tmp != 0x60){
    buff  = *string++;
    buff2 = *string++;
    buff3 = *string++;
    buff4 = *string++;



        snft_write(Digit0,buff);
            Delay10KTCYx(200);
///////////////////////////////
        snft_write(Digit1,buff);
        snft_write(Digit0,buff2);
            Delay10KTCYx(200);
////////////////////////////////
        snft_write(Digit2,buff);
        snft_write(Digit1,buff2);
        snft_write(Digit0,buff3);
            Delay10KTCYx(200);
////////////////////////////////
        snft_write(Digit3,buff);
        snft_write(Digit2,buff2);
        snft_write(Digit1,buff3);
        snft_write(Digit0,buff4);
            Delay10KTCYx(200);
////////////////////////////////

    }
 
do you store your whats currently displayed anywhere?

Im assuming here, as im not great with c, but thats a routine that takes a string and outputs it to the display.

If your not storing whats currently on the display anywhere, the only thing i can think of is to scroll it off before you exit the routine.

snft_write(Digit0,buff);
Delay10KTCYx(200);
///////////////////////////////
snft_write(Digit1,buff);
snft_write(Digit0,buff2);
Delay10KTCYx(200);
////////////////////////////////
snft_write(Digit2,buff);
snft_write(Digit1,buff2);
snft_write(Digit0,buff3);
Delay10KTCYx(200);
////////////////////////////////
snft_write(Digit3,buff);
snft_write(Digit2,buff2);
snft_write(Digit1,buff3);
snft_write(Digit0,buff4);
Delay10KTCYx(200);
////////////////////////////////
snft_write(Digit3,buff2);
snft_write(Digit2,buff3);
snft_write(Digit1,buff4);
snft_write(Digit0,***BLANK***);
Delay10KTCYx(200);
////////////////////////////////
snft_write(Digit3,buff3);
snft_write(Digit2,buff4);
snft_write(Digit1,***BLANK***);
snft_write(Digit0,***BLANK***);
Delay10KTCYx(200);
////////////////////////////////
snft_write(Digit3,buff4);
snft_write(Digit2,***BLANK***);
snft_write(Digit1,***BLANK***);
snft_write(Digit0,***BLANK***);
Delay10KTCYx(200);
////////////////////////////////
snft_write(Digit3,***BLANK***);
snft_write(Digit2,***BLANK***);
snft_write(Digit1,***BLANK***);
snft_write(Digit0,***BLANK***);
Delay10KTCYx(200);
////////////////////////////////


What i tend to do in these circumstances is wrap the code that sends to the display, so that I can store anything that has been send to the display, that way I can do a smooth transistion from whatever is on the display to the new data.

hope that helps
 
That scrolls it nice if the message is only 4 characters tho.

I call it like:

Code:
    char msg[] = {"ATOMSOFT Jason Lopez  `"};

    delay_500ms();

    dispStr(msg);

So its store in "msg" which is not global but can be if needed. The issue im having is scrolling the next 4 after the first 4 characters, My original code would scroll the first 4 ok but then instead of scrolling the in a new character 1 at a time it doesnt work. Im thinking of making it 2 loops. but not sure how.

Like loop1 would scroll first 1-4 characters in and loop2 scroll 1 new character in at a time while scrolling the other old ones out.
 
not fully working but close!

Code:
    while(1){
        snft_write(Digit0,*string);
        Delay10KTCYx(dtime);
            if(*string == 0x60) break;

        snft_write(Digit1,*string++);
            if(*string == 0x60) break;
        snft_write(Digit0,*string--);
        Delay10KTCYx(dtime);

        snft_write(Digit2,*string++);
        snft_write(Digit1,*string++);
            if(*string == 0x60) break;
        snft_write(Digit0,*string--);
        string--;
        Delay10KTCYx(dtime);

        snft_write(Digit3,*string++);
        snft_write(Digit2,*string++);
        snft_write(Digit1,*string++);
            if(*string == 0x60) break;
        snft_write(Digit0,*string++);
        Delay10KTCYx(dtime);

/////////////// reverse
            if(*string == 0x60) break;
        snft_write(Digit0,*string--);
        snft_write(Digit1,*string--);
        snft_write(Digit2,*string--);
        snft_write(Digit3,*string);
        string += 3;
        Delay10KTCYx(dtime);

            if(*string == 0x60) break;
        snft_write(Digit0,*string--);
        snft_write(Digit1,*string--);
        snft_write(Digit2,*string--);
        snft_write(Digit3,*string);
        string += 4;
        Delay10KTCYx(dtime);   

            if(*string == 0x60) break;
        snft_write(Digit0,*string--);
        snft_write(Digit1,*string--);
        snft_write(Digit2,*string--);
        snft_write(Digit3,*string);
        string += 5;
        Delay10KTCYx(dtime); 

            if(*string == 0x60) break;
        snft_write(Digit0,*string--);
        snft_write(Digit1,*string--);
        snft_write(Digit2,*string--);
        snft_write(Digit3,*string);
        string += 6;
        Delay10KTCYx(dtime); 
  

 }

EDIT: Changed Code! Added end of msg check
 
Last edited:
what about some kind of pointer to its current position in the string - and work from that

as I said before C isnt my thing, I know what the string--, and string++ do but cant visualise it, if i come up with something before you do - i'll post it up
 
Just had a quick thought - it may be much easier to 'pad' the string

this is my thought in psudo basic

Code:
sub scrollText ( text as string )
  mytext = "    " & text & "    " ' pad the string
  for x=1 to len(mytext)-4
    stringout digit0, mytext[x]
    stringout digit1, mytext[x+1]
    stringout digit2, mytext[x+2]
    stringout digit3, mytext[x+3]
    delay200ms
  next x
end sub

let me know if its any use

NOTE: the counts may not be right - for example the '-4' etc as different compilers handle things differently - but hopefully the theory is good - i really need to get vB on my lappy top

This should also vastly reduce your code size if that matters too
 
Last edited:
Dude you ROCK!!!!!!!!!!!!!!!!!

Code:
void dispStr(char *string){
    char x;
    char tmp[50];

    strcpy(tmp,string);

    for(x=0;x<40;x++){

        if(tmp[x] == 0x60) break;
        snft_write(Digit3, tmp[x]);

        if(tmp[x+1] == 0x60) break;
        snft_write(Digit2, tmp[x+1]);

        if(tmp[x+2] == 0x60) break;
        snft_write(Digit1, tmp[x+2]);

        if(tmp[x+3] == 0x60) break;
        snft_write(Digit0, tmp[x+3]);

        delay_500ms();
    }

}

Seems to work great.
EDIT: DONE:
I will make it so a max of 50 character message and have checks for ESC char.
 
Last edited:
glad I could help, its nice watching how projects progress.
 
Thank you very much. Even tho this is mainly for fun (as of now) it was surely something important to learn. Oh BTW i just got my Newark order in . I now have

10x 7805s (mc7805ctg)
30x tactile (b3f-4000)
40x 33pf (cap) (SR151A330JAATR1)

So my parts list is rising at least :D im still waiting from BGmicro now lol
 
Last edited:
I would sell you bits real cheap - i have boxes of 7805s, tactile switches in many configurations, linear and rotary pots, capacitors coming out my ears and about 1000000 resistors - but I think the postage would be a killer.

Im working on a small kit of parts to make something simple but useful - that I can sell on ebay to people just getting interested in electronics.
 

Attachments

  • IMG00284.jpg
    IMG00284.jpg
    64.6 KB · Views: 133
  • IMG00285.jpg
    IMG00285.jpg
    87.7 KB · Views: 129
  • IMG00286.jpg
    IMG00286.jpg
    67.3 KB · Views: 128
Last edited:
UK .... hmmmm.... how much you think to ship to USA?

Here is my full code: (i hope its helpful to some)
Code:
#include <p18f2455.h>
#include <stdio.h>
#include <delays.h>
#include <string.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
       
#define Digit0 0x63
#define Digit1 0x62
#define Digit2 0x61
#define Digit3 0x60

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 delay1x_ms(char ms);
void delay10x_ms(char ms);

void dispStr(char *string);

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

void main (void){
    char msg[] = {"    Jason Lopez  AtomSoftTech.com    `"};

    TRISB = 0;
    LATB = 0b00000100;

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

while(1){
    delay10x_ms(50);
    dispStr(msg);
    }
}

void dispStr(char *string){
    char x;
    char tmp[50];

    strcpy(tmp,string);

    for(x=0;x<40;x++){

        if(tmp[x] == 0x60) break;
        snft_write(Digit3, tmp[x]);

        if(tmp[x+1] == 0x60) break;
        snft_write(Digit2, tmp[x+1]);

        if(tmp[x+2] == 0x60) break;
        snft_write(Digit1, tmp[x+2]);

        if(tmp[x+3] == 0x60) break;
        snft_write(Digit0, tmp[x+3]);

        delay10x_ms(60);
    }

}


void delay10x_ms(char ms){
    char i;
    for(i=0;i<ms;i++){
        Delay10KTCYx(5);
    }
}
void delay1x_ms(char ms){
    char i;
    for(i=0;i<ms;i++){
        Delay1KTCYx(5);
    }
}
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
////            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;
}
 
Last edited:
Updated the code: Cleaned out some garbage i had.

Wow .. (just seen the pics) Thats alot of stuff. How much to ship to USA? Well not all of it lol but a normal cost would be ?

EDIT: Just uploaded a video of it:

[embed]http://www.youtube.com/v/UM8ole2ZdvU[/embed]
 
Last edited:
looks awsome!!!!

I will ask at the post office next time im in how much it is to ship 500g to the US, then if your interested i'll give you a breif list of bits I have too many of, and you can let me know if your interested.

photos were just a small selection
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top