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 CCS Technical Support

12F683 PIN_A3

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



Joined: 13 Jan 2004
Posts: 29
Location: Green Bay, Wisconsin

View user's profile Send private message

12F683 PIN_A3
PostPosted: Thu Oct 18, 2007 9:53 am     Reply with quote

I am looking to use PIN_A3 on a 12f683 as an output and seem to be missing somthing in the setup. When I compile the following code and run it in the MPLAB sim it never toggles. I have searched the forum and tried serval things with the register setup but to no prevail the same thing in the end. Any thoughts?

compiler version 3.249

Code:

#include <12F683.h>
#device adc=8

#FUSES NOWDT      //No Watch Dog Timer
#FUSES NOCPD      //No EE protection
#FUSES NOPROTECT   //Code not protected from reading
#FUSES NOMCLR      //Master Clear pin used for I/O
#FUSES NOPUT      //No Power Up Timer
#FUSES INTRC_IO      //Internal RC Osc, no CLKOUT
#FUSES NOBROWNOUT   //No brownout reset
#FUSES NOIESO      //Internal External Switch Over mode disabled
#FUSES NOFCMEN   //Fail-safe clock monitor disabled

#use delay(clock=8000000)

void main()
{

   setup_adc_ports(NO_ANALOGS|VSS_VDD);
   setup_adc(ADC_OFF);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   setup_comparator(NC_NC_NC_NC);
   setup_vref(FALSE);
   setup_oscillator(OSC_8MHZ);
   
   SET_TRIS_A(0b00000000);
   
   While(true)
   {
   
      delay_ms(100);
     
      output_high(PIN_A0);
      output_high(PIN_A1);
      output_high(PIN_A2);
      output_high(PIN_A3);
      output_high(PIN_A4);
      output_high(PIN_A5);
   
      delay_ms(100);
      output_low(PIN_A0);
      output_low(PIN_A1);
      output_low(PIN_A2);
      output_low(PIN_A3);
      output_low(PIN_A4);
      output_low(PIN_A5);
   }

}
mmprestine



Joined: 13 Jan 2004
Posts: 29
Location: Green Bay, Wisconsin

View user's profile Send private message

PostPosted: Thu Oct 18, 2007 10:39 am     Reply with quote

Shocked Guess I should have read the data sheet a bit more closely. GPIO3 is only configurable as a general purpose input or as a Master Clear with weak pull-up.
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