Chirag R. Patel
Newbie level 3
- Joined
- Apr 9, 2014
- Messages
- 3
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 18
hello everyone
i want to make the programme on pic16f887.
i want to press RA4 pin 5 times and at fifth time RD0 should be on.
how to do that i tried too much but i couldnt do that
olz hepl me
thanks
#include <htc.h>
#define _XTAL_FREQ 4000000
void main()
{
ANSEL = 0;
ANSELH = 0;
PORTA=0;
TRISA = 1;
TMR0 = 0;
GIE = 0;
PEIE = 0;
T0IE = 0;
T0IF = 0;
T0CS = 1;
T0SE = 0;
PSA= 0;
PS0 = 0;
PS1 = 0;
PS2 = 0;
while(1)
{
}
static void interrupt isr();
{
if (T0IF==1)
GIE=0;
//if(TMR0==5) {
RD0=1;
//{
//RD0 = 1;
//}
}
}
i want to make the programme on pic16f887.
i want to press RA4 pin 5 times and at fifth time RD0 should be on.
how to do that i tried too much but i couldnt do that
olz hepl me
thanks
#include <htc.h>
#define _XTAL_FREQ 4000000
void main()
{
ANSEL = 0;
ANSELH = 0;
PORTA=0;
TRISA = 1;
TMR0 = 0;
GIE = 0;
PEIE = 0;
T0IE = 0;
T0IF = 0;
T0CS = 1;
T0SE = 0;
PSA= 0;
PS0 = 0;
PS1 = 0;
PS2 = 0;
while(1)
{
}
static void interrupt isr();
{
if (T0IF==1)
GIE=0;
//if(TMR0==5) {
RD0=1;
//{
//RD0 = 1;
//}
}
}