Pic 10f4550

Solo disponible en BuenasTareas
  • Páginas : 2 (258 palabras )
  • Descarga(s) : 0
  • Publicado : 21 de febrero de 2012
Leer documento completo
Vista previa del texto
/* * File: BB.c * Author: Christian * * Created on 21 de febrero de 2012, 09:17 AM */ #include #include #include #include #include

//Rutinas de retardos

int z,a,i,j,x;double v; int vr; char mybuff1[11] = {"Store 10mV"}; char mybuff2[12] = {"Aprox 6kmH"}; char mybuff3[16] = {"Escala Beaufort"}; char mybuff4[11] = {"Store 20mV"}; char mybuff5[12] = {"Aprox8kmH"}; char mybuff6[11] = {"Store 30mV"}; char mybuff7[13] = {"Aprox 10kmH"}; char mybuff8[11] = {"Store 40mV"}; char mybuff9[13] = {"Aprox 12kmH"}; char mybuff10[11]= {"Store 50mV"};char mybuff11[13]= {"Aprox 14kmH"}; char mybuff12[11]= {"Store 60mV"}; char mybuff13[13]= {"Aprox 16kmH"}; char mybuff14[11]={"Store 70mV"}; char mybuff15[13]={"Aprox3 18kmH"}; charmybuff16[12]={"Store 80mV"}; char mybuff17[13]={"Aprox 20kmH"}; char mybuff18[11]={"Store 90mV"}; char mybuff19[13]={"Aprox 22kmH"}; char mybuff20[12]={"Store 100mV"}; charmybuff21[12]={"Aprox 24kmH"}; #pragma code REMAPPED_RESET_VECTOR=0x1000 extern void _startup (void); void _reset (void) { _asm goto _startup _endasm } #pragma code void external_isr(void); #pragmacode interrupt_vector=0x08 void interrupt_vector(void) { _asm GOTO external_isr _endasm } #pragma code #pragma interrupt external_isr void external_isr(void)

{ if (PIR1bits.ADIF) {PIR1bits.ADIF=0; ConvertADC(); while(BusyADC()); vr=ReadADC(); v=(vr/1023)*5; } } void DelayFor18TCY(void) { Nop(); Nop(); Nop(); Nop(); Nop(); Nop(); Nop(); Nop(); Nop(); Nop(); Nop();Nop(); Nop(); Nop(); } void DelayPORXLCD (void) { Delay1KTCYx(1); // Delay of 15ms // Cycles = (TimeDelay * Fosc) / 4 // Cycles = (15ms * 16MHz) / 4 // Cycles = 60,000 return; } voidDelayXLCD (void) { Delay1KTCYx(1); // Delay of 5ms // Cycles = (TimeDelay * Fosc) / 4 // Cycles = (5ms * 16MHz) / 4 // Cycles = 20,000 return; } void delay1s (void) { int i; for (i=0;i
tracking img