Problem Programming 18F2580

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
User avatar
Jay Dee
Posts: 398
Joined: Tue Aug 18, 2009 6:42 pm
Has thanked: 121 times
Been thanked: 154 times
Contact:

Problem Programming 18F2580

Post by Jay Dee »

Hi,
I have a new install of FC8. (8.0.0.0.6) with mLoader 4.0.0.1 and an original EB006 (007) programmer.
I'm trying to program a PIC18F2580 using ICSP using short (100mm) jump leads from the EB006
The EB006 does not require any firmware upgrade I assume ??

I have to ask, are there any other known issues, with FC8 and this PIC. (I know its almost always user hardware! :) )
The Programmer seems able to identify the Chip and send a program but I just cant get any Flash test program to run.

I cant even get the ext Osc pins to run drive a crystal. So I tried internal OSC, which should remove any crystal issues from the problem...still no effect.

This circuit is very much like an ECIO but with a mini 5V DC-DC supply and CAN transceiver on the board....so there is absolutely minimal other circuitry to interfere.
No doubt it'll be some silly hardware thing but I've got a bit lost de-bugging this one, so I ask for any input! :oops:
regards, J.

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: Problem Programming 18F2580

Post by Benj »

Hello,

Does the chip program ok if plugged directly into the E-block? It could be the flying leads as these will cause extra capacitance on the programming pins which may mean the signals are being distorted. If connecting the chip directly works then can you shorten your cables at all?

User avatar
Jay Dee
Posts: 398
Joined: Tue Aug 18, 2009 6:42 pm
Has thanked: 121 times
Been thanked: 154 times
Contact:

Re: Problem Programming 18F2580

Post by Jay Dee »

Hi Ben,
Sadly the chip is a SOIC type so I cant plug it into the programmer directly.
A) I'll try shorter leads as suggested when I get back to the UK workshop (couple of weeks!)
B) I may also try using a PICKIT3 as I can then make the leads very short.
C) I'll also scope at the IC's pins and see the quality of the signal pulses.
J.

User avatar
Jay Dee
Posts: 398
Joined: Tue Aug 18, 2009 6:42 pm
Has thanked: 121 times
Been thanked: 154 times
Contact:

Re: Problem Programming 18F2580

Post by Jay Dee »

Hi,
Done a bit more testing, I think I've got some buggy behaviour. (still waiting to find something stupid!)
With an EB006 and FC8 updated. I programmed an 18F1220 with a basic flash file to confirm the basic setup was working.

Chip: PIC18F1220 / EB006 J12,J13,J14: USB / Config: Oscillator - HS
mLoader: Chip Autodetects / sends
LED's flash as Expected. - All GOOD.

Change FC8 program to a 18F2580 and adjust the config settings to suit.
Chip: PIC18F2580 / EB006 J12,J13,J14: USB / Config: Oscillator - HS / Config: Extended CPU Instructions - Disabled
Chip Autodetects / MLoader reports;
Loading file...
File loaded from...
=> Flash_Test_Pic18F2580.hex
File sending...
File sent with 1 warnings:
1: Flash memory not verified - may be due to code protect
To check it was not a duff chip, I then used the MPLAB IPE & PICKIT3
Chip: PIC18F2580 / EB006 J12,J13,J14: ICD2
"Connecting to MPLAB PICkit 3...
Currently loaded firmware on PICkit 3
Firmware Suite Version.....01.51.12
Firmware type..............PIC18F
Target voltage detected
Target device PIC18F2580 found.
Device ID Revision = 4
2018-07-21 11:22:48 +0100 - Programming...
Device Erased...
Programming...
The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0x17f
configuration memory
Programming/Verify complete
2018-07-21 11:22:53 +0100 - Programming complete "
Remove PICKT3 to allow PIC to reboot.
LED's flash as Expected. - All GOOD

I've been through this a couple of times but it appears that mLoader is struggling to program the 18F2580 correctly.
Unless i've missed something.

