Modificar codigo assembler

Hola, necesito modificar un codigo assembler que encontré en la pagina de jose pino, se trata de un tacometro que al principio cuando lo conectas en los dysplays sale:

Jose
Pino
dot
Com

Yo quiero que salga:

Jose
Pino
RPM
CHCK

NO encuentro la linea del codigo donde hacerlo, puesto que yo se muy poco sobre pics.

Le dejo el codigo.

Muchas gracias
 

Adjuntos

  • tach-2.rar
    2.9 KB · Visitas: 56
Hola, no se mucho de assembler. Pero estaba viendo que al principio del asm tiene cargados unos datos que son guardados en la eeprom del pic, estos datos forman el mensaje:

"Tachometer II - www.josepino.com *TOR* April 22 2006 -" (sin comillas).

Si es eso lo que figura al iniciar el programa, el modificarlo es sencillo, si te fijas cada byte guardado en la eeprom tiene como dato un caracter ASCII, buscáte alguna tabla, en google (hay miles), y ponete a cambiar el mensaje a placer (fijate de poner el dato en hexa). En cuanto a la longitud de lo que agregues (si es que funciona) probá ver hasta donde te lee de la eeprom para mostrar el mensaje.. en el caso que pongas un texto más largo (incluido los espacio en blanco) y no se vea bien en el display capaz que tengas que modificar el asm en otro lugar para que lee más posiciones de memoria.

Salu2...
 
una duda tonta esto es asm o c

Código:
//include file
#include <pic.h>

//16F84 configuration 
__CONFIG(0x3FF1);

#define PORTBIT(adr, bit)    ((unsigned)(&adr)*8+(bit))

static bit LED0 @ PORTBIT(PORTB, 0);
static bit LED1 @ PORTBIT(PORTB, 1);
static bit LED2 @ PORTBIT(PORTB, 2);
static bit LED3 @ PORTBIT(PORTB, 3);
static bit LED4 @ PORTBIT(PORTB, 4);
static bit LED5 @ PORTBIT(PORTB, 5);
static bit LED6 @ PORTBIT(PORTB, 6);
static bit LED7 @ PORTBIT(PORTB, 7);

unsigned int i;        //for loop pause
unsigned int c;        //for loop event loop

//pause functions
void pause_1();
void pause_2();

//main function
void main(void)
{    

    TRISB = 0x00;
    PORTB = 0b00000000;    
    
    while(1)
    {

        for(c=0; c<10; c++)
        {


            //forward
            LED0 = 1; 
            pause_1();
        
            LED0 = 0;
            LED1 = 1;
            pause_1();
        
            LED1 = 0;
            LED2 = 1;
            pause_1();
        
            LED2 = 0;
            LED3 = 1;
            pause_1();
            
            LED3 = 0;
            LED4 = 1;
            pause_1();
        
            LED4 = 0;
            LED5 = 1;
            pause_1();
        
            LED5 = 0;
            LED6 = 1;
            pause_1();
            
            LED6 = 0;
            LED7 = 1;
            pause_1();
            
            LED7 = 0;


            //reverse
            LED6 = 1; 
            pause_1();
        
            LED6 = 0;
            LED5 = 1;
            pause_1();
            
            LED5 = 0;
            LED4 = 1;
            pause_1();
            
            LED4 = 0;
            LED3 = 1;
            pause_1();
            
            LED3 = 0;
            LED2 = 1;
            pause_1();
        
            LED2 = 0;
            LED1 = 1;
            pause_1();
        
            LED1 = 0;
            LED0 = 1;
            pause_1();
            
        
        };

        //re-initalize PORTB
        PORTB = 0b00000000;
        
        for(c=0; c<10; c++)
        {

            PORTB = 0b10101010;
            pause_2();
            
            PORTB = 0b01010101;
            pause_2();
            
        };

        for(c=0; c<10; c++)
        {

            PORTB = 0b11110000;
            pause_2();

            PORTB = 0b00001111;
            pause_2();

        };

        for(c=0; c<10; c++)
        {

            PORTB = 0b11001100;
            pause_2();

            PORTB = 0b00110011;
            pause_2();

        };

        for(c=0; c<10; c++)
        {

            PORTB = 0b10000001;
            pause_1();

            PORTB = 0b01000010;
            pause_1();

            PORTB = 0b00100100;
            pause_1();

            PORTB = 0b00011000;
            pause_1();

            PORTB = 0b00100100;
            pause_1();

            PORTB = 0b01000010;
            pause_1();

        };

    }

}

