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.

Crystal and PIC16F877A

Status
Not open for further replies.

xpress_embedo

Advanced Member level 4
Joined
Jul 5, 2011
Messages
1,154
Helped
161
Reputation
396
Reaction score
189
Trophy points
1,353
Location
India
Activity points
10,591
Hello!! Everyone

I am using ICSP to program my PIC16F877A using WinPIC Software and a Burner purchased from rydoLABZ

So i have to use 24MHz Crystal in a circuit using PIC..

But i don't have ICSP connection on that board..
(and i can't make these 6(MCLR,Vcc,GND,PGD,PGC,PGM) connections on that board)


But i having an another board specially made by me for programming purpose...
that one is having a crystal of 4Mhz..

By programming the controller in 4Mhz board and using it in 24Mhz will work..

Actually my circuit is not working thats why i am guessing what could happens..
Is this a Problem..
Pls Help if Someone is having an idea..

Thanks in Advance
 

PIC16F877 top is 20MHz, often problems show up if You try to use 24MHz or faster then factory declared.

I know for 20MHz, I didnt see 16F877 on 24MHz!

Put 4MHz!
 
Actually i have to generate a Sine Wave Using DAC0808 and PIC

but it always remain high don't know where is the Problem...

And I am using PIC16F877A not 877

Means from your perspective i have to replace my crystal
 

The crystal isn't used during the actual programming operation so it doesn't matter what frequency is attached at that time. You are pushing your luck by using a 24MHz crystal though when Microchip only guarantee that type of PIC will work up to 20MHZ. Check the config bits are set to use HS oscillator mode.

Brian.
 

Yes I understood..
Maximum speed is 20Mhz...

Thanks

---------- Post added at 01:38 ---------- Previous post was at 01:34 ----------

The crystal isn't used during the actual programming operation so it doesn't matter what frequency is attached at that time. You are pushing your luck by using a 24MHz crystal though when Microchip only guarantee that type of PIC will work up to 20MHZ. Check the config bits are set to use HS oscillator mode.

Brian.

Actually when i burn my code into the PIC..
I want to select HS Fuse, but by doing so.. Program doesn't burns..

It burns only when i select the fuse bit XT..

Can any one suggest me what to do now..
 

The only reason I can see that causing a problem is if your programming board uses a bootloader program, and that's rare. If your programmer can also work with other kinds of PIC it probably ISN'T using a bootloader as the 877A is one of very few PICs that use that method.

Normally, the speed at which the data is programmed is decided by the PGC signal and the crystal oscillator isn't used. It should still be possible to set it to HS regardless of the programmer used. I do not use the same hardware but is it possible you have an option to override the HEX file and set the config fuses manually? If so, try setting HS mode that way.

Brian.
 

I have used both ways...
__CONFIF(FOSC_HS);

and by setting manually to HS both results into unsuccessful programming

but when setting it to...
XT as i am having 4Mhz crystal in my Board(through which i am programming)
it works in both ways.
Manually and Pro grammatically
 

Sorry Arun, I can't see what's wrong. It should be possible to program the PIC even with the crystal removed altogether!
The config bits are just like all the other registers and it should be possible to program them to any state, regardless of other conditions. Are the other addresses programming sucessfully?
All I can suggest is try using a different programmer.

Brian.
 

I have used both ways...
__CONFIF(FOSC_HS);

and by setting manually to HS both results into unsuccessful programming


Hi,

I have regularly use a program in a 877A with XT , so have just changed that to HS and it programs in fine.

There was no crystal connected to it when I programmed it.

The config is taken from Microchips .Temp-late and .Inc files ( ensure LVP is turned off )

Note the last digit of the Config code on the programmer screenshots 1=XT 2+HS
 

Attachments

  • XT.jpg
    XT.jpg
    112 KB · Views: 74
  • HS.jpg
    HS.jpg
    115.8 KB · Views: 74

Sorry Arun, I can't see what's wrong. It should be possible to program the PIC even with the crystal removed altogether!
The config bits are just like all the other registers and it should be possible to program them to any state, regardless of other conditions. Are the other addresses programming sucessfully?
All I can suggest is try using a different programmer.

Brian.

Its Okay Brian..
Actually my Programmer is not at all good.. it just cost 8$ 300Rs in India..
can u tell me some good programmer which i can buy..
Is ICD3 is a programmer i know its a In-Circuit Debugger but can it Burn my code in PIC..
It Cost around 200$ in India and
Pik Kit2 is also there which will cost 40$ in India..
Can u tell me which one to buy..
And I don't use any expensive development boards..
I just make my own... on Vero Board Zero PCB..

---------- Post added at 12:10 ---------- Previous post was at 11:55 ----------

Now i have made an another board...

In which i have placed a 24Mhz Crystal...
Its Working absolutely Fine...
:-(

Unpredictable result's..

I think i have some big mistake in my connections..
 

Hi Arun. At least you now know where the problem lies.

I have three PIC programmers here, a genuine Pickit 2, a copy of a Pickit 2 made in China and a K150 from www.kitsrus.com with my own hacked firmware.

I really would suggest using a real or copy version of the Pickit 2 or 3, most other programmers do not fully meet Microchip's specifications and may be unreliable, particularly those powered from PC serial or parallel ports. The design of the PicKit 2 is available from Microchip's web site and there are several DIY versions of it on the market, some mentioned on Edaboard if you search. The good thing about PicKit is you can not only program PICs but EEPROM and several other devices and it also works as a debugger, logic analyzer and a serial port. I often have both of mine attached to the same board so I can program and debug 'hands off'.

Brian.
 
Brian.
Right now my programmer works.. with 24Khz Crystal .. seems strange to me..

I will buy PIC Kit2 or ICD3 which one is better..
ICD3 is much more costlier then PICKIT2
 
Brian.
Right now my programmer works.. with 24Khz Crystal .. seems strange to me..

The 20MHz specified is a safe maximum value to use. The controller will work over all temperatures and will function as intended.
Overclocking the processor can cause it to fail, specially over temperature extremes. Perhaps it even starts missing clock cycles or stop at all, thus unexpected and thus unwanted behaviour.
In most cases over clocking can be done at room temperature, but not all devices might work .

Well you can experiment with overclocking and you are free to do it if its not a final prot.

Here are few lines extracted from a post of this board:-

"You can think about overclocking as about resistor overloading.

For example you can overload 0.25 W resistor with 2W. After some time you will have smoke on that resitor.

So you can put fan on it and solve power disipation problem. If you need more than one resistor you can put fan on every resistor and get resistor & fan network.

If you need more power on resistor just put more fans. This is overclocking philosophy. " (https://www.edaboard.com/threads/1002/)
 
Last edited:
I really would suggest using a real or copy version of the Pickit 2 or 3, most other programmers do not fully meet Microchip's specifications and may be unreliable, particularly those powered from PC serial or parallel ports. The design of the PicKit 2 is available from Microchip's web site and there are several DIY versions of it on the market, some mentioned on Edaboard if you search. The good thing about PicKit is you can not only program PICs but EEPROM and several other devices and it also works as a debugger, logic analyzer and a serial port. I often have both of mine attached to the same board so I can program and debug 'hands off'.

I fully agree with Brian. Not all PICkit clones are created equal and the numerous posting on this forum concerning issues with such clones is a testament to that fact.

And while I do not personally own any PICkits, I use both ICD2, ICD3 and REAL ICE for my programming/debugging requirements, they do offer several nice features as mentioned by Brian.

Can you purchase items on eBay? If so, I would recommend keep an eye open for any PICkit2 and ICD2s listed. I have purchase five genuine ICD2s in the $25 to $50 USD range over the past 2 years from eBay, all them performing as expected.

You may also want to regularly visit the following site which posts current Microchip Discount and Specials:

**broken link removed**

Microchip is currently offering individuals in China, Taiwan and Hong Kong the PICkit3 for $13.99 USD/88 RMD.

It should also be stated that Microchip offers excellent product/customer support, not found with most clone manufacturers.

When the ICD3 was first release, two units I had just recently purchased, failed due to an inherent design flaw. Microchip after quickly determining there was indeed a problem, promptly FedEx'd two replacement units with a return shipping label for the defective units to be shipped back. Now that's customer support.

BigDog
 
pickit2 from sure electronics is the nearest to the real thing (got both and both work EXACTLY the same)
this may help you

64_1328056942.png


Make sure you connect ALL vcc and VDD (made that mistake sooooo many times but easy to miss) also make sure you DONT cross the pgmclk and pgmdat lines (been there scrating head for days wondering what problem was )

Also google microchips ICSP manual full of useful stuff like fuse settings etc for differnt osci types AND speeds
 

Yes I understood..
Maximum speed is 20Mhz...

Thanks

---------- Post added at 01:38 ---------- Previous post was at 01:34 ----------



Actually when i burn my code into the PIC..
I want to select HS Fuse, but by doing so.. Program doesn't burns..

It burns only when i select the fuse bit XT..

Can any one suggest me what to do now..

Arun,
after selecting the HS fuse, save the file with arbitrary name

thenclose and reselect the new file and it programms.
please try

what is the cheap Rs300 programmer you have indicated? if it is Pickit2 clone,
perhaps i can send you a redy made pcb with critical components mounted that you can re assemble and yours becomes a complete Pickit2.
 

I am using this Programmer...
**broken link removed**

And in my software WinPIC.. There is no Option to save the File.. which u are saying to me..
 
i presume you are using winpic800 software and configured as JDM. if there is another by name winpic, please change over to winpic800latest version, install as administrator. this software is at WinPic800 - Inicio
click FILE-OPEN- the hex, then see the SETTING section change the setting and then back to datasheet. click FILE _SAVE AS . use an arbitrary name, like xxxa.hex for a xxx.hex.

I do it regularly as needed. You don't need any Code protection for learning and when you are into business, you have to learn many many things LoL.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top