Hello Mac,
You have helped me before and I am truly grateful. I have spent most of a week trying to get past clock speed setting and mass erasing FLASH.
I have found the problem with the mass erase. The FLASH block protection is not mentioned once in the monitor routines. I knew the erase was not happening because the program continued to run afterwards. I knew the code ran because I moved my I/O detect and LED output code to RAM and it completed by turning on the LED. I started to suspect some kind of protection so I searched for FLASH in the document and found it in the Memory section.
I did modify a board to use the Vtst method so I could erase it. I now can have it erase itself by grounding one of the I/O pins on POR. I plan to back up the RAM into FLASH so when the battery is replaced it will have good data afterwards. I would use the page erase and write functions. I'll be writing that later.
Yes, I'm using a non A, 908AP16. About the bus speed. I have a separate 32 kHz oscillator feeding OSC1. I used the values from the table to set the VCO and PLL for 2 MHz, top line of table. I have not measured the bus speed but will do so. My observation is the software delay loops are about half what they should be. I changed the R value from 1 to 2. It now seems to have the proper delay. This bothers me to leave it as I don't know why it didn't work by the table. I don't want a half fix that might cause a problem later like instability in the PLL.
What is the easiest way to measure the bus speed? I have instruments, I just need a signal. I thought of setting the Timebase Module and toggling an I/O pin to see if it was the correct frequency. Well that won't work. It's clock source is the OSC Module, not the PLL. OK, how about a short software loop that toggles a pin. I count the cycles to arrive at a delay time and compare to measured.
I would like to check the Mask Set Errata document. Where do I find it?
Thanks, Dave