void pause_1()
{

    for(i=0; i<4000; i++);
    for(i=0; i<4000; i++);

};

void pause_2()
{

    for(i=0; i<4000; i++);
    for(i=0; i<4000; i++);
    for(i=0; i<4000; i++);
    for(i=0; i<4000; i++);
    for(i=0; i<4000; i++);
    for(i=0; i<4000; i++);

};


saludos.
 
Hola, no se mucho de assembler. Pero estaba viendo que al principio del asm tiene cargados unos datos que son guardados en la eeprom del pic, estos datos forman el mensaje:

"Tachometer II - www.josepino.com *TOR* April 22 2006 -" (sin comillas).

Si es eso lo que figura al iniciar el programa, el modificarlo es sencillo, si te fijas cada byte guardado en la eeprom tiene como dato un caracter ASCII, buscáte alguna tabla, en google (hay miles), y ponete a cambiar el mensaje a placer (fijate de poner el dato en hexa). En cuanto a la longitud de lo que agregues (si es que funciona) probá ver hasta donde te lee de la eeprom para mostrar el mensaje.. en el caso que pongas un texto más largo (incluido los espacio en blanco) y no se vea bien en el display capaz que tengas que modificar el asm en otro lugar para que lee más posiciones de memoria.

Salu2...

Hola, no, no parece ese mensaje solamente JOSE PINO DOT COM

He intentado cambiar los datos y simularlos con el proteus pero sigue saliendo lo mismo.

Un saludo
 
una duda tonta esto es asm o c

Código:
//include file
#include <pic.h>
 
//16F84 configuration 
__CONFIG(0x3FF1);
 
#define PORTBIT(adr, bit)    ((unsigned)(&adr)*8+(bit))
 
static bit LED0 @ PORTBIT(PORTB, 0);
static bit LED1 @ PORTBIT(PORTB, 1);
static bit LED2 @ PORTBIT(PORTB, 2);
static bit LED3 @ PORTBIT(PORTB, 3);
static bit LED4 @ PORTBIT(PORTB, 4);
static bit LED5 @ PORTBIT(PORTB, 5);
static bit LED6 @ PORTBIT(PORTB, 6);
static bit LED7 @ PORTBIT(PORTB, 7);
 
unsigned int i;        //for loop pause
unsigned int c;        //for loop event loop
 
//pause functions
void pause_1();
void pause_2();
 
//main function
void main(void)
{    
 
    TRISB = 0x00;
    PORTB = 0b00000000;    
 
    while(1)
    {
 
        for(c=0; c<10; c++)
        {
 
 
            //forward
            LED0 = 1; 
            pause_1();
 
            LED0 = 0;
            LED1 = 1;
            pause_1();
 
            LED1 = 0;
            LED2 = 1;
            pause_1();
 
            LED2 = 0;
            LED3 = 1;
            pause_1();
 
            LED3 = 0;
            LED4 = 1;
            pause_1();
 
            LED4 = 0;
            LED5 = 1;
            pause_1();
 
            LED5 = 0;
            LED6 = 1;
            pause_1();
 
            LED6 = 0;
            LED7 = 1;
            pause_1();
 
            LED7 = 0;
 
 
            //reverse
            LED6 = 1; 
            pause_1();
 
            LED6 = 0;
            LED5 = 1;
            pause_1();
 
            LED5 = 0;
            LED4 = 1;
            pause_1();
 
            LED4 = 0;
            LED3 = 1;
            pause_1();
 
            LED3 = 0;
            LED2 = 1;
            pause_1();
 
            LED2 = 0;
            LED1 = 1;
            pause_1();
 
            LED1 = 0;
            LED0 = 1;
            pause_1();
 
 
        };
 
        //re-initalize PORTB
        PORTB = 0b00000000;
 
        for(c=0; c<10; c++)
        {
 
            PORTB = 0b10101010;
            pause_2();
 
            PORTB = 0b01010101;
            pause_2();
 
        };
 
        for(c=0; c<10; c++)
        {
 
            PORTB = 0b11110000;
            pause_2();
 
            PORTB = 0b00001111;
            pause_2();
 
        };
 
        for(c=0; c<10; c++)
        {
 
            PORTB = 0b11001100;
            pause_2();
 
            PORTB = 0b00110011;
            pause_2();
 
        };
 
        for(c=0; c<10; c++)
        {
 
            PORTB = 0b10000001;
            pause_1();
 
            PORTB = 0b01000010;
            pause_1();
 
            PORTB = 0b00100100;
            pause_1();
 
            PORTB = 0b00011000;
            pause_1();
 
            PORTB = 0b00100100;
            pause_1();
 
            PORTB = 0b01000010;
            pause_1();
 
        };
 
    }
 
}
 
