picprojects.net Forum

picprojects.net Forum
It is currently Sun Sep 23, 2018 9:30 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Problem programming PIC24FJ64GA002 using Raspberry Pi
PostPosted: Sat Oct 03, 2015 4:27 pm 
Offline

Joined: Sat Oct 03, 2015 4:18 pm
Posts: 2
Hi,

I am trying to program a PIC24FJ64GA002 with my Rapsberry Pi, as shown here.

The PIC has already been soldered on the board (Bus Pirate v3.8a) and I have to program the bootloader before I can 'upload' the actual firmware(s).

I had to change the pin config in pgmifcfg.xml as I am using my (spare) RPi B.

Code:
    <PgmIf name="GPIO Programmer (Raspberry Pi)" typ="LVP" connection="GPIO">
        <PinCfg name="MCLR" pin="7" invert="0" />
        <PinCfg name="PGM" pin="0" invert="0" />
        <PinCfg name="CLK" pin="8" invert="0" />
        <PinCfg name="DOUT" pin="10" invert="0" />
        <PinCfg name="DIN" pin="9" invert="0" />
    </PgmIf>


The Bus Pirate doesn't have the PGM pin exposed to the ICSP header.

I always get verify errors on code mem and config mem. When I try to read the PIC, I get only 00's

The RPi is running Raspbian (Jessie) and I using picpgm version v2.8.7.1

These are the messages I get:

Code:
pi@raspberrypi ~ $ sudo picpgm -p Bus_Pirate/package/bootloader/BPv3-Bootloader-v4.4.hex

PICPgm Development Programmer, v2.8.7.1
http://picpgm.picprojects.net
Copyright 2002-2015 Christian Stadler (picpgm@picprojects.net)
built on Sep 26 2015 at 16:12:50
==================================================================

Autodetecting Programmer ...
GPIO access via /dev/mem, base address 0x20200000
Programmer: GPIO Programmer (Raspberry Pi)
            at GPIO

Autodetecting PIC ...

PIC name:    PIC24FJ64GA002
Device ID:   0x0447
Flash:       86 kByte
EEPROM:      0 Byte

Erasing whole device ... done!
Programming Code Memory 0x00011C00
Programming Code Memory 0x00015800
Verifying Code Memory 0x00000000
Verify Error: Code Mem 0x000000: PIC=0x0000 Buf=0xA800
Verifying Code Memory 0x00000008
Verify Error: Code Mem 0x000008: PIC=0x0000 Buf=0xA976
Verifying Code Memory 0x0000000C
Verify Error: Code Mem 0x00000C: PIC=0x0000 Buf=0xA976
Verifying Code Memory 0x00000010
Verify Error: Code Mem 0x000010: PIC=0x0000 Buf=0xA976
Verifying Code Memory 0x00000014
Verify Error: Code Mem 0x000014: PIC=0x0000 Buf=0xA976
Verifying Code Memory 0x00000018
Verify Error: Code Mem 0x000018: PIC=0x0000 Buf=0xA976
Verifying Code Memory 0x0000001C
Verify Error: Code Mem 0x00001C: PIC=0x0000 Buf=0xA976
Verifying Code Memory 0x00000020
Verify Error: Code Mem 0x000020: PIC=0x0000 Buf=0xA976
Verifying Code Memory 0x00000024
Verify Error: Code Mem 0x000024: PIC=0x0000 Buf=0xA976
Verifying Code Memory 0x00000028
Verify Error: Code Mem 0x000028: PIC=0x0000 Buf=0xA976
Verify Error: Too much errors in Code Mem, giving up!
Programming Data Memory 0x00000000
Verifying Data Memory 0x00000000   => Data memory OK!
Programming Config Memory 0x00000004
Verifying Config Memory 0x00000000
Verify Error: Cfg Mem 0x000000: PIC=0x0000 Buf=0xF9D7
Verifying Config Memory 0x00000002
Verify Error: Cfg Mem 0x000002: PIC=0x0000 Buf=0x3F5F
Verifying Config Memory 0x00000004

Programming finished with Verify Error(s)!

