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

Problem my code with 16f722

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







Problem my code with 16f722
PostPosted: Sat May 02, 2009 4:31 pm     Reply with quote

Hi.
I do not use PORTA.3 PORTA.4 and PORTA.5 ports. fOR EXAMPLE
if (input(PIN_A2)){CLed=1;} else {CLed=0;} LED oK
if (input(PIN_A3)){DLed=1;} else {DLed=0;} LED İS NOT LIGHTING
if (input(PIN_A4)){ELed=1;} else {ELed=0;} LED İS NOT LIGHTING
if (input(PIN_A5)){FLed=1;} else {FLed=0;} LED İS NOT LIGHTING

pLEASE HELP ME

My code is here;
Code:

#include <16F722.h>
//#device adc=8

#FUSES INTRC_IO, NOMCLR, PUT, NOWDT, PROTECT, NOBROWNOUT, NOPLLEN, NODEBUG, NOVCAP   //No Watch Dog Timer
#use delay(clock=16000000)
//#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)

#byte    PORTA   = 0x05
#byte    PORTB   = 0x06

#bit  Cinput =  PORTA.2  //input
#bit  Dinput =  PORTA.3  //input
#bit  Einput =  PORTA.4  //input
#bit  Finput =  PORTA.5  //input

#bit  CLed   =  PORTB.2  //out
#bit  DLed   =  PORTB.3  //out
#bit  ELed   =  PORTB.4  //out
#bit  FLed   =  PORTB.5  //out



#int_RTCC
void  RTCC_isr(void)
{
   
}
     
void main()
{  setup_oscillator(OSC_16MHZ);
   setup_adc_ports(NO_ANALOGS|VSS_VDD);
   setup_adc(ADC_OFF);
   setup_spi(SPI_SS_DISABLED);
   setup_vref(FALSE);
   port_b_pullups(TRUE);
   SET_TRIS_A(0b11111111);SET_TRIS_B(0b00000000);
   setup_timer_0(RTCC_INTERNAL|RTCC_DIV_8);  // 4Ms
   setup_timer_1(T1_DISABLED); setup_timer_2(T2_DISABLED,0,1);
   enable_interrupts(INT_RTCC);
   enable_interrupts(GLOBAL);
   Delay_Ms(100);
   While(True)
  {
      if (input(PIN_A2)){CLed=1;}  else {CLed=0;}
      if (input(PIN_A3)){DLed=1;}  else {DLed=0;}
      if (input(PIN_A4)){ELed=1;}  else {ELed=0;}
      if (input(PIN_A5)){FLed=1;}  else {FLed=0;}

   }



 
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