CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

18F4685 problem...

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Lykos1986



Joined: 26 Nov 2005
Posts: 68

View user's profile Send private message

18F4685 problem...
PostPosted: Thu Sep 11, 2008 2:28 am     Reply with quote

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

View user's profile Send private message

Re: 18F4685 problem...
PostPosted: Thu Sep 11, 2008 5:38 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Sep 11, 2008 8:25 am     Reply with quote

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

View user's profile Send private message

PostPosted: Thu Sep 11, 2008 12:59 pm     Reply with quote

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:
Quote:
ICD0151

There are probably 50 posts or threads on this topic.
Lykos1986



Joined: 26 Nov 2005
Posts: 68

View user's profile Send private message

PostPosted: Sat Sep 13, 2008 11:46 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Sep 13, 2008 1:23 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group