i am new to mplab and pickit2 programmer .i have pic 16f877a ic .i worked embedded c coding in keil ide for 8051.i want to know some of the initilization and coding guidelines in mplab .
1)what all the compilers available for mplab ide??
2)whats the benefit of using hi tech c compilers??
3)what is debuggers in mplab??
4)how to add header files and how can we know about header files??
5)what is configuration bits in mplab .whats the purpose of it??
can any of one suggest simple c program to glow led for pic 16f877a in mplab??
Rangerskm,
maybe is better for you to start with CCS C for PIC or MikroC,
better support, better explanations, super quality forums, many finished projects...
I wish you good lack...
regards
if you are writing your code in C language, it can be compiled using hitech compiler... note that, this compiler doest come embeded along with the MPLAB (as far as i know).. you have to download it separately!! you can see other compilers under the "project" menu in language toolsuite option!!! The main advantage of hitech compiler is that you can just include <htc.h> at the beginning of your source code and can work for 16f877a pic.!! no need to embed other library fuction!!
4)how to add header files and how can we know about header files??
when you install hitech compiler separately, check the option to run it with microchip MPLAB!! you can find various header files in the "include" folder . explore the directory where u have installed your hitech compiler.... find htc.h and copy it to the folder where your code is located... for further clear information..... please read help of the MPLAB!!
regards...
#include <htc.h>
void delay_ms ( int delay );
void delay_ms ( int delay )
{
int ms, i;
for ( ms = 0; ms < delay; ms ++ )
for ( i = 0; i < 5; i ++ );
}
void main()
{
while ( 1 )
{ TRISB = 0x00; // Set PORTB as output PORT
PORTB = 0xFF; // Set PORTB high initially (All LEDs on)
// Toggle the value of PORTB
delay_ms ( 1000 );
PORTB=0X00; // Delay of 1 sec
}
}
this is code i compiled in mplab ide .hi tech c compiler used.hex file generated but unable to work with hardware .for led connection with pic 16f877a
why we are writing the xtal freq command ?i am using 12 mhz oscillator .so hows the code .how the working differs from different oscillator frequencies??
#include <pic.h>
void delay_ms ( int delay );
void delay_ms ( int delay )
{
int ms, i;
for ( ms = 0; ms < delay; ms ++ )
for ( i = 0; i < 5; i ++ );
}
void main()
{
TRISB = 0x00; // Set PORTB as output PORT
PORTB = 0XFF;//nitially (All LEDs on)
while ( 1 )
{
PORTB=0XFF;//oggle the value of PORTB
delay_ms ( 1000 );
PORTB=0X00; // Delay of 1 sec
}
}
actually i compiled the code and hex file also generated .but led is not glowing connected to port b.dont know whats the problem .
tried the MPLAB SIM and generate the output as
i am new to mplab .i had worked out basic led program .it generated cof file .what it means??
hows cof file differs from hex file?.
compiler used hi tech c compiler.
then what all the menus and options has to be checked for correct working of mplab ide.
i am new to mplab and pickit2 programmer .i have pic 16f877a ic .i worked embedded c coding in keil ide for 8051.i want to know some of the initilization and coding guidelines in mplab .
1)what all the compilers available for mplab ide??
2)whats the benefit of using hi tech c compilers??
3)what is debuggers in mplab??
4)how to add header files and how can we know about header files??
5)what is configuration bits in mplab .whats the purpose of it??
can any of one suggest simple c program to glow led for pic 16f877a in mplab??
i am new to mplab .i had worked out basic led program .it generated cof file .what it means??
hows cof file differs from hex file?.
compiler used hi tech c compiler.
then what all the menus and options has to be checked for correct working of mplab ide.