Flash Magic Forum

In-System Programming Support => P89C51Rx+/P89C51Rx2/P89C66x/P89C6xX2/P89V66x => Topic started by: Alex on May 23, 2005, 10:53:08 AM

Title: P89C51RD2BN ISP code
Post by: Alex on May 23, 2005, 10:53:08 AM
In my project I need to include programming code for the MCU in my main program. So I want to write my own code to program the MCU. Iread the AN461 document and tried its control words. But only thing that worked right it's sending 'U' to MCU and getting it back. Other control words didn't work.

can anyone give me a working code that contains control words?
and how do I calculate the checksum?

hope for fast reply

alex
Title: Re: P89C51RD2BN ISP code
Post by: erikm on May 23, 2005, 10:55:36 AM
So I want to write my own code to program the MCU.
why? FlashMagic is free and works


can anyone give me a working code that contains control words?
what is a "control word"  AN-461 is about calling sequences.

Erik
Title: Re: P89C51RD2BN ISP code
Post by: Andy Ayre on May 23, 2005, 10:55:54 AM
How about calling the command line version of Flash Magic? You can do that from your own program and parse the output very easily.

Title: Re: P89C51RD2BN ISP code
Post by: Alex on May 23, 2005, 08:31:03 PM
In some cases the MCU doesn't enter the ISP mode and in some does and I can't understand the difference between the cases. In my understanding if it enters one time so it should enter every time. In my case I have to reset the MCU several times before it enters the ISP mode.

and how do I calculate CheckSum that should come in the end of the sequence?

alex
Title: Re: P89C51RD2BN ISP code
Post by: Andy Ayre on May 23, 2005, 08:35:33 PM
Here is the specification for the Intel Hex File Format:

http://www.precma.it/download/intelhex.pdf

There are lots of reasons why the device cannot reliably enter ISP mode. The baud rate is too high or too low for a given crystal frequency, the hardware conditions for entering ISP mode are not being satisfied fully, etc.

Title: Re: P89C51RD2BN ISP code
Post by: Alex on May 23, 2005, 08:39:05 PM
what voltage do i put in Vpp pin?