Are you picking the correct PIC?
Take a look at the inc you posted...
Are you picking the correct PIC?
Take a look at the inc you posted...
Dave
Always wear safety glasses while programming.
Dave,
Good catch and it got me excited for a second there, but I just noticed that I have a typo on my thread title.
The PIC I have is the 18F4580, there is not such a thing as a PIC4850. I might be dislexic. THe file I posted is the correct one, so is the decription of the PIC on the schematic I posted.
Any other ideas? I am setting the "Fail-safe clock monitor" and "Internal External Switch over" options so the PIC can run from the internal oscillator while I get this external oscillator to work. But I have tried it all, so any fresh input from anyone, will really help.
Read the PIC back with your programmer, then view the config window. Do the config settings it reads back match what you expect?
Your config settings look good(screen shot). The U2 program has a pull down menu option which allows you to select between using the configs written in your code or from the config menu on the programmer. Try changing this setting and commenting your configs out of your code.
Last edited by mark_s; - 8th March 2011 at 22:41.
Bruce,
I read back the configuration from the PIC, and it returned the following:
Towards the bottom of the window, it has a 0xEB87. I can't really tell what this data means, so I am looking at the DS39622L document from microchip. But I really can't see how those two relate. Page 29, of the document shows the configuration bits and the CONFIG1H is located at 300001h.Code:0000- 0200 1f17 8200 0081 c00f e00f 400f
Mark_s,
I changed the 18F4580.INC file to comment out the _CONFIG statements and recompiled. I also change the options to the meProg to not "Update configuration from file". I reprogrammed the device, but no luck. I read back the configurations bits and they are the same as above.
Any more ideas?
So I made sense of the configuration read back results. And as I imagine the CONFIG1H is not being set by the U2 programmer.
CONFIG1H = 02 (HS Oscillator enabled)
CONFIG1L = 00 (default))
CONFIG2H = 1F
CONFIG2L = 17
CONFIG3H = 82
CONFIG3L = 00
CONFIG4H = 00
CONFIG4L = 81
CONFIG5H = C0
CONFIG5L = 0F
CONFIG6H = E0
CONFIG6L = 0F
CONFIG7H = 40
CONFIG7L = 0F
The configuration file seems to be correct. Can anyone make sense of what is going on?. I have two cards behaving exatly the same.
Last edited by IRQ_Diode; - 9th March 2011 at 00:06. Reason: Corrected the H and L on the CONFIGx table.
When you read the .HEX from the PIC with your programmer, just click the C to view the config settings embedded in the .HEX file. Like you did in post #4.
If it reads back with the settings you expect, then I would have to suspect a bad oscillator, caps, or something in the external osc circuit causing a problem.
Double check those SMD caps to make sure they're not resistors...;o)
Is "Options|Update Configuration From File" checked? It shouldn't be.
Best Regards,
Paul
The way to avoid mistakes is to gain experience. The way to gain experience is to make mistakes.
Bookmarks