Generate limited frequency. need help.

Status
Not open for further replies.

Stas Mamaischi

Newbie level 6
Joined
Apr 24, 2014
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
60
Hi. Can anyoane tell me how i can generate limited frequency between 310-630 rpm ? If i have 310-630 rpm in 0.2 second . Thank you forward . I use pic16f886 .

Code:
TRISB = 0x00;
PORTB =0x00;
T1CKPS1 = 1;
T1ckps0 = 0; //prescale 4;
T1OSCEN = 0;
TMR1CS = 0;
GIE = 1;
PEIE = 1;
TMR1IE =1 ;
TMR1ON =1;
TMR1H = 0b11001101;TMR1L=0b11100001; //52705
while(1){
                  }
interrupt count(){
if(TMR1IF){
TMR1H= 0b11001101;TMR1L=0b11100001;
RB1=!RB1;

 }
else {
 TMR1H =0b11100110;TMR1L=0b01011101; //58973

RB1=!RB1;
}
TMRIF=0;
}
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…