initialise 16F877

Status
Not open for further replies.

antoni1

New Member
HI
i m using RA0/An0 for right feeler and RA1/AN1 for left feeler.
Also i set RB0/INT for LED flashing
And i set RC6/TX/CK to the SERIN of SMC02
And RC2/CCP1 to the RESET of SMCO2
(similar circuit: https://www.pololu.com/projects/prj0001/)

Can anyone tell me if it is correct?

void initialise()

{
OPTION_REG = 0x00;
ADCON1=0x06;
STATUS = 0x3f; // bank 1 //
//** 1 for input, 0 for output **//
TRISA = 0x03; // set port a(0-7) INPUT//
TRISB = 0x00; // set port b(0-7) output //
TRISC = 0b11000000 // set port c(6,7) OUTPUT//
STATUS = 0x1f; // bank 0 //
PORTA = 0x03 ;
PORTB = 0x00; //RB0 for LED//
PORTC = 0x00;
RB0 = 0; //disable sanity flash//
}

thanks
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…