PIC18F4431 esta lento

sou novato no pic e gostaria de saber porque o o PIC18F4431 esta tao lento....
compilei este programinha pra testar o PIC18F4431 e ele demora ...
algo estranho.... pisca depois de muito tempo..
Uso hitech 8.3 ......e num achei o 18f4431.h nele sera que falta algum setup via software...?....ou.....???
cpp code
compilei este programinha pra testar o PIC18F4431 e ele demora ...
algo estranho.... pisca depois de muito tempo..
Uso hitech 8.3 ......e num achei o 18f4431.h nele sera que falta algum setup via software...?....ou.....???
cpp code
#include <pic18.h>
#define PORTBIT(adr, bit)((unsigned)(&adr)*8+(bit))
//portb pin assignment
static bit LED0 @ PORTBIT(PORTB, 0);
static bit LED1 @ PORTBIT(PORTB, 1);
static bit LED2 @ PORTBIT(PORTB, 2);
static bit LED3 @ PORTBIT(PORTB, 3);
static bit LED4 @ PORTBIT(PORTB, 4);
static bit LED5 @ PORTBIT(PORTB, 5);
static bit LED6 @ PORTBIT(PORTB, 6);
static bit LED7 @ PORTBIT(PORTB, 7);
//global variables
unsigned int i; //for loop pause
unsigned int c; //for loop event loop
//functions
void pause_action(); //pause
void blink_redgreen(); //blink red then green
void blink_baf(); //blink red and green back and forth
void alt_blink(); //every other red then green
void blink_sequence(); //blinks red one at a time
//end functions
//main function
void main(void)
{
TRISA = 0x00;
TRISB = 0x00;
TRISC = 0x00;
TRISD = 0x00;
PORTA = 0b00000000;
PORTB = 0b00000000;
PORTC = 0b00000000;
PORTD = 0xFF;
while(1){
blink_redgreen();
blink_baf();
alt_blink();
blink_sequence();
}
}
//end main function
void pause_action()
{
for(i=0; i<4000; i++);
for(i=0; i<4000; i++);
// for(i=0; i<4000; i++);
// for(i=0; i<4000; i++);
// for(i=0; i<4000; i++);
//for(i=0; i<4000; i++);
}
void blink_redgreen()
{
for(c=0; c<10; c++)
{
PORTA = 0b10101010;
PORTB = 0b10101010;
PORTC = 0b10101010;
pause_action();
PORTA = 0b01010101;
PORTB = 0b01010101;
PORTC = 0b01010101;
pause_action();
}
}
void blink_baf()
{
for(c=0; c<10; c++)
{
PORTA = 0b10100101;
PORTB = 0b10100101;
PORTC = 0b10100101;
pause_action();
PORTA = 0b01011010;
PORTB = 0b01011010;
PORTC = 0b01011010;
pause_action();
}
}
void alt_blink()
{
for(c=0; c<10; c++)
{
PORTA = 0b10011001;
PORTB = 0b10011001;
PORTC = 0b10011001;
pause_action();
PORTA = 0b01100110;
PORTB = 0b01100110;
PORTC = 0b01100110;
pause_action();
}
}
void blink_sequence()
{
for(c=0; c<10; c++){
PORTB = 0b10010101;
pause_action();
PORTB = 0b01100101;
pause_action();
PORTB = 0b01011001;
pause_action();
PORTB = 0b01010110;
pause_action();
}
}