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.

[SOLVED] How to programm PIC with Genius 540 programmer

Status
Not open for further replies.

Qaisar Azeemi

Full Member level 5
Joined
Feb 11, 2011
Messages
315
Helped
16
Reputation
32
Reaction score
15
Trophy points
1,298
Location
Peshawar, Pakistan, Pakistan
Activity points
3,829
HI all!

i am new to PIC micro controllers and using pic16f877a to learn using pic controllers. i have burnt the Hex file in my pic16f877a using Genius 540 Universal programmer. when i try to load my hex file it ask me the information about my file; that; is it hex (motorola), hex (intel), bin.... etc.

i tried to burn using all the info turn by turn but it failed.... kindly Guid me how to program using Genius540 universal programmer. i am using MPLAB IDE V8.83.

Thanking u in anticipation.

- - - Updated - - -

Genius programmer gives me this error while loading Hex file "Non configuration worde in hex file. please set it after loading".
 

here is my test code. simply blink the leds connected to Port C.


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
28
29
30
31
#include<Pic16F877A.h>
//#include <htc.h>
 
void DELAY_ms(int);
 
void main()
{
 
unsigned char j=1;
TRISC=0;
 
for( ; ; )
{
PORTC=j;
DELAY_ms(1000);
j=j<<1;
 
if (j==0)
j=1;
 
}
 
}
 
void DELAY_ms(int x)
 
{
int i,j;
for(i=0; i<x; i++)
for(j=0; j<500; j++);
}



code is successfully compiled by compiler. but when i try to load the hex file via genius programmer it just get the fist line of hex file and ignore the others.

the hex file of the above code is:

:060000000A128A11972F7D
:100F2E0083010A128A119B2FF9010314F90D8316FE
:100F3E0003138701A22F7908831203138700E83069
:100F4E00F0000330F1000A128A11C2270A128A1128
:100F5E007908F7007707F8007808F900F908031DFB
:100F6E00B92FBA2FA22FF9010314F90DA22FA22F18
:100F7E000A128A110028F301F401F02FF501F6018F
:100F8E007608803AFF0081307F02031DD02FF430A7
:100F9E007502031CD32FD42FD62FEA2FEA2F013040
:100FAE00F5070318F60A0030F6077608803AFF00B8
:100FBE0081307F02031DE52FF4307502031CE82FEC
:100FCE00E92FD62FEA2F0130F3070318F40A003069
:100FDE00F4077408803AF2007108803A7202031D19
:100FEE00FA2F70087302031CFD2FFE2FC52FFF2F43
:020FFE000800E9
:00000001FF

but compiler just load the first line of the file....
0A128A11972F

and ignore the other bytes..... i cant understand y??? :-(

- - - Updated - - -

i have the same loading problem as shown up to the half of this video.

https://www.youtube.com/watch?v=upfKWioBtqM
 
Last edited by a moderator:

Use ----hex (intel)---- option. Ignore the popup message. Simply set the fusebits. The message always appear, just ignore it and click 'prog'.



See the second video..of your video link,
https://www.youtube.com/watch?v=wdQGIGnWDRI&feature=plcp

You can simulate your program with 'pic simulator'.
https://www.oshonsoft.com/pic.html
It helps to track errors in early stage.
Again the the popup message is only a reminder to set fusebits and nothing else.
 
Last edited:
Thank you very much Alertlinks for your kind response. i did it but the result is the same. programmer is not getting the ful hex file. simulation is OK. but the problem is still there. i am loading the picture of Genius programmer which shows the first line of the Hex file is taken by the programmer, while other lines are just ignored. i cant understand where im doing wrong........

loaded file 2.png

loaded file.png
 

You cannot read while it is code protected. In the window, setting is other way around. selecting 0 will protect code and selecting 1 will disable code protection. Similar is the case with other settings. Apparently it is reverse.
 

You cannot read while it is code protected. In the window, setting is other way around. selecting 0 will protect code and selecting 1 will disable code protection. Similar is the case with other settings. Apparently it is reverse.

I can't Understand. kindly elaborate it a bit more. kindly tell me in steps how should i proceed.
 

13_1343467569.png


If you want to read data, set CP=1 by selecting CP in this window.

16_1343468211.png


- - - Updated - - -

Its the latest softwae G54Eng.rar for G540 as of may2012. Upgrade.
See for configuration setting for your device in PIC_CONFIG.pdf
 

Attachments

  • G54Eng.rar
    1.5 MB · Views: 160
  • PIC_CONFIG.pdf
    3.4 MB · Views: 221
  • DeviceList.pdf
    540.9 KB · Views: 275
Last edited:
Don't forget to set the WDTEN to zero (or unticked) to disable the watchdog timer.
 

Thank you very much alertlinks. i hang in another Problem :-( The same program of MPLAB IDE V8.83 was working fine on Saturday now making problem for me.. it shows the error of "Unexpected End of File".. please see the image below that shows the whole environment of my source code and the output of the compiler and please Guide me where i am going Wrong. Thanking you in anticipation

loaded file3.png
 

hi azimi
first of all u have to do this
1) as u r beginner so use mikroc and get full version from me
2) if u r using hitech which is very gd compiler thenerase #include <pic16f877a.h>
3) and u have to use configuration setting also here that u have nt done
__CONFIG(1, OSCSDIS & HS);
__CONFIG(2,BOREN & BORV42 & PWRTEN & WDTDIS);
__CONFIG(3, CCP2RC1);
__CONFIG(4, DEBUGDIS & LVPDIS & STVRDIS);
__CONFIG(5, UNPROTECT); // Chnage to CPA
__CONFIG(6, WPB);
__CONFIG(7, TRU);
wish u best of luck
remember me in ur prayers
 
