Flash Magic Forum

In-System Programming Support => P89V51Rx2/P89LV51Rx2 => Topic started by: phonoplug on June 27, 2006, 04:04:25 AM

Title: P89V51RD2 clocks bit programming
Post by: phonoplug on June 27, 2006, 04:04:25 AM
Hello!

Now having problems programming the clocks bit in the 89V51RD2. Everything seems to program ok (although either the erase is extremely quick or it doesnt happen though the erase box is checked), but at the end I get the message "Operation Failed. (programming clocks bit)"

I understand that the clocks bit cannot be erased through Flash Magic, which is fine, I just want it to run at double clock mode but it seems not to want to program. Any ideas why this bit only could be failing, when the rest of the programming seems to verify fine?
Title: Re: P89V51RD2 clocks bit programming
Post by: phonoplug on June 27, 2006, 05:38:38 AM
Hmmm, perhaps this is a bug in Flash Magic...?

Reading back the clocks setting using Menu --> ISP --> Read Clocks shows that the chip is actually in 6 clock mode. Philips datasheet says 12 clock mode is the default so it must have programmed the bit, yet it still says there is an error. I confirmed that the chip is in 6 clock mode by examining its behaviour with our code and its running correctly so I am thinking there is a bug in Flash Magic that beings up the Operation Failed error message??
Title: Re: P89V51RD2 clocks bit programming
Post by: Andy Ayre on June 27, 2006, 08:36:38 AM
What you are describing sounds exactly like the bug that was fixed in version 2.04. Which version are you using? Double-check by going to Help -> About.

Title: Re: P89V51RD2 clocks bit programming
Post by: phonoplug on June 27, 2006, 08:43:26 AM
I was using 3.02, and today I have updated to 3.12 but it has not made a difference :puzzled:
Title: Re: P89V51RD2 clocks bit programming
Post by: Andy Ayre on June 27, 2006, 08:49:47 AM
Hmmm...I'll give it a test and see if it resurfaced somehow.

Title: Re: P89V51RD2 clocks bit programming
Post by: Andy Ayre on June 27, 2006, 09:30:42 AM
It appears that if you attempt to program the clocks bit when it is already programmed, the baud rate the device is using immediately changes.

Because of this Flash Magic does not get confirmation that the command was received ok, so it generates the error.

From that point on no further communication with the device is possible until it is reset.

So the workaround is to not program the clocks bit if it is already programmed.

Title: Re: P89V51RD2 clocks bit programming
Post by: Andy Ayre on June 27, 2006, 09:32:00 AM
Perhaps I can make a check to not program the clocks bit if it is already set. I'll look into it.

Title: Re: P89V51RD2 clocks bit programming
Post by: phonoplug on June 27, 2006, 12:06:46 PM
Aaaah right that makes more sense now. I remembered that somewhere I read the clocks bit could not be 'unset', but not checking the option of course raises questions as to whether it will program properly!

So I know what to do at the moment, thanks. :yah:
Title: Re: P89V51RD2 clocks bit programming
Post by: Andy Ayre on June 27, 2006, 12:08:18 PM
Next non-bugfix-only release of Flash Magic will not attempt to set an already set clocks bit. No release date yet.

Title: Re: P89V51RD2 clocks bit programming
Post by: Jan Waclawek on June 28, 2006, 12:13:18 AM
Actually, this should perhaps be considered as a bug in the bootloader code (rather than FM's bug). The bootloader should check the status of clock bit before it attempts to program it + change the baudrate.

Of course, it is easier to persuade Andy to fix it in FM than Philips to fix it in the bootloader... :-)

Jan Waclawek