Page 1 of 1

PIC18F2580 Programming failed

Posted: Mon Aug 22, 2011 10:17 am
by dbasnett
EB006 v6
SW1 - Fast
SW2 - XTAL
ICD2 / USB - USB
PSU / USB - PSU
LVP Selection - All three set for IO Port
Flowcode Pro v4.5.18.74
FlowKit connection - PC-->FlowKit In - FlowKit Out --> EB006 USB
Custom USB Device - Matrix PICmicro Programmer - v 1.0.0.6, 12/19/2007
CPU - PIC18F2580
Port A - LED
Port B - LCD
Port C - nc
Port D - nc
Port E - nc


Using the same simple program I have been using to teach myself Flowcode, I replaced the 16F88 with a 18F2580 (http://ww1.microchip.com/downloads/en/D ... 39637d.pdf).

When I try to compile to the chip I get this:

...
success

Return code = 0

Launching the programmer...
C:\Program Files (x86)\Matrix Multimedia\Flowcode V4\Tools\PPP\PPPv3.exe -cs 2 -chip PIC18F2580 -nogui "Flowcode1.hex"
Sending program...
Erasing the PICmicro
NOTE: EEPROM data will also be erased!

............

Writing program memory
Writing configuration memory
Writing id-locations
Reading program memory
Reading configuration memory
Finished reading PICmicro contents
Programming failed:

Program memory check failed

(NOTE: if the PIC is code-protected, this message will be
displayed even if the program has been sent correctly)
That took 6.895 seconds

Return code = 0

FINISHED

I also created a new program targeting the 2580. The program only had a begin / end. It also failed with the same problem.

(I also tried programming with the boards not connected and bypassing the flowkit)

I figured out how to get my PICKit2 connected. It was able to download the hex without a problem. After downloading I moved all of the jumpers back and the program runs, but the LCD display is messed up. It looks like "0 || || P || 0 ||...". The LED is running correctly. But I still can't use Flowcode to compile and download.

Re: PIC18F2580 Programming failed

Posted: Mon Aug 22, 2011 3:21 pm
by Benj
Hello,

Try disabling the extended CPU config setting. This should allow the LCD to work correctly.

Re: PIC18F2580 Programming failed

Posted: Mon Aug 22, 2011 7:09 pm
by dbasnett
So don't use Flowkit, compile with extended CPU = Disabled, and then download with Microchips PICKit2? Is this 'the' solution or just temporary?

Re: PIC18F2580 Programming failed

Posted: Mon Aug 22, 2011 7:34 pm
by dbasnett
Using the PICKit 2 with the change to the extended CPU seems to have cured the LCD on Port B.

My 4580 chip is in (I have to go pick it up), so if you want to pursue why I can't download with the Flowkit, it will need to be today. Hopefully I will not have any issues with the 4580.

Re: PIC18F2580 Programming failed

Posted: Mon Aug 22, 2011 7:55 pm
by JohnCrow
Extended CPU
Looking through posts on here it looks like the best advice is unless you specifically need the extended cpu options is to have it turned off.

Re: PIC18F2580 Programming failed

Posted: Mon Aug 22, 2011 9:03 pm
by dbasnett
I have no idea what the option does. What I really need is to be able to download directly from Flowcode. Switching the jumpers around to download is OK for getting used to the system, but long run it isn't fun. I also worry about having the PICKit2 and USB cable accidentally connected at the same time.

Re: PIC18F2580 Programming failed

Posted: Tue Aug 23, 2011 10:08 am
by Benj
Hello,

Do you have to switch the jumpers around? If you are not using PortB pins 6 and 7 in your application then you should be able to leave the jumper where it is and still allow the application to run, make sure the PICkit is not holding the device in reset. PICkit2 and USB cable both plugged in together should not cause any issues.

Have you setup Flowcode so it is using the PICkit directly or are you manually loading via PICkit each time. If you are doing this manually then here are the details for setting up Flowcode.

http://www.matrixmultimedia.com/support ... f=22&t=672

The chips should arrive today so I will see if I can get them to work correctly with the PPP software.