ICD issues on PIC16F877A

Moderator: Benj

Post Reply
canions
Posts: 4
Joined: Sun Jul 01, 2012 6:16 pm
Has thanked: 4 times
Contact:

ICD issues on PIC16F877A

Post by canions »

Am unable to get ICD working for the above chip. FC5 simulation and flashing of code to micro are deemed to be working well.

Although ICD options in PROJECT OPTIONS tab have been activated,
ICD Active in Project Options.jpg
ICD Active in Project Options.jpg (43.42 KiB) Viewed 5023 times
I cannot establish connection/comms to the chip (ICD compatible chip). Pls suggest possible fix.

When trying to establish connection via the DEBUG TAB the following errors are reported:
Error msg on ICD attempt.jpg
Error msg on ICD attempt.jpg (25.7 KiB) Viewed 5023 times
Compliler messages are appended for your inspection.
Trial877A.c
(3.37 KiB) Downloaded 231 times
FCF file is a simple routine that runs LED board- realtime code check is fine.

Thanking you for your assistance.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: ICD issues on PIC16F877A

Post by Benj »

Hello,

From the C file you posted it looks like you have not re-compiled since enabling the ICD mode.

To get ICD working you must enable it in the project options and then perform a compile to chip operation. After the programming has finished close the compilation messages window and click the start button. Hopefully the ICD should now fire up for you.

Let me know how you get on.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: ICD issues on PIC16F877A

Post by medelec35 »

In addition to Ben's reply, You can also get the same response i/e different chars of data on the top row and all 0's on the bottom row if you move ICD2/USB jumper from USB to ICD2

If you have then you will need to move jumper back to USB.
Have you tried a 1Hz test (not with ICD selected) to make sure switches are set correctly if your using EB006?

ICD as default uses RB6 and RB7 for communication. have you got anything connected to these connections hardware wise?

I assume your microcontroller is being programmed OK with no errors?

What hardware are you using e.g. MultiProgrammer EB006 V7 or Flowkit?
Martin

canions
Posts: 4
Joined: Sun Jul 01, 2012 6:16 pm
Has thanked: 4 times
Contact:

Re: ICD issues on PIC16F877A

Post by canions »

:? Gentlement thanks for the comments. Nice to know that we are not alone down under (literal)

Ben, sorry I sent you the incorrect file. Have checked the original C file and ICD stuff seems to be there. Have even tried it with a new code set and have appended this file for your perusal. Result is still the same with previous error message saying that
"ICD has failed to communicate with the target. Make sure the target is powered correctly, then reset it and try again"
Algae Controller2.msg.txt
(5.61 KiB) Downloaded 219 times
Algae Controller2.casm
(93.46 KiB) Downloaded 231 times
medelec35: I have validated that jumper setting is defaulted to USB and checked integrity of connections. Have also checked setting for switches and progam is operational when ICD is not active. Will run a test routine for EB006 and revert in the next post.

I have also ensured that connections to all of Port B are free.

Yes micro programs fine, but just no ICD

Hardware = EB006 V8

Question: Do I have to have PPPv3 (on the ELSAM V2.4 mini CD) installed as I have experimented with it installed and then uninstalled without any noticeable difference.

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times
Contact:

Re: ICD issues on PIC16F877A

Post by dazz »

Hi canions

I havent got an icd here, but can you open your hex file with PPP (its in your flowcode folder/tools.) once open ,click view ,then click config(you may need to tell ppp what chip your using) and check if the background debug is enabled, if not enable it and click ok, apply then save to file and flash the new file to your pic.

Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

canions
Posts: 4
Joined: Sun Jul 01, 2012 6:16 pm
Has thanked: 4 times
Contact:

Re: ICD issues on PIC16F877A

Post by canions »

Hi Dazz thanks for the info and suggestion.

I have reinstalled PPPv3 and the USB drivers for EB006-00-8 (The drivers on the supplied CD are newer than the ones on the download page by one day). I have also been able to elimate the ntport.dll error received on launching PPPv3; from the dll fix found at this post: http://www.matrixmultimedia.com/mmforum ... 216#p30216

I have double checked that 'Backgroud Debug' has been Enabled. Recompiled all the files without any success. There does not appear to be any comms issues with programming & Auto-detect when running Flowcode or PPPv3. Only ICD still fails and the same error is reported. When I click "YES" the second line is still filled with 0x00.

I am going to play with another chip say 16F684 and see what happens. Will keep you updated. Goodnight

canions
Posts: 4
Joined: Sun Jul 01, 2012 6:16 pm
Has thanked: 4 times
Contact:

Re: ICD issues on PIC16F877A

Post by canions »

Decided to tweak Oscillator and Comm speed settings as I noted that some of my LEDs were flashing on stepping into program in Debug Mode before nuisance error was reported.

Hardware: Removed default crystal for 4MHz, set SW2 to OSC and Power to EB006-00-8 defaulted to PSU

Flowcode: Build Tab--> Project Options

Clock Speed : 4000000 (Mhz)
--> ICD Tab, Comm speed: 200
ICD000.jpg
ICD000.jpg (52.66 KiB) Viewed 4985 times
Back to General Options Tab--> Configure Chip settings as follows: (Note Background Debug has been DISABLED not enabled)
ICD001.jpg
(84.55 KiB) Downloaded 1150 times
And finally --> Options:
ICD002.jpg
ICD002.jpg (53.54 KiB) Viewed 4985 times
Build Tab --> Compile to Chip.

...finally the ICD works.

At this juncture I am attributing my problems to sync due to the comms and clock speeds. Pls feel free to comment :P
Last edited by canions on Mon Jul 09, 2012 6:40 am, edited 1 time in total.

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times
Contact:

Re: ICD issues on PIC16F877A

Post by dazz »

Hi
Glad your up and running, i always check the double check the config settings before i write the hex to the chip, as i find sometimes they change

Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

Post Reply