/*
    
    6/24/03
    Copyright Spark Fun Electronics 2003©
    
    Classic Blinking Test Routine for the 18 Pin PIC16F84A
    
    Flashes all pins on PIC - 20MHz operations
    
*/

#include "d:\Pics\c\16F84A.h"  // device dependent definitions

//#pragma config WDTE=off, FOSC=HS
#pragma config |= 0x3FF2 //HS Oscillator, Code Protect Off

void delay_ms(uns16);

void main()
{
    
    PORTA = 0b.0000.0000;
    TRISA = 0b.0000.0000;  //0 = Output, 1 = Input

    PORTB = 0b.0000.0000;
    TRISB = 0b.0000.0000;  //0 = Output, 1 = Input

    while (1)
    {
        
        PORTA = 0xFF;
        PORTB = 0xFF;
        delay_ms(1000);
        
        PORTA = 0x00;
        PORTB = 0x00;
        delay_ms(1000);
    }

}

//General short delay
void delay_ms(uns16 x)
{
    uns8 y, z;
    for ( ; x > 0 ; x--)
        for ( y = 0 ; y < 4 ; y++)
            for ( z = 0 ; z < 176 ; z++);
}


