Tema: Re: AVR daznio matavimas(frequency counter)
Autorius: KaroliS
Data: 2009-02-07 22:03:17
radau klaida,
neteisingai nurodytas interrupt vector adresas







"Levas" <bla@sss.com> wrote in message 
news:gmkn10$dde$1@trimpas.omnitel.net...
> nu tai tavo counter2_ovf nespeja net pasikeisti, o programa baigia darba.
>
> O gcc yra freeware... :)
>
> -- 
> Bye, Levas
> --
> http://www.vabolis.lt - elektronika ir siaip
> "KaroliS" <1@1.com> wrote in message 
> news:gmkm9s$cma$1@trimpas.omnitel.net...
>> vat tame ir beda kad pagal pvz kaip ir aisku ka reik daryt , bet su mano
>> kompiliatorium nesuveikia ir nepagaunu kodel, itariu kokia vaikiska 
>> klaida
>> kurios as nematau, blemba kodas is keliu eiluciu net ner kur klaidu 
>> padaryt
>> nu bet as sugebu:) o panasu kad butent pertaukimas ir nesuveikia ir
>> nepadidina counterio.
>>
>>
>>
>> "Levas" <bla@sss.com> wrote in message
>> news:gmkl4f$bmi$1@trimpas.omnitel.net...
>>> nevalgom jusu kompiliatoriaus.... va:
>>>
>>>
>>> ISR(TIMER0_OVF_vect) //timer overflow vector
>>> {
>>> bla bla bla bla interupete esam
>>>
>>> (jei reikia darom dar cli() ir sei())
>>> }
>>>
>>> int main(void)
>>> {
>>>
>>> TCCR0=_BV(CS00)|_BV(CS02);
>>> TIMSK = _BV (TOIE0);
>>> sei()
>>>
>>> for(;;) {
>>>
>>> cia amzinas ciklas. cia reikia miegoti.
>>>
>>> }
>>> }
>>>
>>> -- 
>>> Bye, Levas
>>> --
>>> http://www.vabolis.lt - elektronika ir siaip
>>> "KaroliS" <1@1.com> wrote in message
>>> news:gmkimt$9c7$1@trimpas.omnitel.net...
>>>> taigi vis dar kovoju su timer/counter , nepriverciu veikt gal izvelgsit
>>>> kur
>>>> klaida?
>>>>
>>>>
>>>> int counter2_ovf=0;
>>>> //================interrupt==================
>>>> #pragma vector=0x08
>>>> __interrupt void counter2_overflow(void)
>>>> {
>>>> counter2_ovf=counter2_ovf+1;
>>>> }
>>>>
>>>> //===========================================
>>>>
>>>>
>>>> timer0_init()
>>>> {
>>>> counter0_ovf=0;
>>>> counter2_ovf=0;
>>>> int counter0=0;
>>>> char number=0;
>>>>
>>>> __enable_interrupt();
>>>>
>>>> TIMSK |= (1<<TOIE2);  //enablinu pertraukimus nuo persipildymo
>>>>
>>>>
>>>>
>>>>
>>>> TCCR2 |= (1<<CS22 | 1<<CS21 | 1<<CS20 );  //prescaler
>>>>
>>>> while(counter2_ovf==0){  }
>>>>
>>>> //tolimesnis kodas
>>>>
>>>> }
>>>>
>>>>
>>>> pagal tai kaip elgiasi programa speju kad papuolam i
>>>> while(counter2_ovf==0){  }  ir sukames amzinai, kodas kolkas testavimo
>>>> tikslais rasomas todel nieko protingo nedaro tiesiog persipildzius
>>>> counteriui turetu iseit is ciklo ir ivykdyti tolimesni koda
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> "G.S." <xx@xx.xx> wrote in message
>>>> news:gmab4k$9of$1@trimpas.omnitel.net...
>>>>>
>>>>> Taip suveiks.Tik reikia dar pertraukimus nuo persipildymo
>>>>> ijungti.Paieskok
>>>>> ten registruose kazkur isijungia.AVR seniai beciupinejau tai 
>>>>> nebepamenu.
>>>>>
>>>>>> ar gerai supratau?
>>>>>>
>>>>>> #pragma vector=0x10     //9 $010 TIMER1 OVF Timer/Counter1 Overflow
>>>>>>
>>>>>> __interrupt void count1_overf(void)
>>>>>> {
>>>>>> //kazka darom
>>>>>> }
>>>>>>
>>>>>> ar sitas kodas suveiks kai timer/counter1 persipildys?
>>>>>
>>>>>
>>>>
>>>>
>>
>>