Ah, I understand. Thanks.
Not sure if I should create a new thread for this or not, but I figured I'd try this first...
The illegal BP does not occur anymore, but it also looks like no data is actually being written. I wrote a little test program that writes a message to PPAGE 1 and then reads it back. Trouble is, it doesn't look like I'm actually writing any data to the flash array. PPAGE and ROMON are at the correct values but when I check the memory location using the debugger, it's showing all FFs.
I have found something about block protect bits that need to be cleared in the document AN2166 but I can't find which register those bits are actually in. The closest I can find are the FPOPEN and BOOTP bits. FPOPEN is set, so it seems that the whole Flash array should be enabled for program/erase and I'm not writing to the sections that BOOTP protects (I am writing to $8000 on PPAGE 1).
Anybody have any guesses as to what I'm missing?
Thanks!