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

12F683 Pin Fried?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

12F683 Pin Fried?
PostPosted: Tue Sep 05, 2006 3:57 pm     Reply with quote

Hello All,

I've just started using a 12F683 part for a small project and can't get one pin working as an output. I currently have A0, A1, A2, and A5 toggling correctly. But I can't seem to get A4 to toggle. As I was assembling the board I connected A4 to the base of a PNP BJT (the base was also pulled up through a 47K, the collector was connected to Vdd, and the emitter was floating). When I didn't get the results expected from the BJT when checked with a scope while toggling I pulled the BJT off the board and started troubleshooting. Right now A4 won't budge from 1/2 of Vdd.

I've looked at the datasheet and can't find anything odd about A4.

Any ideas?

Thanks,

John


Here is the current code:


Code:
#include <12F683.h>

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES INTRC                    //Internal RC Osc
#FUSES NOPUT                    //No Power Up Timer
#FUSES NOBROWNOUT               //No brownout reset

#use delay(clock=31000)

#define H20_IN          PIN_A0
#define SW_IN           PIN_A1
#define LOW_BAT_IN      PIN_A2
//#define               PIN_A3
#define BUZZ_OUT        PIN_A4
#define LED_OUT         PIN_A5




#int_RTCC
RTCC_isr() {

}

#int_TIMER2
TIMER2_isr() {

}

#int_RA
RA_isr() {

}



void main() {

   setup_adc_ports(NO_ANALOGS|VSS_VDD);
   setup_adc(ADC_OFF);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_256);
   setup_timer_1(T1_INTERNAL|T1_DIV_BY_8);
   setup_timer_2(T2_DISABLED,0,1);
   setup_comparator(NC_NC);
   setup_vref(FALSE);
   //enable_interrupts(INT_RTCC);
   //enable_interrupts(INT_TIMER2);
   //enable_interrupts(INT_RA);
   //enable_interrupts(GLOBAL);
   setup_oscillator(OSC_31KHZ);

   SET_TRIS_A(0b00001111);


   while(TRUE) {

   output_high(LED_OUT);
   output_high(BUZZ_OUT);
   output_high(LOW_BAT_IN);
   output_high(SW_IN);
   output_high(H20_IN);
   delay_ms(1500);
   output_low(LED_OUT);
   output_low(LOW_BAT_IN);
   output_low(SW_IN);
   output_low(H20_IN);
   output_low(BUZZ_OUT);
   delay_ms(1500);
   
   



   }//while(TRUE)
}//main
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Sep 05, 2006 4:16 pm     Reply with quote

Look closely at the line in bold:
Quote:
#include <12F683.h>

#FUSES NOWDT //No Watch Dog Timer
#FUSES INTRC //Internal RC Osc
#FUSES NOPUT //No Power Up Timer
#FUSES NOBROWNOUT //No brownout reset

Look at the list of fuse settings in the 12F683.H file.
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

PostPosted: Tue Sep 05, 2006 5:08 pm     Reply with quote

PCM,

Thanks. I followed your tip and looked at the fuse options. I found the INTRC_IO option and tried it assuming that was what you were suggesting... it worked. I then went to the datasheet and read the oscillator notes and saw the explanation for that fuse setting. I've never used the internal oscillator before, so I've never run into that.

Thanks again,

John
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion 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