digitalfreak
Joined: 16 Feb 2005 Posts: 25
|
PIN_A4 stopped working! in PIC 16F870/16F876 |
Posted: Thu Sep 29, 2005 1:36 pm |
|
|
Thankyou all for your support.
I have been working on a project from past few months, with the help of few folks here, everything was working good untill yesterday.
suddenly, PIN_A4 (RA4) is not working, when i do
"output_high(PIN_A4)", I couldnot see high at PIN A4, all other pins are working fine, I can program them good, even tested generating PWMS on CCP1 and CCP2.
(please see the code below)
I can see low and high on RA0 and RA1 respectively, but nothing on RA4
Changed breadboards, Changed PICS (used few 16F870 & 16F876)
The only thing I have not tried is different programmer - (I don't have chance, I have only one). I am using PICSTART Plus and CCS C compiler.
My only guess is something like settings in the software/ programmer - MPLAB????
What do you think the problem could be???
Any suggestions are welcome...
below is the code I used to test high on PIN A4
Code: | #include <16f870.h>
#device adc=16
#use delay(clock=20000000, restart_wdt)
#fuses NOWDT, HS, PUT, NOPROTECT, BROWNOUT, NOLVP, NOCPD, NOWRT
#include <math.h>
#use fast_io(A)
#use fast_io(B)
#use fast_io(C)
void main(void) {
set_tris_a(0b00000000); // Set porta as output
setup_adc(ADC_CLOCK_INTERNAL); // Works for up to 20 Mhz clock speed
setup_adc_ports(NO_ANALOGS); // None Analog
while(TRUE){ // Infinite loop
output_low(PIN_A0);
delay_us(500);
output_high(PIN_A1);
delay_us(500);
output_high(PIN_A4);
delay_us(500);
}
} |
Thanks a lot... |
|