Sunteți pe pagina 1din 5

06/07/13

Using PicKit 2 to program serial flash via SPI

Welcome !

Enter Search Phrase

All Forums >> [Development Tools] >> Programmers (MPLAB PM3, PICSTART Plus, PICkit 2, PICkit 3) Forum Menu Photo Galleries Log in Registration / Sign up

RSS Feed

Thread Options

Using PicKit 2 to program serial flash via SPI A uthor

<< Prev Thread | Next Thread >>


Message

mendelbullex
New Member

Using PicKit 2 to program serial flash via SPI Friday, January 27, 2012 8:42 AM (permalink)

I am currently looking into a way to program a serial SPI flash chip. We have a header available on our board, and have a PICKit 2 which we have used for other purposes. It looks to me like it is possible to program a serial flash via SPI using the PICKit 2, but I am not seeing that this has been done anywhere. Has anyone done this, and if so
Total Posts : 6 Reward points : 0 Joined: 1/27/2012 Location: 0 Status: offline

how?

Note: I have found that using the pickit 2 for SPI requires a special pin setup

pin 1: CS pin 2: Vdd pin 3: GND pin 4: MISO pin 5: SCK pin 6: MOSI

#1

MBedder
Super Member

Re:Using PicKit 2 to program serial flash via SPI Friday, January 27, 2012 9:13 AM (permalink)

PICkit2 does natively support serial EEPROM

www.microchip.com/forums/m629895.aspx

1/5

06/07/13

Using PicKit 2 to program serial flash via SPI

programming. You can use the PICkit2 standalone GUI application and/or the console PICkit2CMD application to do this.

How To Ask Questions The Smart Way


Total Posts : 5055 Reward points : 0 Joined: 5/30/2008 Location: Zelenograd, Russia Status: offline

#2

mendelbullex
New Member

Re:Using PicKit 2 to program serial flash via SPI Wednesday, February 01, 2012 7:54 AM (permalink)

I looked into the serial options provided, and tried using the system as if my chip were a 25 series EEPROM, since they use 3-wire SPI. Unfortunately this does not appear to be working. First of all, when I start up the PICKit 2 software, I immediately get an error message saying "PICKit 2 VPP voltage level error, check target or retry operation."
Total Posts : 6 Reward points : 0 Joined: 1/27/2012 Location: 0 Status: offline

Then once I go in and select the device type, it says that it can read/write, and erase fine. But when I erase it the chip says it is all FFs, then when I read it I get all 00s. When I changed a single byte and tried to write, I got an error at that byte.

The flash chip I am currently working with is: SST25VF016B-50-4CS2AF.

On top of this there will also be an error with memory size, as my flash chip has much more memory then the highest 25 series EEPROM. I am wondering A. am I doing something wrong/ should I be able to program this using the 25 series EEPROM device settings? and B. if not is there a way to define my own device, or use the software without a defined device? The opcodes for programming are all the same for the 25 series EEPROM, the only main difference is the memory size.

If I cannot use the PICKit 2 software, does anyone have a


www.microchip.com/forums/m629895.aspx 2/5

06/07/13

Using PicKit 2 to program serial flash via SPI

suggestion of other software I can use with the PICKit 2 in order to program this flash?

Thanks, -Mendelbullex

#3

mendelbullex
New Member

Re:Using PicKit 2 to program serial flash via SPI Wednesday, February 01, 2012 8:27 AM (permalink)

Just realized that the 25 series EEPROM is a 3wire SPI device, and I need to use 4-wire with my flash chip. Does anyone know how to do this using the PICKit 2?

Thanks,
Total Posts : 6 Reward points : 0 Joined: 1/27/2012 Location: 0 Status: offline

-Mendelbullex

#4

Ninestone
Super Member

Re:Using PicKit 2 to program serial flash via SPI Wednesday, February 01, 2012 10:45 AM (permalink)

