PJRC.COM Offline Archive, February 07, 2004 Visit this page on the live site |
| ||
Shopping Cart Checkout Shipping Cost Download Website |
Home | MP3 Player | 8051 Tools | All Projects | PJRC Store | Site Map |
You are here: MP3 Player Detailed Info Fast Flash Download | Search PJRC |
|
Program Name Location Type Memory Editor (VT100) 1000 External command Fast Flash Download 1500 External command |
If your board has the original 87C52 programming, you will need to swap it with a new chip. You can order a 87C52 upgrade chip. If you have blank a 87C52 chip and an EPROM programmer capable of writing it, you can download the source code from CVS, compile it and use PM2_MP3.HEX to program your own 87C52. In most cases, we provide free upgrade chips to active developers (those who have CVS write access and are actively working on the firmware development). If you are a developer, please contact us about getting a new chip.
Rev C boards can use the fast 115200 baud download, but Rev A and Rev B boards require a small modification to receive data properly at 115200 bits/second (six times faster than the original 19200).
hex2fdl mp3player.hex > mp3player.fdl |
Fast Flash Download is easy with Linux, since the Linux kernel allows multiple processes to write to the same serial port. This simple utility can do all the work for you, regardless of which terminal emulator you use. You should run your terminal emulator as usual (minicom, seyon, etc) and follow these simple steps:
PAULMON2_MP3 Loc:02000 > Erase flash rom Erase flash rom, Are you sure? Flash rom erased PAULMON2_MP3 Loc:02000 > Fast Flash Download Begin Fast Flash Download: ................................................................................ ................................................................................ ......................... Fast Flash Download Finshed Summary: OK: No Errors Detected :) PAULMON2_MP3 Loc:02000 > |
Franck's WIN32 XMITFDL utilitiy |
Here is his message regarding the program:
It was raining last week end, so i have written a more sexy tool to fast download my firmware version rapidly to the player. I'ts working only on WIN32 platforms in graphical mode.Zac Bedell ported the xmit115200 utility to Windows on May 21, 2002. Here is the message he posted:XmitFDL is a small TTY terminal + specific tools for the PJRC MP3 player, as the Fast Download at 115 200. This is much more easy to use than the (efficient) usual xmit command line. WIN32 platforms only.
VB Sources have been posted in the file section.
I've uploaded binaries & source for doing the new fast firmware upload on Windows machines.One is built w/ CygWin, and requires all the various Cygnus runtime installed to work -- perfect for the developers out there. This version is directly based on Paul's xmit115200.c, and should work as a direct drop-in replacement for Paul's version. The binary defaults to COM1 (/dev/ttyS0), and takes the FDL file as its standard input. If you need a different COM port with this version, you'll have to build it yourself.
The other ZIP is built w/ Visual C++, and should require only Microsoft C Runtime to function. It is built w/ Visual Studio .NET, so you might need to get the latest CRT, but I don't think so. This version is written from scratch with native Win32 API calls, and it behaves a little differently from Paul's version as it does a Z flash erase before starting the upload. This version can take the FDL info on stdin just like Paul's, but it can also take a filename on the command line. You can also specify the COM port on the command line.
Some valid usage examples of the VC version:
xmit115200_VC COM1 mp3player.fdl
xmit115200_VC COM2 < mp3player.fdl
hex2fdl | xmit115200_VC COM4
xmit115200_VC < mp3player.fdl
hex2fdl | xmit115200_VC
Of course, both of these versions will require you to disconnect any terminal software you're debugging with before you can use them. If anyone wants to write macros for TerraTerm or SecureCRT to disconnect, run the upload, then reconnect; that'd be nifty?
Let me know if anyone has major problems using these. You'll of course need a new 87C52 from Paul and a Rev C or modified Rev A/B board AND A GOOD SERIAL CABLE ;-) for this to work. I've tested it w/ a Rev B board on a P-4 running WinXP, for what it's worth.
Bytes received are written into consecutive locations of the flash rom. No flow control is used. The fast flash download can receive data and commands at a sustained rate of 115200 baud! The one exception is a brief delay required between the baud rate change command and transmission of data at the new baud rate. A sequence of waits and delays are implemented on the MP3 player at the end of the transfer to allow time for the PC to gracefully return to 19200 baud after it has transmitted all of the data. These waits/delays also allow the MP3 player to "swallow" extra data after an abort or error and still allow a graceful return to 19200 baud even when the PC is unaware that an error occurred that caused the transfer to abort.
Eleven bytes are reserved for embedded commands, where two of those commands are used to encode those 11 bytes when they occur within the firmware image. Some commands have 1 to 3 additional data bytes. Bytes following a command always have their most significant bit set (values 128 to 255). Any byte without its MSB set causes its command to be treated as an Abort Transfer command.
At the end of a transfer, initiated by either the End Of Transfer command or the Abort Transfers commands, the following sequence is followed by the MP3 player:
The checksum is implemented with a 16 bit register that is initially zero, and it changed with addition and exclusive OR operations as data and certain commands are received. A checksum command causes 14 bits to be compared to 14 of the 16 bits in the checksum register, and the register is then reset to zero.
The checksum is updated in the following events:
The first modification is to replace the 1N4007 diode near the FPGA chip with a 1N4148. The 1N4148 is installed in the same polarity as the original diode. It is important to disconnect the serial cable before the 1N4007 is removed, as it protects the input of a 2N3904 transistor.
Rev A&B Mod #1: Replace 1N4007 Diode With 1N4148 |
Other "small signal" diodes will probably also work, though only the 1N4148 has been tested. The original 1N4007 diode has a slow reverse recovery time, which causes no trouble at 19200, but it is not fast enough for 115200 baud and must be replaced.
The second modification is to add a 1K "pullup" resistor, connected to the RXD pin on the 87C52 and +3.3 volts. This figure shows where to solder this resistor:
Rev A&B Mod #2: Add 1K Pullup Resistor To RXD Pin |
The 1K pullup is needed to make the 2N3904 transistor recover from "saturation" so that 0's aren't stretched. The effect of the 2N3904 saturation is minimal at 19200, but significant at 115200.
With these two simple mods, and of course a chip swap of the 87C52, the rev A and B boards can use the new fast flash download, which is able to download the entire firmware in approx 7 seconds!