adimadayan
Newbie level 4
- Joined
- Oct 27, 2013
- Messages
- 5
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 46
Hi post the compressed proteus project and Do you want to just adjust the values in the display by 3 buttons?? like one is used for selecting the segment one for increment and another one for decrement??can any one please help me to make MicroC Pro for Pic code for the attached schematic. the 4SSDs to display 4digit numbers set by the 3Buttons
Thanks
Madayan
https://obrazki.elektroda.pl/6007905700_1382893799.jpg
- - - Updated - - -
View attachment 97811
MPLXING SSDs
can any one please help me to make MicroC Pro for Pic code for the attached schematic. the 4SSDs to display 4digit numbers set by the 3Buttons
Thanks
Madayan
https://obrazki.elektroda.pl/6007905700_1382893799.jpg
- - - Updated - - -
View attachment 97811
MPLXING SSDs
//PIC16F627A
//4MHz Internal OSC
//MUX by the MUC itself with Interrupt
//TMR0 .. check the prescelar+delay in scan routine as they are related
//punkky@gmail.com
unsigned short number [10] = {0x5F, 0x06, 0x9b, 0x8f, 0xC6, 0xCd, 0xDD, 0x07, 0xDf, 0xCf};
unsigned short digit [6];
unsigned short counter;
unsigned short shift_register;
unsigned short x1;
unsigned short x2;
unsigned short x3;
unsigned short x4;
unsigned short x5;
unsigned short x6;
unsigned short tick;
void interrupt ()
{
if (INTCON.T0IF)
{
//Scan digits with TMR0
INTCON.T0IF = 0;
if (counter == 5)
{
PORTA = number [digit [counter]];
Delay_us (500);
shift_register = 0x01;
PORTB = ~shift_register;
PORTA = 0x00;
counter = 0;
} else
{
PORTA = number [digit [counter]];
Delay_us (500);
shift_register = shift_register << 1;
PORTB = ~shift_register;
PORTA = 0x00;
counter ++;
}
}
if (PIR1.TMR1IF)
{
TMR1H = 0x80;
PIR1.TMR1IF = 0;
tick = 1;
//update current time
x6 ++;
if (x6 > 9)
{
x6 = 0;
x5 ++;
if (x5 > 9)
{
x5 = 0;
x4 ++;
if (x4 > 9)
{
x4 = 0;
x3 ++;
if (x3 > 9)
{
x3 = 0;
x2 ++;
if (x2 > 9)
{
x2 = 0;
x1 ++;
if (x1 > 9)
{
x1 = 0;
}
}
}
}
}
}
}
}
void main ()
{
//Digital I/O for PORTA
CMCON = 0x07;
TRISA = 0x00;
PORTA = 0x00;
TRISB = 0x00;
PORTB = 0x00;
//Internal Clock 4MHz
PCON.OSCF = 1;
counter = 0;
// Enable TMR0
OPTION_REG.T0CS = 0;
// Enable Prescaler
OPTION_REG.PSA = 0;
// PS0,1,2 = 010 = 3
// 3 means 1:8 prescaler
// 1:2, 1:4, 1:8, 1:16, 1:32, 1:64, 1:128, 1:256
OPTION_REG.PS2 = 0;
OPTION_REG.PS1 = 1;
OPTION_REG.PS0 = 0;
INTCON.T0IF = 0;
INTCON.T0IE = 1;
INTCON.GIE = 1;
INTCON.PEIE = 1;
T1CON = 0x0F;
TMR1H = 0x80;
TMR1L = 0x00;
// Enable TMR1 interrupt
PIE1.TMR1IE = 1;
shift_register = 0x01;
x1 = 0;
x2 = 0;
x3 = 0;
x4 = 0;
x5 = 0;
x6 = 0;
while (1)
{
if (tick)
{
tick = 0;
//update digits
digit [0] = x1;
digit [1] = x2;
digit [2] = x3;
digit [3] = x4;
digit [4] = x5;
digit [5] = x6;
}
}
}
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?