Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.

Latest threads

New Articles From Microcontroller Tips

Back
Top