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.

How to programm PIC with Genius 540 programmer

Status
Not open for further replies.
HI all!
i am sorry again if it is wrong place for this post..... i request administrator of the forum to make separate place for PIC microcontrollers. Thank you.

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.
 
Hi,

Check if your programmer is supported by MP Lab, because it supports only some programmers not all of them, if not, try to get your programmer own software and use it to download your Hex file.
 
Genius programmer gives me this error while loading Hex file "Non configuration worde in hex file. please set it after loading".
 
in this case you need to post your code to check whats wrong with it, because it is clearly talking about configuration word which essential part of the program.
 
here is my test code. simply blink the leds connected to Port C.

#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??? :-(
 
Last edited:
I did most of my work in assembly, in that you have to add a Cofig word that will set your fuses, such as :

Program Code Protection (prevents readback of program code via programming hardware)
Data Code Protection (prevents readback of data EEPROM via programming hardware)
Low Voltage Programming
Brown Out Reset
Sets MCLR as either External Master Clear or digital input
Power Up Timer
Watchdog Timer
Sets the oscillator type (be it internal, external RC or external crystal)

it can be written in letters, or it may combined in a Hexadecimal number started with 0x####.

below is one of Nigle Goodwin tutorial, where translated in this forum into C, you can see __CONFIG word in the third line.


Code:
#include <pic.h>			// pic specific identifiers
# define _XTAL_FREQ 4000000
__CONFIG(0x3D18);	                // Config bits

void main(void)				// program entry
	{
	CMCON = 0x7;			// Comparitors off
	TRISA = 0x0;			// Both ports
	TRISB = 0x0;			// as outputs
	while(1)		        // Loop forever
		{
		PORTB = 0xff;		// All on!!
		PORTA = 0xff;
		__delay_ms(180);	// Wait a while
		PORTB = 0x0;		// All off!!
		PORTA = 0x0;
		__delay_ms(180);	// Wait a while
		}
	}				// End!!
 
Last edited:
my problem is solved. i am using mikroC now. its easier than MPLAB IDE. i am now fall into another interesting problem:

here is my circuit diagram. simulating well in Proteus.
View attachment 66087
Problem: 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.
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. why high frequency crystal is an issue in PICs?

my coading is below:
View attachment 66088

and here is the configuration bit setting in Genius programmer;
View attachment 66089
 
Last edited:
I think that 30k for a reset cap is too high, especially if you have a 10uf cap there.... It'll take a week to startup..

I use a 10k and use the internal cap...

Secondly... The 4Mhz Xtal uses a mode called XT... Which you have indeed selected.... The correct setting is HS.... FOSC0 = 0 FOSC1 = 1

HS is for xtals 8Mhz and above...
 
Two suggestion:

1- I'm using MikroC, but found it is limited with its ready made modules.

2- To start with PIC, you can use the once that has internal oscillator to avoid one cause of uncertainty.
 
I think that 30k for a reset cap is too high, especially if you have a 10uf cap there.... It'll take a week to startup..

I use a 10k and use the internal cap...

Secondly... The 4Mhz Xtal uses a mode called XT... Which you have indeed selected.... The correct setting is HS.... FOSC0 = 0 FOSC1 = 1

HS is for xtals 8Mhz and above...

Oh sorry i acctually connectd 4.7k ohm resistor in my hardware, i mistakenly didn't change the value of minresis 30k to 4.7k in the proteus. yes i have selected XT oscillator in the Genius programmer setting but even if i select HS; it runs the program in my hardware..... but still with the same problem that crystal starts its "Tick Tick" when i touch its one leg at pin 13. i can't understand the reason and don't know where i am going wrong.


Two suggestion:

1- I'm using MikroC, but found it is limited with its ready made modules.

2- To start with PIC, you can use the once that has internal oscillator to avoid one cause of uncertainty.

kindly elaborate a bit more... you mean to say that mickro-c is not a good compiler and can't be used for large programs because of limitations???
and what is internal oscillator?
 
oh yap i did it.......... :)

just only tick
fosc1
wdt0
wdt1
debug
and untick all others in Genius programmer. and i solved the problem/issue. :)
 
MikroC ready-made modules makes your life easy, but limited to them, you can't do any amendment for there parts, I've faced this when used LCD module and wanted to show my own character.

PICs with Internal oscillator such as 16F628 and 12F629 are having internal oscillator where you can use and forget about Xtal connection in case your circuit is not functioning properly . Although it is not as accurate as the Xtals, but it is good especially where time is not of great important.
 
These are the fuses, which if all combined, in PIC term called Configuration Word . This is the error "Non configuration worde in hex file. please set it after loading" you are talking about in post #6.
 
"Genius programmer gives me this error while loading Hex file "Non configuration worde in hex file. please set it after loading".
i am also same problem .and using genius g540 programmer please advice me how setting the configuration bit in Genius programmer;
thanks all of you
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top