Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Looking for PIC16F877A sample C programs and tutorials

Status
Not open for further replies.

ncv

Newbie level 3
Joined
Jan 15, 2005
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
35
pic16f877a tutorial

I'm looking for PIC16F877A sample C programs and tutorials.
Thank you very much for your help.
Hieu
 

I wrote a great PIC16F877A tutorial for beginners.
It covers everything from how to connect the PIC, to sensors, motors, lights.
 
Last edited:
hi everyone.
i am newb here...
i just go through this forum and found it quite ineteresting.
fyi,i am a student...electronics student.
i am very interest in pic ..not only theory bt prctcally
for this week,i plan to do basic led blinking..but i dont know how to start it bcoz i dunt have any ide of c language
i plan tu use mplab n c language.
can anyone help me with the source code?
i want to study from the basic source code n develop it..really hope for that
 

You start with mickroC.it is so easy when compare others. Try it.. Free version support upto 2kb
 

I think,MPLAB Hi-tech C compiler is so easy...
https://www.microchipc.com/

- - - Updated - - -

PIC Simulator IDE is useful for your simulation.
 

Attachments

  • pic.bmp
    2.3 MB · Views: 201
Study the PIC16f877 datasheet for your reference.


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include<pic.h>     // Blinking LED
#include<htc.h>
 
__CONFIG(HS & PWRTEN & BOREN & LVPEN & WDTDIS & DUNPROT & DEBUGDIS); 
void main(void)
{
unsigned int i;
ADCON1 =0x06 ; // Changes PORTA to digital
CMCON = 0x07 ; // Disable analog comparators
TRISA = 0x00 ; // Configure PORTA as output
PORTA = 0x00;
TRISD = 0X00 ;
PORTD = 0X00 ;
 
while(1)
{
//PORTA = 0XFF ;
//PORTB = 0XFF ;
//PORTC = 0XFF ;
PORTD = 0XFF ;
for(i=0;i<1500;i++);
PORTD = 0X00 ;
for(i=0;i<1500;i++);
//for(i=0;i<500;i++);
//for(i=0;i<500;i++);
}
}

 
Last edited by a moderator:
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top