handsprince
Member level 2
pic18 configuration
Below is my C18 code to set up a PORTA , PORTE and PORTB...the problem is, the input port still in analogue mode...i don't know why, can anyone explain to me?
code:
#include <p18f4620.h>
#include <adc.h>
#include <stdlib.h>
#include <stdio.h>
#include <delays.h>
int result,i;
void main( void )
{
TRISA = 0xcF;
TRISB = 0x00;
ADCON1 = 0x07;
CMCON = 0x07;
TRISE = 0X07;
}
Below is my C18 code to set up a PORTA , PORTE and PORTB...the problem is, the input port still in analogue mode...i don't know why, can anyone explain to me?
code:
#include <p18f4620.h>
#include <adc.h>
#include <stdlib.h>
#include <stdio.h>
#include <delays.h>
int result,i;
void main( void )
{
TRISA = 0xcF;
TRISB = 0x00;
ADCON1 = 0x07;
CMCON = 0x07;
TRISE = 0X07;
}