Whew, I thought I broke it.
My PICKit™ 1 Flash Starter Kit came yesterday, and after I got off work I started playing with it. First thing I did was plug it in and said, “Oooo! Look at the sequentially flashing LEDs! And the potentiometer on the board changes the speed! And the button changes the direction!”
Since none of the development software that comes with it runs on the Mac, I fired up MacrocASM, read the chip, and saved the hex file so I could put it back. Then I erased the chip and tried to re-load my saved hex file.
No flashing LEDs. What did I do wrong?
The next few hours were spent trying to figure that out. I even pulled the hex file of the pre-loaded LED flasher off the PICkit CD, and it still wouldn’t run after loading. I tried MicroChip’s unsupported programmer app for Mac OS X, still no go. The chip wouldn’t verify. Uh oh. I broke it.
Finally, Google showed me the way. I found a Linux command-line programmer utility called usb_pickit. The author thoughtfully included a pre-compiled binary for OS X, and even a little test program to write to your chip.
I downloaded the program, then fired up Terminal. I ran the OS X binary (usb_pickit.OS_X) and wrote the little test.hex file. Ta da! Flashing LEDs. Not the same flashing LEDs as before, but at least I know I didn’t kill my board.
I still haven’t gotten the original demo to re-load, but that’s okay. I’m going to move on to trying to write some code and see what I can do. Unfortunately, the documentation for MacrocASM is a little thin. Most of the MPASM compiler macros and directives don’t work, so a lot of the programs you can find online won’t even compile. I have not yet figured out how to convert them to MacrocASM — the compiler preprocessor doesn’t seem to be implemented (at least it’s not in the docs, except for a stub), and MPASM macros like BANKSEL aren’t there at all.
I just want to write my own LED flasher. I’ll keep you posted.