I've eventually manged to recover my PIC....
The issue (which I always forget about) is the PIC Configuration area gets nobbled when you ERASE the PIC.
Here's what I ended up setting it to:
So next, lets try to get the latest 3.0 Boot Loader and 3.0 Firmware from Charlie running.....
Charlie has published the sources for these in
this repository, but I'm not aware of any official binary releases.
I've not tried these before, so I had a go at building them. I needed to do some hacking to the build script, because I don't have the ihexdump program. So I used the same process that I used for the 2.x firmware (a java program I wrote called pichextobin). They do pretty much the same thing - add a header with a magic number and checksum onto the firmware file, so the AtoMMC boot loader can tell it's legitimate.
For reference, here are the boot loader and firmware files that I build:
I programmed the boot loader (atommcv3-bl.hex) onto the PIC with a Genius G540 as follows:
- Select the Microchip PIC18F4525 device
- Erase
- Load atommcv3-bl.hex into the buffer (in Intel Hex format) with unused bytes set to 0xFF
- Set the Programming sequence to be just the Program step
- Program
I then manually set up the PIC Confuration data:
- Click the Config SET button and manually change the settings to match the screen shot above then click OK
- Press the ENCR/CONF/PRTE button to actually program the config
Then we can use the normal AtoMMC firmware update process to program the firmware file (atommcv3.bin):
- Put the PIC into the AtoMMC
- Copy atommcv3.bin onto a SMALL (<1GB) FAT16 formatted SD Card and put this into the AtoMMC
- Connect to the Atom and power up
- If all goes to plan, you should get a red light and a flashing green light for about 20 seconds as the boot loader programs the firmware
- The system will restart and you should have a working AtoMMC
Out of interest, I also tried various combinations of Boot Loader and Firmware
- 2.9 Boot Loader (hoglet) + 3.0 Firmware (hoglet) - works - but IRQ and Firmware Update broken - LOAD benchmark 13.75s
- 2.9 Boot Loader (hoglet) + 3.0 Firmware (charlie) - works - but IRQ and Firmware Update broken - LOAD benchmark 8.35s
- 3.0 Boot Loader (charlie) + 3.0 Firmware (hoglet) - NOT READY error when accessing SD Card
- 3.0 Boot Loader (charlie) + 3.0 Firmware (charlie) - works - LOAD benchmark 8.35s
Sorry this is so confusing - there are two different "3.0" firmware build (my hacky one and Charlie's). Charlie's is better for this hardware as it uses the PIC's SPI harware, which is possible because MOSI and MISO are now connected to the correct pins. That gives a pretty decent speed up. The benchmark above loads a total of ~120KB of data.
I don't fully understand the reason for the NOT READY error in one of the combinations above. I suspect the 3.0 Boot Loader leaving the PIC's SPI hardware enabled and attached to the pins, which means that when my firmware tries to bit bang the using PORTC this has no effect.
Anyway, I would suggest going forward we use Charlie's 3.0 boot loader and 3.0 firmware on this hardware, and I'll keep my repository just for the older AtoMMC 2.0
Dave