Dopiero się uczę bawić z C w mikronotrolerach więc proszę o wyrozumialość, otóż nie moge uruchomić licznika T0..., aby mi zliczał ..., nawet jeśli chciałbym aby zapalił mi ledy na porcie D, to i tak nic z tego ... Tajmer T1 mi poszedł ... a więc nieweim co jest .
Listing :
Chip type : AT90S8535 Clock frequency : 8,000000 MHz Memory model : Small External SRAM size : 0 Data Stack size : 128
*********************************************/
#include <90s8535.h>
#include <stdio.h>
#include <delay.h>
int w;
interrupt [EXT_INT0] void ext_int0_isr(void) { w=1; }
// Declare your global variables here
void main(void) {
PORTD=0x00; DDRD=0xFF;
PORTB=0x00; DDRB=0xFF;
// Timer/Counter 0 initialization // Clock source: T0 pin Falling Edge TCCR0=0x07; TCNT0=0x00;
// External Interrupt(s) initialization // INT0: On // INT0 Mode: Falling Edge // INT1: Off GIMSK=0x40; MCUCR=0x02; GIFR=0x40;
// Timer(s)/Counter(s) Interrupt(s) initialization TIMSK=0x01;
// Global enable interrupts #asm("sei")
while (1) {
if (w==1) { w=0; PORTD=0xff; delay_ms(2000); PORTD=0x00;
}
}; }