P89V51RD2 clocks bit programming

Started by phonoplug, June 27, 2006, 04:04:25 AM

Previous topic - Next topic

phonoplug

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?

phonoplug

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??

Andy Ayre

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.

Embedded Systems Academy, Inc.
support at esacademy dot com

phonoplug

I was using 3.02, and today I have updated to 3.12 but it has not made a difference :puzzled:

Andy Ayre

Hmmm...I'll give it a test and see if it resurfaced somehow.

Embedded Systems Academy, Inc.
support at esacademy dot com

Andy Ayre

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.

Embedded Systems Academy, Inc.
support at esacademy dot com

Andy Ayre

Perhaps I can make a check to not program the clocks bit if it is already set. I'll look into it.

Embedded Systems Academy, Inc.
support at esacademy dot com

phonoplug

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:

Andy Ayre

Next non-bugfix-only release of Flash Magic will not attempt to set an already set clocks bit. No release date yet.

Embedded Systems Academy, Inc.
support at esacademy dot com

Jan Waclawek

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