littletransistor
New Member
Hey there!
I got the routines and the small 0-99 counter for that microcon, but I can't seem to get 2 displays working at the same time.
I tried putting the "displaying two displays" at the interrupt section, and I got stuck. Here's the code:
what could i have been missing?
I got the routines and the small 0-99 counter for that microcon, but I can't seem to get 2 displays working at the same time.
I tried putting the "displaying two displays" at the interrupt section, and I got stuck. Here's the code:
Code:
#include <htc.h>
__CONFIG(INTIO & WDTDIS & PWRTEN & MCLRDIS & UNPROTECT
& BORDIS & LVPDIS);
//0b0gfedcba
char numbers[] = {0b00111111, // 0
0b00000110, // 1
0b01011011, // 2
0b01001111, // 3
0b01100110, // 4
0b01101101, // 5
0b01111101, // 6
0b00000111, // 7
0b01111111, // 8
0b01101111, // 9
};
int i, j, k;
int counter;
int ones = 0;
int tens = 0;
void interrupt tmrlint(void)
{
if(TMR1IF)
{
TMR1IF = 0; //got stuck over there!
};
void main()
{
TRISA = 0x00;
TRISB = 0x00;
PORTA = 0b0000010;
PORTB = 0x00;
PEIE = 1;
GIE = 1;
TMR1IE = 1;
T1CON = 0b00110101;
while(1)
{
ones++;
if (ones > 9)
{
tens++;
ones = 0;
}
}
}
what could i have been missing?