You are on page 1of 4

Caracter especial <3

18310054

#include <hidef.h> /* for EnableInterrupts macro */

#include "derivative.h" /* include peripheral declarations */

unsigned char tabla [8] = {0x38, 0x38, 0x38, 0x38, 0x0F, 0X06, 0X01, 0X00};

unsigned char mensaje [10] = {"clari"};

unsigned char codigo [9] = {"18310054"};

void retardo(unsigned int x);

void mcuinit (void);

void enable (void);

void comando(unsigned char x);

void datos (unsigned char x);

void inicializar (unsigned char *P);

void cadena (unsigned char *P);

void main(void) {

SOPT1= 0X12;

mcuinit();

inicializar(&tabla[0]);

cadena(&mensaje[0]);

comando(0xC0);

cadena(&codigo[0]);
fin: goto fin;

void mcuinit (void)

PTBDD = 0xFF;

PTADD_PTADD0 = 1;

PTADD_PTADD1 = 1;

PTBD = 0x38;

PTAD_PTAD0 = 0;

PTAD_PTAD1 = 0;

void enable (void)

PTAD_PTAD1 = 1;

retardo(0x1FFF);

PTAD_PTAD1 = 0;

void comando(unsigned char x)

PTBD = x;

PTAD_PTAD0 = 0;

enable();

}
void datos (unsigned char x)

PTBD = x;

PTAD_PTAD0 = 1;

enable();

void inicializar (unsigned char *P)

while(*P != 0x00)

comando(*P);

P++;

void cadena (unsigned char *P)

while (*P!= 0x00)

datos(*P);

P++;

void retardo(unsigned int x){

while(x!=0x0000)

{
x--;

You might also like