Once the Chip has been loaded with the PICKIT3, mLoader does not throw the error (since the program on chip is correct), however any changes to the FC program and mLoader reverts to previous behaviour.

PP.S. I scoped the pins and the wave forms have good edges, no ringing, sharp transition.
Any feedback or further tests that can be suggested ??
Cheers, J.
Flash_Test_Pic18F2580.hex
(1.03 KiB) Downloaded 196 times
Flash_Test_Pic18F1220.hex
(1.02 KiB) Downloaded 193 times
EDIT: I mounted the SOIC PIC18F2580 on a adapter board and it fits the 28pin section of the EB006 fine. I did not have a DIP version.
EDIT: Side Issue --> The flash test also seems to produce the wrong Flash rate.. like the crystal freq is incorrect but its using the EB006 19.6 crystal..hmm. But using C code at the beginning to set " OSCCON = 0x76; " and use the internal 8Mhz oscillator, flash rate seems good.

User avatar
Jay Dee
Posts: 398
Joined: Tue Aug 18, 2009 6:42 pm
Has thanked: 121 times
Been thanked: 154 times
Contact:

Re: Problem Programming 18F2580

Post by Jay Dee »

Programming issue still remains, but the custom hardware which kicked this off, found the Stupid hardware problem.
Blocking diode between the MCLR pin and 5V rail was wrong was around.
CAN tranciever's sleep pin was connected to LVP programming pin, pulling it high and putting the chip into Low Volt Prog mode on each power up! :oops:
Custom Hardware aside...the programming of plain PIC IC's still exists. J.

User avatar
celebriums
Posts: 125
Joined: Sun Sep 25, 2016 3:50 pm
Has thanked: 71 times
Been thanked: 33 times
Contact:

Re: Problem Programming 18F2580

Post by celebriums »

Dear Jay Dee

I am currently using PIC18F25K80.

When I want to load the program with PICKIT 3 and MPLAB 4.20, I need to make the supply voltage 4.75V ..
I can not program if I get the 5V supply. I did not use diodes with the supply voltage.

I hope it will be useful for you.
Sincerely Regards
Sadık SUME

www.kaandesign.com.tr

User avatar
Jay Dee
Posts: 398
Joined: Tue Aug 18, 2009 6:42 pm
Has thanked: 121 times
Been thanked: 154 times
Contact:

Re: Problem Programming 18F2580

Post by Jay Dee »

So..
I can program the 18F2580 ICs with the PCIKIT3 and flash test works as expected.
But.. I still cant program a chip plugged directly into an EB006 Programmer. Once the program is sent the previous program must have been erased since the flash test stops working.
Ive now tried both FC8 / FC7 and Win7 / Win10

I'm at a bit of a loss since;
a)I can program a 18F1220 just fine with exactly the same setup, so I'm assuming the EB006 programmer is fine.
b)The programs send OK using the pickIT3 so Im assuming both the FC program and configuration bits are suitable.

When the programming fails the interface reports;
File sent with 1 warnings:
1: Flash memory not verified - may be due to code protect

User avatar
Jay Dee
Posts: 398
Joined: Tue Aug 18, 2009 6:42 pm
Has thanked: 121 times
Been thanked: 154 times
Contact:

Re: Problem Programming 18F2580

Post by Jay Dee »

Hmm.. re-visiting a previous project.
I can program the 18F2580 using the pickit3 (IPE) via flowcode. Works with both INT and EXT Oscillator.
So hardware looks good.

I can program a PIC 16F88 using my EB006 programmer and short flying leads.

EB006 J5
1=Reset
2=Data
4=Clock
18=5V
20=Gnd

So I assumethe EB006 and conection method is good.

I still cannot program an 18F2580 with the EB006, I have tried;
Short programming leads from the EB006 to the target board.
DIP version of chip plugged directly into EB006.
Settings for both INT and EXT oscillator.

I'm confused :? any thoughts on things to try?

Post Reply