finished in 1124.0 seconds!
pi@raspberrypi ~ $


Top
 Profile  
 
 
 Post subject: Re: Problem programming PIC24FJ64GA002 using Raspberry Pi
PostPosted: Sat Oct 03, 2015 8:20 pm 
Offline

Joined: Fri Oct 28, 2011 5:18 pm
Posts: 225
Hi,

could you check if at least erasing is working?
I.e. erase the PIC and run a blank check?

Code:
sudo picpgm -e
sudo picpgm -blank


Could you post the result?

Thanks!


Top
 Profile  
 
 Post subject: Re: Problem programming PIC24FJ64GA002 using Raspberry Pi
PostPosted: Sat Oct 03, 2015 9:13 pm 
Offline

Joined: Sat Oct 03, 2015 4:18 pm
Posts: 2
Christian,

Before:
Code:
pi@raspberrypi ~ $ sudo picpgm -blank

PICPgm Development Programmer, v2.8.7.1
http://picpgm.picprojects.net
Copyright 2002-2015 Christian Stadler (picpgm@picprojects.net)
built on Sep 26 2015 at 16:12:50
==================================================================

Autodetecting Programmer ...
GPIO access via /dev/mem, base address 0x20200000
Programmer: GPIO Programmer (Raspberry Pi)
            at GPIO

Autodetecting PIC ...

PIC name:    PIC24FJ64GA002
Device ID:   0x0447
Flash:       86 kByte
EEPROM:      0 Byte

Reading Code Memory 0x00000000
Blank Check: Code memory is not blank (@address 0x00000004)!
Reading Data Memory 0x00000000
Blank Check: Data memory is blank!

Device is NOT blank!

finished in 2.0 seconds!


After:
Code:
pi@raspberrypi ~ $ sudo picpgm -e

PICPgm Development Programmer, v2.8.7.1
http://picpgm.picprojects.net
Copyright 2002-2015 Christian Stadler (picpgm@picprojects.net)
built on Sep 26 2015 at 16:12:50
==================================================================

Autodetecting Programmer ...
GPIO access via /dev/mem, base address 0x20200000
Programmer: GPIO Programmer (Raspberry Pi)
            at GPIO

Autodetecting PIC ...

PIC name:    PIC24FJ64GA002
Device ID:   0x0447
Flash:       86 kByte
EEPROM:      0 Byte

Erasing whole device ... done!

finished in 2.0 seconds!
pi@raspberrypi ~ $ sudo picpgm -blank

PICPgm Development Programmer, v2.8.7.1
http://picpgm.picprojects.net
Copyright 2002-2015 Christian Stadler (picpgm@picprojects.net)
built on Sep 26 2015 at 16:12:50
==================================================================

Autodetecting Programmer ...
GPIO access via /dev/mem, base address 0x20200000
Programmer: GPIO Programmer (Raspberry Pi)
            at GPIO

Autodetecting PIC ...

PIC name:    PIC24FJ64GA002
Device ID:   0x0447
Flash:       86 kByte
EEPROM:      0 Byte

Reading Code Memory 0x000157F4
Blank Check: Code memory is blank!
Reading Data Memory 0x00000000
Blank Check: Data memory is blank!

Device is blank!

finished in 1698.0 seconds!


Top
 Profile  
 
 Post subject: Re: Problem programming PIC24FJ64GA002 using Raspberry Pi
PostPosted: Thu Feb 25, 2016 7:01 am 
Offline

Joined: Wed Nov 04, 2015 9:31 am
Posts: 9
Ciao,

i have the same problem with PIC24FJ256GA106 and the last version of picpgm. Do you have solution?

Thank you,

Giuseppe


Top
 Profile  
 
 Post subject: Re: Problem programming PIC24FJ64GA002 using Raspberry Pi
PostPosted: Thu Mar 10, 2016 9:24 pm 
Offline

Joined: Fri Oct 28, 2011 5:18 pm
Posts: 225
Hello Giuseppe,

once you inverted the clock pin it work for you, right?
I assume this due to viewtopic.php?f=7&t=20831.

Thanks!

Regards,
Christian


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group