CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

PIN_A4 stopped working! in PIC 16F870/16F876

 
Post new topic   Reply to topic    CCS Forum Index -> CCS ICD / Mach X / Load-n-Go
View previous topic :: View next topic  
Author Message
digitalfreak



Joined: 16 Feb 2005
Posts: 25

View user's profile Send private message

PIN_A4 stopped working! in PIC 16F870/16F876
PostPosted: Thu Sep 29, 2005 1:36 pm     Reply with quote

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...
digitalfreak



Joined: 16 Feb 2005
Posts: 25

View user's profile Send private message

PostPosted: Thu Sep 29, 2005 2:09 pm     Reply with quote

sorry to bother ... never mind, for the time I typed here - I should have read the manual....

atleast hoping it will be useful for somebody else....

RA4 - is open drain (open collector) - it can only pull low but not high.

if it needs to pull high connect a pullup resistor from RA4 to vdd - ready to go...


thanks to "PCMProgrammer"...
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> CCS ICD / Mach X / Load-n-Go All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group