SMK Binawiyata Sragen

  • This is default featured slide 1 title

    Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

  • This is default featured slide 2 title

    Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

  • This is default featured slide 3 title

    Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

  • This is default featured slide 4 title

    Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

  • This is default featured slide 5 title

    Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Jam Dot Matrik Jumbo


Silahkan downlod disini filenya
Download file hex nya disini


Kode Listing : CodeVision

/*****************************************************
This program was produced by the
CodeWizardAVR V1.25.5 Professional

Project : jam Digital Jumbo
Version : J01/13
Date    : 20 Januari 2013
Author  : Suparno
Company :SMK Binawiyata Sragen
Comments:


Chip type           : ATmega32
Program type        : Application
Clock frequency     : 12.000000 MHz
Memory model        : Small
External SRAM size  : 0
Data Stack size     : 512
*****************************************************/

#include

#include

flash unsigned char numfont[11][24][2]=
{/*0*/{{ 255 , 255 } , { 63 , 252 } , { 143 , 241 } , { 199 , 227 } , { 199 , 195 } , { 195 , 195 } , { 195 , 195 } , { 193 , 131 } , { 193 , 131 } , { 193 , 131 } , { 193 , 131 } , { 193 , 131 } , { 193 , 131 } , { 193 , 131 } , { 193 , 131 } , { 193 , 131 } , { 193 , 131 } , { 195 , 195 } , { 195 , 195 } , { 199 , 195 } , { 135 , 225 } , { 31 , 248 } , { 255 , 255 } , { 255 , 255 }}
,/*1*/{{ 255 , 255 } , { 255 , 252 } , { 63 , 252 } , { 7 , 252 } , { 3 , 252 } , { 31 , 252 } , { 31 , 252 } , { 31 , 252 } , { 31 , 252 } , { 31 , 252 } , { 31 , 252 } , { 31 , 252 } , { 31 , 252 } , { 31 , 252 } , { 31 , 252 } , { 31 , 252 } , { 31 , 252 } , { 31 , 252 } , { 31 , 252 } , { 31 , 252 } , { 31 , 248 } , { 3 , 224 } , { 255 , 255 } , { 255 , 255 }}
,/*2*/{{ 255 , 255 } , { 31 , 252 } , { 7 , 248 } , { 3 , 240 } , { 1 , 224 } , { 57 , 224 } , { 125 , 224 } , { 255 , 224 } , { 255 , 224 } , { 255 , 240 } , { 255 , 240 } , { 255 , 248 } , { 127 , 252 } , { 127 , 252 } , { 63 , 254 } , { 31 , 255 } , { 159 , 247 } , { 207 , 243 } , { 7 , 248 } , { 3 , 248 } , { 1 , 248 } , { 0 , 248 } , { 255 , 255 } , { 255 , 255 }}
,/*3*/{{ 255 , 255 } , { 63 , 240 } , { 15 , 224 } , { 231 , 192 } , { 251 , 193 } , { 255 , 193 } , { 255 , 225 } , { 255 , 248 } , { 127 , 248 } , { 31 , 224 } , { 63 , 192 } , { 255 , 128 } , { 255 , 129 } , { 255 , 129 } , { 255 , 131 } , { 255 , 131 } , { 255 , 131 } , { 243 , 195 } , { 225 , 227 } , { 193 , 225 } , { 1 , 248 } , { 7 , 254 } , { 255 , 255 } , { 255 , 255 }}
,/*4*/{{ 255 , 255 } , { 255 , 227 } , { 255 , 227 } , { 255 , 225 } , { 255 , 224 } , { 127 , 224 } , { 127 , 224 } , { 191 , 224 } , { 223 , 224 } , { 239 , 224 } , { 239 , 224 } , { 247 , 224 } , { 251 , 224 } , { 253 , 224 } , { 1 , 128 } , { 1 , 128 } , { 1 , 128 } , { 255 , 224 } , { 255 , 224 } , { 255 , 224 } , { 255 , 224 } , { 255 , 224 } , { 255 , 255 } , { 255 , 255 }}
,/*5*/{{ 255 , 255 } , { 31 , 128 } , { 15 , 192 } , { 15 , 192 } , { 15 , 224 } , { 247 , 255 } , { 247 , 255 } , { 7 , 255 } , { 3 , 248 } , { 3 , 240 } , { 3 , 224 } , { 1 , 192 } , { 127 , 128 } , { 255 , 131 } , { 255 , 135 } , { 255 , 143 } , { 255 , 159 } , { 243 , 159 } , { 193 , 223 } , { 129 , 207 } , { 3 , 231 } , { 7 , 248 } , { 255 , 255 } , { 255 , 255 }}
,/*6*/{{ 255 , 255 } , { 255 , 135 } , { 255 , 224 } , { 127 , 248 } , { 31 , 254 } , { 15 , 255 } , { 143 , 255 } , { 135 , 255 } , { 131 , 255 } , { 3 , 240 } , { 195 , 225 } , { 193 , 193 } , { 193 , 131 } , { 193 , 131 } , { 193 , 131 } , { 193 , 131 } , { 193 , 131 } , { 195 , 131 } , { 131 , 195 } , { 135 , 195 } , { 143 , 225 } , { 63 , 248 } , { 255 , 255 } , { 255 , 255 }}
,/*7*/{{ 255 , 255 } , { 3 , 192 } , { 3 , 192 } , { 3 , 192 } , { 3 , 224 } , { 249 , 231 } , { 253 , 231 } , { 255 , 243 } , { 255 , 243 } , { 255 , 243 } , { 255 , 249 } , { 255 , 249 } , { 255 , 249 } , { 255 , 252 } , { 255 , 252 } , { 255 , 252 } , { 127 , 254 } , { 127 , 254 } , { 127 , 254 } , { 63 , 255 } , { 63 , 255 } , { 63 , 255 } , { 255 , 255 } , { 255 , 255 }}
,/*8*/{{ 255 , 255 } , { 31 , 240 } , { 135 , 227 } , { 195 , 199 } , { 193 , 135 } , { 193 , 135 } , { 129 , 135 } , { 1 , 135 } , { 3 , 194 } , { 3 , 240 } , { 7 , 240 } , { 31 , 224 } , { 31 , 192 } , { 71 , 192 } , { 227 , 128 } , { 225 , 129 } , { 225 , 131 } , { 225 , 131 } , { 225 , 195 } , { 227 , 195 } , { 199 , 225 } , { 15 , 248 } , { 255 , 255 } , { 255 , 255 }}
,/*9*/{{ 255 , 255 } , { 31 , 252 } , { 135 , 241 } , { 195 , 225 } , { 195 , 193 } , { 193 , 195 } , { 193 , 131 } , { 193 , 131 } , { 193 , 131 } , { 193 , 131 } , { 193 , 131 } , { 131 , 131 } , { 135 , 131 } , { 15 , 192 } , { 255 , 195 } , { 255 , 225 } , { 255 , 225 } , { 255 , 240 } , { 127 , 248 } , { 31 , 252 } , { 7 , 255 } , { 195 , 255 } , { 255 , 255 } , { 255 , 255 }}
,/*:*/{{255,255},{255,255},{255,255},{255,255},{255,255},{255,255},{255,255},{255,255},{193,255},{193,255},{193,255},{193,255},{193,255},{255,255},{255,255},{255,255},{255,255},{193,255},{193,255},{193,255},{193,255},{193,255},{255,255},{255,255}}};




