sonicdeejay
Joined: 20 Dec 2005 Posts: 112
|
Input() Function |
Posted: Thu Mar 02, 2006 9:23 am |
|
|
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](images/smiles/icon_smile.gif) |
|