# How do i programing a pic with my programer

Status
Not open for further replies.

#### keibbow

##### Banned
Hello members of the forum,iam new to this board and i hope my question will be wellcome,i have a question concerning programing though i am new to it but i geust someone will help me to answer it. When a hex file is downloaded how can i burn it into a pic with my programer? Thanks

#### andre_luis

##### Super Moderator
Staff member
You simply must select the HEX file in programmer browser and select option upload.
Give us mere details concerning the kit you´re using.

+++

#### eem2am

##### Banned
well in microchip you simply go to forum and ask there.

But say you have programmer...well...that just convertes your code into binary and arranges it to be loaded correctly into the PIC.

sO GO TO the instructions of the programmer.

or as i say, in microchip, they have forum for you.

#### keibbow

##### Banned
Hello everyone,I have a little problem an I don't know what to do about it, I have a hex file which I simulate using proteus and it works fine. But after burning it to the pic I test it and their is no output and the curcute is ok can someone tell me the reason why it fail to work is their any modification I need to do?

#### xpress_embedo

Check the Voltage of MCLR Pin it must be 5V(approx)

Check Power Supply 5V and Gnd on the pins of controller..

If this part is okay..
Check the Crystal Frequency using an oscilloscope...
Whether is coming or not...

These are the basic connection for PIC,,
If all these are fine.. just put a simple LED toggling program,
and see whether the ports of the controller are toggling or not..

Hope this helps..

#### keibbow

##### Banned
Thank's for the reply arun sharma,but to test for led toggling I must write a program for it?

#### xpress_embedo

Code:
//For PIC16F877A
#include<htc.h>
#define _XTAL_FREQ 20000000
void main()
{
TRISB = 0x00;
while(1)
{
PORTB = 0x00;
__delay_ms(1000);
PORTB = 0xFF;
__delay_ms(1000);
}

Try this code and check...

Hope this helps

#### keibbow

##### Banned
Thanks for the reply arun sharma,but in the code below I don't know where you assign the port as output and what{ void main()TRISB 0x00; while (1) { I am still learning programing so please guide me.

#### xpress_embedo

Code:
#include<htc.h>
Header file must be included always when using HI-Tech C Compiler

Code:
void main()

Main part of program starts from here

Code:
#define _XTAL_FREQ 20000000

Specifying the Crystal Frequency, 20Mhz
If you don't include this line, you cann't use the delay function used in the main part of the program
Code:
TRISB = 0x00;

TRISB is a register with the help of this we can control the direction of PORTB
If we want to make PORTB as Output port then assign it as 0x00 and
if we want to make PORTB as input port then assign TRISB = 0xFF

Code:
while(1)
this means infinite loop, you program will stay here infinitely
Code:
PORTB = 0x00;
//Give Digital Low signal on all pins of PORTB
__delay_ms(1000);
//Give one second Delay
PORTB = 0xFF;
//Give Digital High to all pins of PORTB
//Give one second Delay

This code is executed in the while loop forever..
Hope this helps

Have a look at this site for some samples program

AT89C51 Tutorials

PIC18F4550 Tutorials

Have a look at, how to make circuit diagram and how to write codes, but before that just read the c language

#### keibbow

##### Banned
Wow I think you will be my programing lecturer,I understand it now and I will try the code you give me also I have to start learning the programing in c language then assembly, thank's so much arun sharma.

#### keibbow

##### Banned
Hello arun sharma, i bought new pic kit 3 today but i search for the interface on internet i could not find it please can you send the link for me or where to download it?

#### xpress_embedo

Good..

You can found its user manual on microchip website...
Just have a look on that...

#### keibbow

##### Banned
Thank you very much boss

#### keibbow

##### Banned
But their is another problem,it fails to connect it keep displaying not connected can anyone tell me why?

#### keibbow

##### Banned
Can anybody help me please,my pickit3 displaying not connected what should I do.

#### keibbow

##### Banned
Hello everyone, can some tell me how to make a function to make my running message on my lcd display to be moving?

Status
Not open for further replies.