unsigned char satr=0;

unsigned char hour=10,minute=58,second=30,weekday=6,monthday=7,monthyear=5,timedigit[9];
unsigned int year=1386;


interrupt [TIM1_OVF] void timer1_ovf_isr(void)
{
   unsigned char i=0,j;
   TCNT1H=0xd1;
   TCNT1L=0x1f;

   PORTB.0=1;//OE inactive
   PORTD=0xff-numfont[hour/10][satr][0];
   PORTC=0x20|i;
   PORTC=PORTC|0x30;
   i++;
   PORTD=0xff-numfont[hour/10][satr][1];
   PORTC=0x20|i;
   PORTC=PORTC|0x30;
   i++;
  
   PORTD=0xff-numfont[hour%10][satr][0];
   PORTC=0x20|i;
   PORTC=PORTC|0x30;
   i++;
   PORTD=0xff-numfont[hour%10][satr][1];
   PORTC=0x20|i;
   PORTC=PORTC|0x30;
   i++;
  
   PORTD=0xff-numfont[10][satr][0];
   PORTC=0x20|i;
   PORTC=PORTC|0x30;
   i++;

   PORTD=0xff-numfont[minute/10][satr][0];
   PORTC=0x20|i;
   PORTC=PORTC|0x30;
   i++;
   PORTD=0xff-numfont[minute/10][satr][1];
   PORTC=0x20|i;
   PORTC=PORTC|0x30;
   i++;
  
   PORTD=0xff-numfont[minute%10][satr][0];
   PORTC=0x20|i;
   PORTC=PORTC|0x30;
   i++;
   PORTD=0xff-numfont[minute%10][satr][1];
   PORTC=0x20|i;
   PORTC=PORTC|0x30;
   i++;

   PORTD=0xff-numfont[10][satr][0];
   PORTC=0x20|i;
   PORTC=PORTC|0x30;
   i++;

   PORTD=0xff-numfont[second/10][satr][0];
   PORTC=0x20|i;
   PORTC=PORTC|0x30;
   i++;
   PORTD=0xff-numfont[second/10][satr][1];
   PORTC=0x20|i;
   PORTC=PORTC|0x30;
   i++;

   PORTD=0xff-numfont[second%10][satr][0];
   PORTC=0x20|i;
   PORTC=PORTC|0x30;
   i++;
   PORTD=0xff-numfont[second%10][satr][1];
   PORTC=0x20|i;
   PORTC=PORTC|0x30;
   i++;
  
   PORTB.0=0;  
   PORTC=satr;
   satr++;
   if(satr==24)
      satr=0;

}

