supposed to work???
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)
{
.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,
},
That should work. What Bus Pirate firmware are you using? Are you using the PIC programming adapter (probably will only work without it)?
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
also is this right? no MISO connection?
Bus Pirate --> PIC
MOSI --> PGD
CLK --> PGC
CS --> VPP/MCLR
GND --> GND
3.3v/5v->power (optional)
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 (http://ww1.microchip.com/downloads/en/DeviceDoc/39934b.pdf)
Guess you are right about the miso :)
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
{
.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
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. :)
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 (http://http://dl.dropbox.com/u/7706551/IMG_20101213_163336.jpg)
Nice work, thanks for the code contribution. I'm glad you got it going.
thanks hope it's not my last contribution
could we just use the aux pin? or can v5 and v3.3 be turned on independently on the bus pirate?
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.
Sorry, that was a reply to the wrong thread :)
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
The supplies are tied together.
you could always get a pickit http://shop.ebay.com/?_from=R40&_trksid ... Categories (http://shop.ebay.com/?_from=R40&_trksid=p5197.m570.l1313&_nkw=pickit&_sacat=See-All-Categories)
i only spent 20 on mine
[quote author="sqkybeaver"]
you could always get a pickit http://shop.ebay.com/?_from=R40&_trksid ... Categories (http://shop.ebay.com/?_from=R40&_trksid=p5197.m570.l1313&_nkw=pickit&_sacat=See-All-Categories)
i only spent 20 on mine
[/quote]
That would be cheating. If you would reflash the pickit2/3 with buspirate firmware on the contrary...
it would be nice to be able to rescue a bad pickit update
i wonder if a simple bp firmware would work in a pikit2? have only used mine on pics so far.
[quote author="sqkybeaver"]
you could always get a pickit http://shop.ebay.com/?_from=R40&_trksid ... Categories (http://shop.ebay.com/?_from=R40&_trksid=p5197.m570.l1313&_nkw=pickit&_sacat=See-All-Categories)
i only spent 20 on mine
[/quote]
I think for this chip i would have needed a pickit 3. cheapest i've seen for a genuine one of those was more than $30 + S&H
I'm very cash limited (see poor in the dictionary :P ) so i bought a bus pirate instead since it would be multifunction
mine was in a kit form. bare pcb no case. i don't know if it is worth building our own clone, probably could be done a little cheaper.
[quote author="sqkybeaver"]
mine was in a kit form. bare pcb no case. i don't know if it is worth building our own clone, probably could be done a little cheaper.
[/quote]
is there anything a pickit clone can do that a bus pirate cant? or bus pirate + hvp adapter for those chips
i am unaware if the buss pirate can debug pics, as i use that feature often.
if your only programing sure the bp would be fine.
[quote author="sirus"]
I think for this chip i would have needed a pickit 3. cheapest i've seen for a genuine one of those was more than $30 + S&H
I'm very cash limited (see poor in the dictionary :P ) so i bought a bus pirate instead since it would be multifunction
[/quote]
Pickit2 can program PIC24/dsPIC33 families. Only PIC32 family is not supported as I know.
Bus Pirate PIC programming support it just emerging, so I would say the PICkit2 will do one thing the Bus Pirate cannot: program PICs ;)
... also, the Bus Pirate is slower at this than a dedicated programmer. If you already have the Bus Pirate, are strapped for cash, and have time to spare, then it's no problem. But if you're looking at buying something and will be focused on PIC development, then the PICkit is probably a faster, more reliable choice. It all depends upon what you're doing and how frequently. I have a whole handful of programmers because they can break, and I never want to be stuck without a working one. In that respect, the Bus Pirate makes a great backup tool in a pinch (for just about any task, not just programming).
maybe we could eventually work our way to simple debug if it will fit in firmware. maybe the pickit3 would be a better choice to look at, i am waiting for microchips firmware to mature for it.
[quote author="tayken"]
Pickit2 can program PIC24/dsPIC33 families. Only PIC32 family is not supported as I know.
[/quote]
PICkit2 supports programming the PIC32 family - you need to use the standalone PICkit2 software (not MPLAB).
i did not know it will program some chips it will not debug!
at least it was cheaper than my Silabs debugger.
[quote author="ian"]
Bus Pirate PIC programming support it just emerging, so I would say the PICkit2 will do one thing the Bus Pirate cannot: program PICs ;)
[/quote]
Pffft details details .... ;)
let's get that fixed lol
Patch created with
svn diff --diff-cmd diff -x "-i -b" > 24FJ64GB002
should be able to apply with
patch -p0 < 24FJ64GB002
not sure though never actually made one of these before. only applied them