"PICKit 2 VPP voltage level error" - you will get this error with an EEPROM because they are not auto-detectable devices. Instead 1) open pickit 2 software and select the proper device family then 2) connect pickit 2 to your device. "am I doing something wrong/ should I be able to program this using the 25 series EEPROM device settings?" - pickit
Total Posts : 455 Reward points : 0 Joined: 2/17/2008 Location: 0 Status: offline

2 only supports the Microchip 25LC EEPROM series. If you can verify that all the opcodes, programming sequences, block sizes, register bits, and very importantly programming timings are the same, it might be possible to use with a different part. "if not is there a way MPLAB X IDE or use the software without a defined to define my own device, MPLAB IDE device?" - There is8an editor for the pickit2 device file available on MPLAB REAL ICE these forums. If you can verify everything noted above is the same, you can define MPLAB a new Simulator device that is a copy of a 25LC with a memory size correct MPLAB for your part. Otherwise, you could still use it to define ICD In Circuit Debuggers

www.microchip.com/forums/m629895.aspx

3/5

06/07/13

Using PicKit 2 to program serial flash via SPI

a new part MPLAB with edited XC8 scripts for any timing or other changes for the flash part. 3-wire vs 4-wire - I'm not sure what you are MPLAB XC16 referring to MPLAB here. Both XC32devices use 4 SPI signals (CS, SCK, SDI, SDO) MPLAB C18 Compiler MPLAB C30 Compiler, ASM30, Link30 forum MPLAB C32 Compiler #5

mendelbullex
New Member

Re:Using PicKit 2 to program serial flash via SPI Friday, February 10, 2012 6:55 AM (permalink) MPASM, MPLINK, MPLIB (assembler, linker, librarian)

HI-TECH C Compilers

Visual I tired to use the Device deviceInitializer editor and I have been having difficulties. Evaluation I posted and Demonstration on the editor Boards thread, but thoughtEmulators I would post here as well. I tried (MPLAB ICE 2000, MPLAB ICE 4000) using the 25LC640T in Source the device editor to make a device for my Linux, Open Projects and Other Topics SST25VF016B-50-4C-S2AF. I have been getting some issues with it MATLAB since. First of all, when I select the device file, the PICKit 2 GUI CML
Total Posts : 6 Reward points : 0 Joined: 1/27/2012 Location: 0 Status: offline

goes into an unresponsive Tips and Tricks state for a little while. After it finally starts working, I tried reading. Sometimes it freezes, and other Other Development Tool Topics times it reads all 00s despite the fact that I am sure there is FAQs something other than 00s written. Can someone help me figure out MPLAB X Alpha Trial what I am doing wrong? Microstick Development Board for dsPIC33F & PIC24H Here are the changes I made: ProgramMem: 0x001E8480(2000000) VddMin: 2.7 VddMax:3.6 VddErase:2.7 ProgMemWrScript: 210 ProgMemWrWords:0x0001 (1)

Thanks for any help guys -Mendelbullex

#6
Online Bookmarks Sharing:

All Forums >> [Development Tools] >> Programmers (MPLAB PM3, PICSTART Plus, PICkit 2, PICkit 3)
Jump to:

- - - - Programmers (MPLAB PM3, PICSTART Plus, PICkit 2, PICkit 3)

www.microchip.com/forums/m629895.aspx

4/5

06/07/13

Using PicKit 2 to program serial flash via SPI

Current active users


There are 0 members and 1 guests.

Icon Legend and Permission


New Messages No New Messages Hot Topic w/ New Messages Hot Topic w/o New Messages Locked w/ New Messages Locked w/o New Messages Read Message Post New Thread Reply to message Post New Poll Submit Vote Post reward post Delete my own posts Delete my own threads Rate post

2000-2013 ASPPlayground.NET Forum Commercial Version 3.9

Products

Applications

De sign Support C ontact Us

Training

Sam ple & Buy

About Us

C opyright 1998-2012 Microchip Te chnology Inc. All rights re se rve d. Shanghai IC P R e crdal No.09049794

www.microchip.com/forums/m629895.aspx

5/5

S-ar putea să vă placă și