How does ISP works?
Circuit :
The PCB and the housing
The PCB and the housing
Connecting the programmer to the micro controller
- Connecting the programmer to an AT89S52
- Connecting the programmer to an ATMEGA16L
SMK Binawiyata Sragen
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.
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.
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.
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.
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.
[KEY]
KeyCreationDateYear=2010
KeyCreationDateMonth=01
KeyCreationDateDay=01
KeyType=5
KeyLifeSpan=8888
KeyExpireDateYear=2035
KeyExpireDateMonth=05
KeyExpireDateDay=03
KeyLicCount=8888
[KEY]
KeyCreationDateYear=2010
KeyCreationDateMonth=01
KeyCreationDateDay=01
KeyType=5
KeyLifeSpan=8888
KeyExpireDateYear=2035
KeyExpireDateMonth=05
KeyExpireDateDay=03
KeyLicCount=8888
movie1.mpg (1,303kB)
movie2.mpg (373kB)
$regfile = "reg51.dat" $crystal = 12000000 Do P1 = &B00000001 P2 = &B11111110 Waitms 250 P1 = &B00000001 P2 = &B11111101 Waitms 250 P1 = &B00000001 P2 = &B11111011 Waitms 250 P1 = &B00000001 P2 = &B11110111 Waitms 250 P1 = &B00000001 P2 = &B11101111 Waitms 250 P1 = &B00000001 P2 = &B11011111 Waitms 250 P1 = &B00000001 P2 = &B10111111 Waitms 250 P1 = &B00000001 P2 = &B01111111 Waitms 250 P1 = &B00000010 P2 = &B01111111 Waitms 250 P1 = &B00000100 P2 = &B01111111 Waitms 250 P1 = &B00001000 P2 = &B01111111 Waitms 250 P1 = &B00010000 P2 = &B01111111 Waitms 250 P1 = &B00100000 P2 = &B01111111 Waitms 250 P1 = &B01000000 P2 = &B01111111 Waitms 250 P1 = &B10000000 P2 = &B01111111 Waitms 250 P1 = &B10000000 P2 = &B10111111 Waitms 250 P1 = &B10000000 P2 = &B11011111 Waitms 250 P1 = &B10000000 P2 = &B11101111 Waitms 250 P1 = &B10000000 P2 = &B11110111 Waitms 250 P1 = &B10000000 P2 = &B11111011 Waitms 250 P1 = &B10000000 P2 = &B11111101 Waitms 250 P1 = &B10000000 P2 = &B11111110 Waitms 250 P1 = &B01000000 P2 = &B11111110 Waitms 250 P1 = &B00100000 P2 = &B11111110 Waitms 250 P1 = &B00010000 P2 = &B11111110 Waitms 250 P1 = &B00001000 P2 = &B11111110 Waitms 250 P1 = &B00000100 P2 = &B11111110 Waitms 250 P1 = &B00000010 P2 = &B11111110 Waitms 250 Loop
$regfile = "reg51.dat" $crystal = 12000000 Do P1 = &B00000001 P2 = &B11111110 Waitms 250 P1 = &B00000001 P2 = &B11111101 Waitms 250 P1 = &B00000001 P2 = &B11111011 Waitms 250 P1 = &B00000001 P2 = &B11110111 Waitms 250 P1 = &B00000001 P2 = &B11101111 Waitms 250 P1 = &B00000001 P2 = &B11011111 Waitms 250 P1 = &B00000001 P2 = &B10111111 Waitms 250 P1 = &B00000001 P2 = &B01111111 Waitms 250 P1 = &B00000001 P2 = &B10111111 Waitms 250 P1 = &B00000001 P2 = &B11011111 Waitms 250 P1 = &B00000001 P2 = &B11101111 Waitms 250 P1 = &B00000001 P2 = &B11110111 Waitms 250 P1 = &B00000001 P2 = &B11111011 Waitms 250 P1 = &B00000001 P2 = &B11111101 Waitms 250 Loop
*====================================================== Chip type : ATmega8535 Compiler : CodeVision Clock frequency : 4.000000 MHz Memory model : Small External SRAM size : 0 Data Stack size : 128 Author : pccontrol.wordpress.com *****************************************************/ #includeketerangan program :#include // Alphanumeric LCD Module functions #asm .equ __lcd_port=0x15 ;PORTC #endasm #include unsigned char bufferperiodeL[15]; unsigned char bufferperiodeH[15]; // Timer 1 input capture interrupt service routine interrupt [TIM1_CAPT] void timer1_capt_isr(void) { sprintf(bufferperiodeL,"%i ",ICR1L); sprintf(bufferperiodeH,"%i ",ICR1H); lcd_gotoxy(0,1); lcd_puts(bufferperiodeH); lcd_gotoxy(4,1); lcd_puts(bufferperiodeL); ICR1H=0; ICR1L=0; TCNT1L =0; TCNT1H =0; } void main(void) { // Timer/Counter 1 initialization // Clock source: System Clock // Clock value: 3.906 kHz // Mode: Normal top=FFFFh // Noise Canceler: Off // Input Capture on Rising Edge // Timer 1 Overflow Interrupt: Off // Input Capture Interrupt: On TCCR1A=0x00; TCCR1B=0x45; TCNT1H=0x00; TCNT1L=0x00; ICR1H=0x00; ICR1L=0x00; OCR1 // Timer(s)/Counter(s) Interrupt(s) initialization TIMSK=0x20; // LCD module initialization lcd_init(16); lcd_gotoxy(0,0); lcd_putsf("periode pulsa :"); // Global enable interrupts #asm("sei") while (1) { }; }
/*=================================================== Chip type : ATmega8535 Author : cipto-suparno.blogspot.com Clock frequency : 4.000000 MHz Memory model : Small External SRAM size : 0 Data Stack size : 128 *****************************************************/ #include#include // Alphanumeric LCD Module functions #asm .equ __lcd_port=0x15 ;PORTC #endasm #include unsigned int hitunganMSB; unsigned int hitunganLSB; unsigned char bufferCounter[15]; unsigned long int hitungan; // Timer 0 overflow interrupt service routine interrupt [TIM0_OVF] void timer0_ovf_isr(void) { //hitungan lebih dari 255 hitunganMSB = hitunganMSB + 1; } // Declare your global variables here void main(void) { // Declare your local variables here // Timer/Counter 0 initialization // Clock source: T0 pin Falling Edge // Mode: Normal top=FFh // OC0 output: Disconnected TCCR0=0x06; TCNT0=0x00; // Timer(s)/Counter(s) Interrupt(s) initialization TIMSK=0x01; // LCD module initialization lcd_init(16); lcd_gotoxy(0,0); lcd_putsf("counter :"); // Global enable interrupts #asm("sei") while (1) { // Place your code here hitunganLSB = TCNT0; hitungan = hitunganMSB + hitunganLSB; sprintf(bufferCounter,"%i ", hitungan ); lcd_gotoxy(0,1); lcd_puts(bufferCounter); }; }
#include// Declare your global variables here void main(void) { // Port B initialization // Func7=In Func6=In Func5=In Func4=In Func3=Out Func2=In Func1=In Func0=In // State7=T State6=T State5=T State4=T State3=0 State2=T State1=T State0=T PORTB=0x00; DDRB=0x08; // Timer/Counter 0 initialization // Clock source: System Clock // Clock value: 62.500 kHz // Mode: Phase correct PWM top=FFh // OC0 output: Non-Inverted PWM TCCR0=0x63; TCNT0=0x00; OCR0=0x40; // Timer(s)/Counter(s) Interrupt(s) initialization TIMSK=0x00; while (1) { // Place your code here }; } 5. Membuat Delay dengan Timer. #include interrupt [TIM0_OVF] void timer0_ovf_isr(void) { delay = delay + 1 } void main(void) { // Timer/Counter 0 initialization // Clock source: System Clock // Clock value: 3.906 kHz // Mode: Normal top=FFh TCCR0=0x05; TCNT0=0xD9; // Timer0 enable TIMSK=0x01; // Global enable interrupts #asm("sei") while (1) { //program utama disini delay(100); //delay 1 detik (100*10ms=1000ms) }; } Void delay(int delay_ms) { TCNT0=0xD9; //interval timer = 10 ms delay=0 while(delay<=delay_ms) { //muter2 disini } }
Kesimpulan cara Pengesetan register TCCR
MOV R1,#2 ; 1 SIKLUS MESIN DEL1: MOV R2,#244 ; 1 SIKLUS MESIN DEL2: MOV R3,#255 ; 1 SIKLUS MESIN DEL3: DJNZ R3,DEL3 ; 2 SIKLUS MESIN X 255 DJNZ R2,DEL2 ; 2 SIKLUS MESIN X 244 DJNZ R1,DEL ; 2 SIKLUS MESIN X 2Dari program diatas kita dapat melihat ada dua buat Op-Code yang kita gunakan yakni MOV dan DJNZ. Masing-masing op-code tersebut memiliki siklus mesin namun berbeda. MOV memiliki 1 siklus mesin sedankan DJNZ memiliki 2 Siklus Mesin. Dan untuk perhitungan Waktunya kita menggunakan Persamaan: