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

Input() Function

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



Joined: 20 Dec 2005
Posts: 112

View user's profile Send private message

Input() Function
PostPosted: Thu Mar 02, 2006 9:23 am     Reply with quote

Guys

I has some issue with input() function,
My code is below:

Code:

#include <18F2525.h> // Call for PIC18F2525 Driver
//#device ICD=TRUE
#device ADC=10 // Use 10bits ADC
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=16000000) // 16Mhz Crystal is Used
#use rs232(baud=9600, parity=N, xmit=PIN_C6, rcv=PIN_C7, bits=8) 

#include <MAX517mod.c>
#byte PORTB = 0xf81
#byte PORTC = 0xf82



#include <stdlib.h>
#include <math.h>




//Start main program
void main()

{
   
   // ADC Port Initialisation
   setup_port_a( AN0_TO_AN3 | VSS_VDD );
   setup_adc( ADC_CLOCK_INTERNAL );


   

   

while(1)

  {
     
      output_high(PIN_C5); // Power On LED
      delay_us(100);

     

      while ( !input(PIN_A2) );

      // waits for freq ready signal from A2

        output_low(PIN_C5);//LED OFF

       printf("\n\r we got A2 signal ON");

 
     }

}





Even though I tied PIN_A2 with 5V.... It won't proceed the later "printf" statment....

Did I miss something?
Do I have to define PORT A as INPUT??(SET_TRIA???)



thx in advance...

sonic
Smile
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