// Timer 2 overflow interrupt service routine
interrupt [TIM2_OVF] void timer2_ovf_isr(void)
{
   if(second==59)
   {
      second=0;
      if(minute==59)
      {
         minute=0;
         if(hour==23)
         {
            hour=0;
            if(weekday==6)
            {
               weekday=0;
            }
            else
               weekday++;
            if(monthyear<7 br="br">            {
               if(monthday==31)
               {
                  monthday=0;
                  monthyear++;
               }
               else
                  monthday++;
            }
            else
            {
               if(monthday==30)
               {
                  monthday=0;
                  if(monthyear==12)
                  {
                     monthyear=1;  
                     year++;
                  }
                  else
                     monthyear++;
               }
               else
                  monthday++;
            }
         }
         else
            hour++;
      }
      else
         minute++;
   }
   else
      second++;
//   tint2tstring();     
}

// Declare your global variables here
void main(void)
{
// Declare your local variables here

// Input/Output Ports initialization
// Port A initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTA=0x00;
DDRA=0xff;

// Port B initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTB=0x00;
DDRB=0x01;

// Port C initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTC=0x00;
DDRC=0xff;

// Port D initialization
// Func7=In Func6=In Func5=In Func4=In Func3=In Func2=In Func1=In Func0=In
// State7=T State6=T State5=T State4=T State3=T State2=T State1=T State0=T
PORTD=0x00;
DDRD=0xff;

// Timer/Counter 0 initialization
// Clock source: System Clock
// Clock value: Timer 0 Stopped
// Mode: Normal top=FFh
// OC0 output: Disconnected
TCCR0=0x00;
TCNT0=0x00;
OCR0=0x00;

// Timer/Counter 1 initialization
// Clock source: System Clock
// Clock value: Timer 1 Stopped
// Mode: Normal top=FFFFh
// OC1A output: Discon.
// OC1B output: Discon.
// Noise Canceler: Off
// Input Capture on Falling Edge
// Timer 1 Overflow Interrupt: Off
// Input Capture Interrupt: Off
// Compare A Match Interrupt: Off
// Compare B Match Interrupt: Off

TCCR1A=0x00;
TCCR1B=0x81;
TCNT1H=0xa2;
TCNT1L=0x3f;
ICR1H=0x00;
ICR1L=0x00;
OCR1AH=0x00;
OCR1AL=0x00;
OCR1BH=0x00;
OCR1BL=0x00;

// Timer/Counter 2 initialization
// Clock source: TOSC1 pin
// Clock value: PCK2/128
// Mode: Normal top=FFh
// OC2 output: Disconnected
ASSR=0x08;
TCCR2=0x05;
TCNT2=0x00;
OCR2=0x00;

// External Interrupt(s) initialization
// INT0: Off
// INT1: Off
// INT2: Off
MCUCR=0x00;
MCUCSR=0x00;

// Timer(s)/Counter(s) Interrupt(s) initialization
TIMSK=0x44;

// Analog Comparator initialization
// Analog Comparator: Off
// Analog Comparator Input Capture by Timer/Counter 1: Off
ACSR=0x80;
SFIOR=0x00;

// Global enable interrupts
#asm("sei")

while (1);
}
Share:

Jadwal Waktu Sholat

TIME WIB

TV EDUKASI LIVE

Popular Posts

Recent Posts

Pages