hi azimi
first of all u have to do this
1) as u r beginner so use mikroc and get full version from me
2) if u r using hitech which is very gd compiler thenerase #include <pic16f877a.h>
3) and u have to use configuration setting also here that u have nt done
__CONFIG(1, OSCSDIS & HS);
__CONFIG(2,BOREN & BORV42 & PWRTEN & WDTDIS);
__CONFIG(3, CCP2RC1);
__CONFIG(4, DEBUGDIS & LVPDIS & STVRDIS);
__CONFIG(5, UNPROTECT); // Chnage to CPA
__CONFIG(6, WPB);
__CONFIG(7, TRU);
wish u best of luck
remember me in ur prayers

Thank you Zia.
My problem was approximately solved yesterday; because suddenly my circuit started working when i started pressing and moving crystal oscillator after replacing it with 4MHz(formally i was using 12MHz) but one of my friends told me that PIC may cause problem at high frequency Xtals, is it right? but i don't think so because i've used 12MHz Xtal with 8051 family controllers. now the problem is that the circuit started working when i move the mounted crystal slightly here and there....(moreover i will use the MPLAB too)................ soldering seems to be OK but trying to re-solder it again. kindly give me ur recommendations while making PIC projects on vero board or on PCB.

Thanks and regards
 

.
.
i have re-solder it but problem is still the same.... problem is in crystal...... can't understand why? :-(
when i touch or press the crystal LEDs start blinking. when i release it Blinking stops............................i think jinns(Joints) or satin are there in my circuit board......... ;-) they always do what i don't want to do with my circuit.....
 

@Zia:
The problem is solved now :)... it was really loose crystal terminal soldering problem. i am using mikroC now.

but when i use your said code with MPLAB; it is still problematic as shown in the figure below.

problem.png

is there single underscore sign before config() or double???
 
Last edited:

Use 0.1uF capacitor on power pins of ic. Just solder on the track side on ic pins so that it is very close to ic.
 

Use 0.1uF capacitor on power pins of ic. Just solder on the track side on ic pins so that it is very close to ic.

i did it but fall into another problem..... :-( it pulled up the supply voltages from 4.67v to 5.03v but circuit stopped working..... prior to this the circuit started working when i touched or shake the crystal a little bit, i thought it may be soldering (loose connections) problem but now the situation is completely changed.... and i cant understand why.... :-( just thinking what to do and searching the reason for that.......................................... i reburned the program into the Chip again and insert it in the socket; circuit started working but when i power OFF the supply and Power it ON again ..... :-( the same problem occurred......................... now........ ..... .....
 
Last edited:

i did it but fall into another problem..... :-( it pulled up the supply voltages from 4.67v to 5.03v but circuit stopped working..... prior to this the circuit started working when i touched or shake the crystal a little bit, i thought it may be soldering (loose connections) problem but now the situation is completely changed.... and i cant understand why.... :-( just thinking what to do and searching the reason for that.......................................... i reburned the program into the Chip again and insert it in the socket; circuit started working but when i power OFF the supply and Power it ON again ..... :-( the same problem occurred......................... now........ ..... .....

This sounds like a common problem of a reluctant to start crystal. The higher the frequency of a crystal the more critical of the layout to get reliable start up. Above 8Mhz you will not be able to use strip or vero board and get reliable start up in my experiance. Did you use the corect value of capacitors (15pf) in the crystal circut, and have you set the configuration word to HS mode?
 

show circuit

- - - Updated - - -

ur problem is here due to #include<htc.h>
and u have not configured its register like wdten etc by _config command
 

This sounds like a common problem of a reluctant to start crystal. The higher the frequency of a crystal the more critical of the layout to get reliable start up. Above 8Mhz you will not be able to use strip or vero board and get reliable start up in my experiance. Did you use the corect value of capacitors (15pf) in the crystal circut, and have you set the configuration word to HS mode?

i am using vero-board. value of capacitor is 22pf and i think i've set the configuration word to XT for 4MHz crystal.
about high frequency crystals is that I've used 12MHz crystals with 8051 family controllers thousand of times; and it didn't create any problem. how high frequency crystal is an issue in PICs?

show circuit

- - - Updated - - -

ur problem is here due to #include<htc.h>
and u have not configured its register like wdten etc by _config command

the picture of my circuit is Below:
circuit2.png
when i remove the 0.1uf capacitor from the power line to the microcontroller the circuit start working but still it needs to touch the oscillator once. if i don't touch the oscillator it will not work and remains idle. so the crystal needs a jerk of induced voltages to start through my finger.

here is the mikroC coading for single led blinking:
circuit1.png

genius programmer configuration bits setting is;
circuit3.png
 
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top