Programacion de pic a pantalla sin chip select

por favor necesito ayuda tengo este codigo en un pic pero al conectar la pantalla no tengo ningun resultado en la simulacion funciona perfectamente pero en comparacion a la simulacion la pantalla que tengo no tiene los pines del chip select es una pantalla QC12864B si talvez me pudieran ayudar a saber como se conectaria esta pantalla o si talvez debo cambiar algo al codigo en pic c este es el codigo


Código:
[#include <16f877A.h>
#fuses XT,NOWDT
#use delay(clock=20000000)
//#use standard_io(b)
//#use standard_io(c)
#include <Protyecto.c>
#include <graphics.c>
#use standard_io(B)
int a,con_pul,termino,time,dato,conteo;
char num[]={"     Pulsos/minuto"};

char b[]="Estado:";
char d[]="Normal";
char e[]="Bradicardia";
char f[]="Taquicardia";
char g[]="Universidad Nacional";
char h[]=" de Loja";
char i[]="Integrantes:";
char j[]="Fernanda Macas";
char k[]="Bryan Suquilanda";
char l[]="Diego Sanchez";
char m[]="Electronica y Telecomunicaciones";

void delay(){delay_ms(2);}

void pulso(){

glcd_pixel((a+0),56,ON);delay();
glcd_pixel((a+1),56,ON);delay();
glcd_pixel((a+2),56,ON);delay();

glcd_pixel((a+3),56,ON);delay();
glcd_pixel((a+3),55,ON);delay();
glcd_pixel((a+3),54,ON);delay();

glcd_pixel((a+4),53,ON);delay();

glcd_pixel((a+5),54,ON);delay();
glcd_pixel((a+5),55,ON);delay();
glcd_pixel((a+5),56,ON);delay();
glcd_pixel((a+5),57,ON);delay();

glcd_pixel((a+6),58,ON);delay();

glcd_pixel((a+7),58,ON);delay();
glcd_pixel((a+7),57,ON);delay();
glcd_pixel((a+7),56,ON);delay();
glcd_pixel((a+7),55,ON);delay();

glcd_pixel((a+8),54,ON);delay();
glcd_pixel((a+8),53,ON);delay();
glcd_pixel((a+8),52,ON);delay();
glcd_pixel((a+8),51,ON);delay();
glcd_pixel((a+8),50,ON);delay();
glcd_pixel((a+8),49,ON);delay();
glcd_pixel((a+8),48,ON);delay();
glcd_pixel((a+8),47,ON);delay();
glcd_pixel((a+8),46,ON);delay();

glcd_pixel((a+9),45,ON);delay();
glcd_pixel((a+9),44,ON);delay();
glcd_pixel((a+9),43,ON);delay();
glcd_pixel((a+9),42,ON);delay();
glcd_pixel((a+9),41,ON);delay();

glcd_pixel((a+10),40,ON);delay();
glcd_pixel((a+10),39,ON);delay();
glcd_pixel((a+10),38,ON);delay();
glcd_pixel((a+10),37,ON);delay();
glcd_pixel((a+10),36,ON);delay();

glcd_pixel((a+11),35,ON);delay();
glcd_pixel((a+11),34,ON);delay();
glcd_pixel((a+11),33,ON);delay();

glcd_pixel((a+12),36,ON);delay();
glcd_pixel((a+12),37,ON);delay();
glcd_pixel((a+12),38,ON);delay();
glcd_pixel((a+12),39,ON);delay();
glcd_pixel((a+12),40,ON);delay();
glcd_pixel((a+12),41,ON);delay();
glcd_pixel((a+12),42,ON);delay();
glcd_pixel((a+12),43,ON);delay();
glcd_pixel((a+12),44,ON);delay();
glcd_pixel((a+12),45,ON);delay();

glcd_pixel((a+13),46,ON);delay();
glcd_pixel((a+13),47,ON);delay();
glcd_pixel((a+13),48,ON);delay();
glcd_pixel((a+13),49,ON);delay();
glcd_pixel((a+13),50,ON);delay();
glcd_pixel((a+13),51,ON);delay();
glcd_pixel((a+13),52,ON);delay();
glcd_pixel((a+13),53,ON);delay();
glcd_pixel((a+13),54,ON);delay();
glcd_pixel((a+13),55,ON);delay();
glcd_pixel((a+13),56,ON);delay();

glcd_pixel((a+14),57,ON);delay();
glcd_pixel((a+14),58,ON);delay();
glcd_pixel((a+14),59,ON);delay();
glcd_pixel((a+14),60,ON);delay();

glcd_pixel((a+15),61,ON);delay();
glcd_pixel((a+15),62,ON);delay();
glcd_pixel((a+15),63,ON);delay();

glcd_pixel((a+16),60,ON);delay();
glcd_pixel((a+16),59,ON);delay();

glcd_pixel((a+17),58,ON);delay();
glcd_pixel((a+17),57,ON);delay();
glcd_pixel((a+17),56,ON);delay();

glcd_pixel((a+18),56,ON);delay();
glcd_pixel((a+19),56,ON);delay();

glcd_pixel((a+20),56,ON);delay();
glcd_pixel((a+20),55,ON);delay();

glcd_pixel((a+21),54,ON);delay();

glcd_pixel((a+22),53,ON);delay();
glcd_pixel((a+23),53,ON);delay();

glcd_pixel((a+24),54,ON);delay();

glcd_pixel((a+25),55,ON);delay();
glcd_pixel((a+25),56,ON);delay();

glcd_pixel((a+26),56,ON);delay();
glcd_pixel((a+27),56,ON);delay();
glcd_pixel((a+28),56,ON);delay();
glcd_pixel((a+29),56,ON);delay();
glcd_pixel((a+30),56,ON);delay();
glcd_pixel((a+31),56,ON);delay();
glcd_pixel((a+32),56,ON);delay();

}

void conversor(){

num[0]=(dato/100)+0x30;
num[1]=((dato%100)/10)+0x30;
num[2]=((dato%100)%10)+0x30;

}

#int_timer1
void tem_10seg(){
if(time==90){termino=1;time=0;}
set_timer1(3036);
time=time+1;
}

void main() { 
setup_timer_1(t1_disabled);
setup_timer_1(T1_INTERNAL|T1_DIV_BY_8);
////TMR1=59464 CON 4MHZ para 1seg
////TMR1=3036 con 20mhz para 0.1 seg
set_timer1(3036);
enable_interrupts(int_timer1);
enable_interrupts(global);

glcd_init(ON);   // iniciamos la lcd 
glcd_fillScreen(0); //LIMPIAMOS LA PANTALLA 
glcd_text57(5 ,3, g, 1, 1);
glcd_text57(30 ,22, h, 1, 1);
glcd_text57(1 ,42, m, 1, 1);
delay_ms(3000);
setup_timer_1(t1_disabled);
glcd_fillScreen(0);
glcd_text57(5 ,3, i, 1, 1);
glcd_text57(30 ,22, j, 1, 1);
glcd_text57(30 ,34, k, 1, 1);
glcd_text57(30 ,47, l, 1, 1);
delay_ms(3000);
setup_timer_1(t1_disabled);
glcd_fillScreen(0);
glcd_text57(1 ,3, num, 1, 1);
glcd_text57(1 ,16, b, 1, 1);

while(1){ 
   
   while(input(pin_b3)==0)
   { 
   
   };
   con_pul=con_pul+1;output_low(pin_b6);
      if (con_pul==1){setup_timer_1(T1_INTERNAL|T1_DIV_BY_8);set_timer1(3036);time=0;}
   if (termino==1){setup_timer_1(t1_disabled);
       
       output_high(pin_b6);
       conteo = 0;
       
       con_pul=(con_pul-1)*6;
       termino=0;
       dato=con_pul;
       con_pul=0;
       conversor();
      
       //glcd_fillScreen(0); //LIMPIAMOS LA PANTALLA
       
       glcd_rect(1,1,19,9,1,0);
       glcd_rect(49,16,120,22,1,0);
       
       glcd_text57(1 ,3, num, 1, 1);
       glcd_text57(1 ,16, b, 1, 1);
       
       
       if(dato > 100){glcd_text57(49,16, f, 1, 1);} 
       else if(dato < 60){glcd_text57(49,16, e, 1, 1);} 
       else glcd_text57(49,16, d, 1, 1);
       
       }
   
   if(a==132){
      a=0;
      glcd_fillScreen(0);glcd_text57(1 ,3, num, 1, 1);
      glcd_text57(1 ,16, b, 1, 1);
       if(dato > 100){glcd_text57(49,16, f, 1, 1);} 
       else if(dato < 60 && dato!=0){glcd_text57(49,16, e, 1, 1);} 
       else if(dato !=0){glcd_text57(49,16, d, 1, 1);}
   }
      pulso();
      a=a+33;
      conteo=conteo+1;
   
 }//end while //Ciclo infinito 


}//end main] ...
 
Última edición por un moderador:
Atrás
Arriba