Prototipo

Páginas: 2 (375 palabras) Publicado: 12 de junio de 2011
#include
#device adc=8

#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz)
#FUSES NOPUT //No Power Up Timer#FUSES NOPROTECT //Code not protected from reading
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP//No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOCPD //No EE protection
#FUSES NOWRT //Program memory not write protected

#usedelay(clock=12000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)

void main()
{

setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_psp(PSP_DISABLED);setup_spi(FALSE);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);SET_TRIS_B(0XFF);
SET_TRIS_C(0XFF);
SET_TRIS_D(0XFF);
SET_TRIS_A(0XFF);
OUTPUT_B(0X00);
OUTPUT_C(0X00);
OUTPUT_D(0X00);
OUTPUT_A(0X00);

//TODO: User Code

WHILE(1)
{OUTPUT_BIT(PIN_A1,1);
OUTPUT_BIT(PIN_C0,1);
OUTPUT_BIT(PIN_D0,1);
OUTPUT_BIT(PIN_B2,1);

OUTPUT_BIT(PIN_B2,1);
DELAY_MS(500);
OUTPUT_BIT(PIN_B2,1);
DELAY_MS(50);
OUTPUT_BIT(PIN_B2,0);DELAY_MS(50);
OUTPUT_BIT(PIN_B2,1);
DELAY_MS(50);
OUTPUT_BIT(PIN_B2,0);
DELAY_MS(50);
OUTPUT_BIT(PIN_B2,1);
DELAY_MS(50);
OUTPUT_BIT(PIN_B2,0);
DELAY_MS(50);
OUTPUT_BIT(PIN_B2,1);
DELAY_MS(50);OUTPUT_BIT(PIN_B2,0);
DELAY_MS(50);
OUTPUT_BIT(PIN_B1,1);
DELAY_MS(200);
OUTPUT_BIT(PIN_B1,0);
OUTPUT_BIT(PIN_B0,1);
OUTPUT_BIT(PIN_C0,0);
OUTPUT_BIT(PIN_C2,1);
DELAY_MS(500);OUTPUT_BIT(PIN_B0,1);
DELAY_MS(100);
OUTPUT_BIT(PIN_C2,0);
DELAY_MS(50);
OUTPUT_BIT(PIN_C2,1);
DELAY_MS(50);
OUTPUT_BIT(PIN_C2,0);
DELAY_MS(50);
OUTPUT_BIT(PIN_C2,1);
DELAY_MS(50);
OUTPUT_BIT(PIN_C2,0);...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • PROTOTIPOS
  • Prototipo
  • Prototipos
  • Prototipo
  • PROTOTIPO
  • Prototipos
  • prototipo
  • Prototipo

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS