Koda: |
int a;
char b; a = b; |
Citiram: |
When an interrupt occurs, the Global Interrupt Enable I-bit is cleared and all interrupts are disabled. The user software can write logic one to the I-bit to enable nested interrupts. All enabled interrupts can then interrupt the current interrupt routine. The I-bit is automatically set when a Return from Interrupt instruction – RETI – is executed. |
Koda: |
#define F_CPU 1000000
#include <avr\io.h> #include <util\lcd_lib.c> #include <util\delay.h> volatile unsigned char e, d; volatile unsigned char val; int main (void) { DDRA=0xff; DDRB=0x01; LCDinit (); LCDclr (); LCDcursorOFF(); LCDGotoXY(2,0); //postavi se na pozicijo LCDstring ("dela ",5); void izracun() { e=val/10; //enice e=e*10; e=val-e; val=val/10; //desetice d=val/10; d=d*10; d=val-d; } ; val=0; while (1) { if (PINB &0X01) { ++val; izracun(); LCDclr (); LCDGotoXY(2,0); LCDsendChar (d+48); LCDsendChar (e+48); _delay_ms(800); }; } } |