Skip to main content
Topic: Pic24fj64gb002 (Read 17477 times) previous topic - next topic

Pic24fj64gb002

supposed to work???


Code: [Select]
C:appsbuspirate>piratepicprog.exe -p buspirate -u COM2 -s 115200 -c 24FJ64GB002 -V
(Bus) Pirate PIC Programer v0.2

Initializing interface
115200
Entering binary mode
BP: Setup mode...
Setup peripherals...
(OK)
Found '24FJ64GB002' in programming database :) index = 3
Checking for 24FJ64GB002 attached to programmer...

Wrong device: 0XFFFF (ID: 0XFFFF REV: 0XFFFF)

Code: [Select]
    {
.family = FAMILY_24FJxxGBxxx,
.proto = PROTO_PIC24,
.ID_addr = 0x00FF0000,
.word_size = 2,
.page_size = 256,
.icsp_type = ICSP_LVPP,
.icsp_key = 0x4D434851,
.erase_key = { 0x3f3f, 0x8f8f },
.write_delay = 1, //polled in 24FJ
.erase_delay = 524,
},

Re: Pic24fj64gb002

Reply #1
That should work. What Bus Pirate firmware are you using? Are you using the PIC programming adapter (probably will only work without it)?
Got a question? Please ask in the forum for the fastest answers.

Re: Pic24fj64gb002

Reply #2
I'm really just guessing at everything here. ive never worked with pic before, just got my bus pirate on saturday, had to download svn software and a compiler/ide to do just that pic.c mod and i've been pouring through the 352 page datasheet for the pic24fj64gb002 and it's companion programming datasheet for hours that turn into days. Going to give it another go today and see if I can get it up and running. no i dont have the adapter I'm 99% sure this is a low voltage chip. also when setting up the flash mem why is the pic24fj64ga setup as 344*256 ? the other pic was 16*1024 which makes sense to me. btw remember i have no experience doing any of this stuff


oh and now that you mention it i did flash a test firmware someone here flashed. BPv6RC572.hex maybe i should try it again on 5.10

Re: Pic24fj64gb002

Reply #3
also is this right? no MISO connection?

Bus Pirate --> PIC
MOSI --> PGD
CLK --> PGC
CS --> VPP/MCLR
GND --> GND
3.3v/5v->power (optional)

Re: Pic24fj64gb002

Reply #4
If you receive all 1's you prolly swapped the PGC and PGD (just a guess) or make a misconnection. The pic24 has several PGC/PGD pairs IIRC but you need to use PGD and PGC from the same pair.

The trick about the 344x256 is on page 7 of the flash programming spec. It has 344 programming blocks. Each block appears as 256 bytes in the .hex, but in reality it only uses 3 bytes out of 4. This all will result in approx 64k..

Programming spec: http://ww1.microchip.com/downloads/en/D ... 39934b.pdf

Guess you are right about the miso :)

Re: Pic24fj64gb002

Reply #5
GOT IT!! either a loose breadboard con or something, I connected both MISO and MOSI to PGD just to double check lol. It came back with wrong device id, and I'm sure I just messed up the ID code myself so I changed the source to reflect what the bus pirate tells me it is
Code: [Select]
 {
.name = "24FJ64GB002",
.ID = 0x4207,
.flash = 344*256,
.eeprom = 0,
.family = FAMILY_24FJxxGBxxx,
},
if someone wants to upload this to svn go ahead.

Thanks for all the help! now i gotta figure out what my first PIC is going to be used for lol

Re: Pic24fj64gb002

Reply #6
Congrats!! Try blinking an LED if this is your first PIC. "Hello World!" of microcontrollers. Also you can get some tutorials from Microchip's web site.

For a project: What do you need in your life? For example, I'm planning to build myself an artificial sunlight alarm clock one of these days. :)

Re: Pic24fj64gb002

Reply #7
yeah I'm actually not even sure how to setup the config bits or do anything really. I've been trying to follow tutorials online, but it seems like so much work just to get talking to the chip. I have a few projects scheduled though.
nes/snes/gameboy color flash cart (should have most of the parts i need)
Genesis flash cart (because it should be super simple. genesis just had a cap, a resistor, and a memory chip)
Remote car starter with wireless temp and battery voltage measurements. with the ability to cycle the car on if voltage gets too low or it gets too cold.
replace all the brains in the roomba my dog peed on (twice)
and then wall-e here needs some animation http://dl.dropbox.com/u/7706551/IMG_20101213_163336.jpg

Re: Pic24fj64gb002

Reply #8
Nice work, thanks for the code contribution. I'm glad you got it going.
Got a question? Please ask in the forum for the fastest answers.

Re: Pic24fj64gb002

Reply #9
thanks hope it's not my last contribution

Re: Pic24fj64gb002

Reply #10
could we just use the aux pin? or can v5 and v3.3 be turned on independently on the bus pirate?


Code: [Select]
ENVREG/DISVREG and VCAP/VDDCORE pins 
(PIC24FJ devices only)
(see Section 2.4 “Voltage Regulator Pins
(ENVREG/DISVREG and VCAP/VDDCORE)”)
These pins must also be connected if they are being
2.4 Voltage Regulator Pins
(ENVREG/DISVREG and
VCAP/VDDCORE)
The on-chip voltage regulator enable/disable pin
(ENVREG or DISVREG, depending on the device
family) must always be connected directly to either a
supply voltage or to ground. The particular connection
is determined by whether or not the regulator is to be
used:
• For ENVREG, tie to VDD to enable the regulator,
or to ground to disable the regulator
• For DISVREG, tie to ground to enable the
regulator or to VDD to disable the regulator
Refer to Section 26.2 “On-Chip Voltage Regulator”
for details on connecting and using the on-chip
regulator.

Re: Pic24fj64gb002

Reply #11
Sorry, that was a reply to the wrong thread :)
Got a question? Please ask in the forum for the fastest answers.

Re: Pic24fj64gb002

Reply #12
or "not gate + or gate"?
envreg on the opposite side of the not gate from the dc power source and disvreg on the opposite side of the or gate

Re: Pic24fj64gb002

Reply #13
The supplies are tied together.
Got a question? Please ask in the forum for the fastest answers.