View previous topic :: View next topic |
Author |
Message |
Lykos1986
Joined: 26 Nov 2005 Posts: 68
|
18F4685 problem... |
Posted: Thu Sep 11, 2008 2:28 am |
|
|
Hi to everyone! I am trying to program my new PIC18F4685 using MPLAB 8.1 and CCS 4.057.
The sample program that I am using is below:
Code: |
#include <18F4685.h>
#fuses HS,NOWDT,NOPUT,NOPROTECT,NOBROWNOUT,NOCPD,NOWRT,NOLVP,MCLR,NOPBADEN,NOLVP
#use delay (clock=10000000)
void main()
{
output_high(pin_e2);
while(1)
{
output_high(pin_a0);
delay_ms(400);
output_low(pin_a0);
delay_ms(400);
}
}
|
But I am facing the problem below, in the MPLAB:
Code: |
Connecting to MPLAB ICD 2
...Connected
Setting Vdd source to target
Target Device PIC18F4685 found, revision = Rev 0x1
...Reading ICD Product ID
Running ICD Self Test
...Passed
MPLAB ICD 2 Ready
Programming Target...
...Validating configuration fields
...Erasing Part
...Programming Program Memory (0x0 - 0x7F)
ICD0082: Failed MPLAB ICD 2 operation
ICD0151: Failed to sync memory (MT = Program) (Dir = 0x1)
ICD0275: Programming failed.
MPLAB ICD 2 Ready
|
It seams that the ICD2 recognized the PIC but it is unable to program it! I don't know were is the problem. Is it possible to be in the code? In the hardware? Any fuse? I am using the ICSP and the operating voltage is 2.8V (2.72V actually) but I have got "pass" to all the self tests.
Any help, please! |
|
|
RLScott
Joined: 10 Jul 2007 Posts: 465
|
Re: 18F4685 problem... |
Posted: Thu Sep 11, 2008 5:38 am |
|
|
When you are programming the part, are you supplying Vdd power to the PIC from the ICD2, or is the Vdd power supplied independently of the ICD2? _________________ Robert Scott
Real-Time Specialties
Embedded Systems Consulting |
|
|
Lykos1986
Joined: 26 Nov 2005 Posts: 68
|
|
Posted: Thu Sep 11, 2008 8:25 am |
|
|
The circuit has got his Vdd power. I am not supplying any power from the ICD2 and I have also disabled the "Power target circuit from ICD2". But I have to say again that I have got a “pass” to all of the self tests! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Sep 11, 2008 12:59 pm |
|
|
Do a search on the Microchip forum. I can see you've posted over there.
Here's the search page:
http://forum.microchip.com/search.aspx
Put this is in the top box and click OK:
There are probably 50 posts or threads on this topic. |
|
|
Lykos1986
Joined: 26 Nov 2005 Posts: 68
|
|
Posted: Sat Sep 13, 2008 11:46 am |
|
|
Thanks for the answer! I have done that and it looks that it is a bug in the MPLAB!
But I am using the latest one (8.1). I have also try and the very stable (7.6) that I was using it for long time in the past and also the 8.16 (not final release) and the problem remains!
At list my test code is OK? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Sep 13, 2008 1:23 pm |
|
|
You have NOLVP in two places in your #fuses statement.
I don't see any other problems.
Suggestions:
1. Carefully check if you have connected the ICD2 to your board
correctly. Look at the list of Guidelines and Target Circuit Design
Considerations on the right side of this document (ICD2 poster):
http://ww1.microchip.com/downloads/en/DeviceDoc/51265e.pdf
2. Try using a different PIC than the 18F4685. Try it with an 18F452.
See if it works.
3. Read the Help file topic for ICD2 in the MPLAB Help. There is a very
large amount of help available there.
If you still have a problem, it should be solved by the Microchip ICD2
forum or Microchip tech support. The CCS board can't fix a problem
with MPLAB or the ICD2 hardware. |
|
|
|