aqui les posteo mi programiya!
#define XTAL 4000000
#define amon (RA0=1,RA2=1,RB1=1,RB3=1)
#define amoff (RA0=0,RA2=0,RB1=0,RB3=0,RB6=1)
#include <htc.h>
#include <pic.h>
__CONFIG(0x3FFB&0x3FFD);
long int z,x;
int j,seg,sama,i,a,b,c,d;
void interrupt isr_tmr0(void)
{
j++;
if(j == 961)
{
seg++;
sama++;
a++;
}
if(j == 1922)
{
seg++;
sama++;
a++;
j = 0;
}
TMR0 = 130;
T0IF = 0;
}
main()
{
TRISA=0x00;
TRISB=0x00;
RA0=0;
RA1=0;
RA2=0;
RA3=0;
RA4=0;
RB0=0;
RB1=0;
RB2=0;
RB3=0;
RB4=0;
RB5=0;
RB7=0;
TMR0 = 130;
T0CS = 0;
PSA = 0;
PS2 = 0;
PS1 = 1;
PS0 = 0;
T0IE = 1;
GIE = 1;
for(;
{
if(seg<=12)
{
RB6=1;
if(sama == 1)
{
amon;
}
if(sama == 2)
{
amoff; sama = 0;
}
a=0;
}
}
}