void pause_1()
{
 
    for(i=0; i<4000; i++);
    for(i=0; i<4000; i++);
 
};
 
void pause_2()
{
 
    for(i=0; i<4000; i++);
    for(i=0; i<4000; i++);
    for(i=0; i<4000; i++);
    for(i=0; i<4000; i++);
    for(i=0; i<4000; i++);
    for(i=0; i<4000; i++);
 
};


saludos.


No es el lugar adecuado para preguntar esto, pero deduzco que es C, ya que para aumentar la variable "i" han utilizado i++ en lugar de "incf i "
aparte de otras expresiones como "for" y "while" aparte del uso de // para comentar el texto

saludos
 
Última edición:
una duda tonta esto es asm o c

Código:
//include file
#include <pic.h>

//16F84 configuration 
__CONFIG(0x3FF1);

#define PORTBIT(adr, bit)    ((unsigned)(&adr)*8+(bit))

static bit LED0 @ PORTBIT(PORTB, 0);
static bit LED1 @ PORTBIT(PORTB, 1);
static bit LED2 @ PORTBIT(PORTB, 2);
static bit LED3 @ PORTBIT(PORTB, 3);
static bit LED4 @ PORTBIT(PORTB, 4);
static bit LED5 @ PORTBIT(PORTB, 5);
static bit LED6 @ PORTBIT(PORTB, 6);
static bit LED7 @ PORTBIT(PORTB, 7);

unsigned int i;        //for loop pause
unsigned int c;        //for loop event loop

//pause functions
void pause_1();
void pause_2();

//main function
void main(void)
{    

    TRISB = 0x00;
    PORTB = 0b00000000;    
    
    while(1)
    {

        for(c=0; c<10; c++)
        {


            //forward
            LED0 = 1; 
            pause_1();
        
            LED0 = 0;
            LED1 = 1;
            pause_1();
        
            LED1 = 0;
            LED2 = 1;
            pause_1();
        
            LED2 = 0;
            LED3 = 1;
            pause_1();
            
            LED3 = 0;
            LED4 = 1;
            pause_1();
        
            LED4 = 0;
            LED5 = 1;
            pause_1();
        
            LED5 = 0;
            LED6 = 1;
            pause_1();
            
            LED6 = 0;
            LED7 = 1;
            pause_1();
            
            LED7 = 0;


            //reverse
            LED6 = 1; 
            pause_1();
        
            LED6 = 0;
            LED5 = 1;
            pause_1();
            
            LED5 = 0;
            LED4 = 1;
            pause_1();
            
            LED4 = 0;
            LED3 = 1;
            pause_1();
            
            LED3 = 0;
            LED2 = 1;
            pause_1();
        
            LED2 = 0;
            LED1 = 1;
            pause_1();
        
            LED1 = 0;
            LED0 = 1;
            pause_1();
            
        
        };

        //re-initalize PORTB
        PORTB = 0b00000000;
        
        for(c=0; c<10; c++)
        {

            PORTB = 0b10101010;
            pause_2();
            
            PORTB = 0b01010101;
            pause_2();
            
        };

        for(c=0; c<10; c++)
        {

            PORTB = 0b11110000;
            pause_2();

            PORTB = 0b00001111;
            pause_2();

        };

        for(c=0; c<10; c++)
        {

            PORTB = 0b11001100;
            pause_2();

            PORTB = 0b00110011;
            pause_2();

        };

        for(c=0; c<10; c++)
        {

            PORTB = 0b10000001;
            pause_1();

            PORTB = 0b01000010;
            pause_1();

            PORTB = 0b00100100;
            pause_1();

            PORTB = 0b00011000;
            pause_1();

            PORTB = 0b00100100;
            pause_1();

            PORTB = 0b01000010;
            pause_1();

        };

    }

}

void pause_1()
{

    for(i=0; i<4000; i++);
    for(i=0; i<4000; i++);

};

void pause_2()
{

    for(i=0; i<4000; i++);
    for(i=0; i<4000; i++);
    for(i=0; i<4000; i++);
    for(i=0; i<4000; i++);
    for(i=0; i<4000; i++);
    for(i=0; i<4000; i++);

};


saludos.

C, fíjate en que usa "{, }, ;" etc.. y los tipos de datos que usa son los de C también. :)
 
Atrás
Arriba