Waqas_MicroSolutions
Member level 1
Hi there,
I have configured RA0 and RA1 in PIC16F676 as output. They work well when used individually.
When both are set/Cleared one after other, they doesn't work. If one pin is turned on, other is turned off by it self(This is not required). While same code works well on other pins in PORTA! I am using high band gap, and turned off MCLRE, WDT, BODEN,PWRTE and using internal RC oscillator with OSCCAL=0x34FC (Max Freq).
Here is my code, compiler is MikroC:
Result can be observed in Proteus..
Please help!
I have configured RA0 and RA1 in PIC16F676 as output. They work well when used individually.
When both are set/Cleared one after other, they doesn't work. If one pin is turned on, other is turned off by it self(This is not required). While same code works well on other pins in PORTA! I am using high band gap, and turned off MCLRE, WDT, BODEN,PWRTE and using internal RC oscillator with OSCCAL=0x34FC (Max Freq).
Here is my code, compiler is MikroC:
Code:
#define BUZZER PORTA.F1
#define BLOW PORTA.F0
void main (){
ANSEL=0x60;
TRISA.F0=0;TRISA.F1=0;
while(1){
BLOW=0;
Delay_ms(500);
BUZZER=0;
Delay_ms(500);
BUZZER=1;
Delay_ms(1000);
BLOW=1;
Delay_ms(1000);
}/*while*/
}/*main*/
Please help!