Main Menu

P89C668 ISP

Started by sdolan, June 15, 2004, 08:40:56 PM

Previous topic - Next topic

sdolan

I have a new design that uses P89C668. I want the capablitiy to program my device with FlashMagic.   Right now, my design provides RST, PSEN, TXD, RXD,  VCC, and GND to a 6pin header. This header will than connect to a custom cable that will have a RS232 transceiver, along with the other circuity describe in Application note 1 Figure 1.   However, I am assuming that the states of  P2.6, P2.7, ALE, and EA, are no longer relevant to enter ISP mode. Is this true?

Andy Ayre

You need to make sure that P2.6, P2.6, ALE and EA are set according to the requirements in the datasheet for ISP entry.  If you don't then your device won't enter ISP mode properly.

Embedded Systems Academy, Inc.
support at esacademy dot com

Scott Dolan

How do you recommend connecting EA pin for normall operation.  

     1. Should i connect EA pin +5.0V
     2. Should i connect EA pin to a cap and +5.0V to the other side of the cap.
   3. Should EA pin be connect to +5.0V and a cap that is also connected to ground

Andy Ayre

Connect it directly to VCC.

Embedded Systems Academy, Inc.
support at esacademy dot com

Rons

An electrical engineer would tell you that this is wrong. Use a 4.7K resistor
to +5.

Andy Ayre

Rons wrote:

> An electrical engineer would tell you that this is wrong. Use a
> 4.7K resistor
> to +5.

Please refer to the "In-System Programming with a Minimum of Pins" diagram in the datasheet, where /EA/VPP is connected directly to +5V and is actually +12V tolerant. This pin is used for the programming voltage.

Also refer to the "ICC Test Condition, Active Mode" circuit diagram in the datasheet.

Also refer to the "Absolute Maximum Ratings" table in the datasheet where it states that the voltage on /EA can be in the range 0V to +13V.

Also refer to the "Hardware Activation of the Boot Loader" section of the datasheet where it states that "/EA [should have a voltage] greater than VIH (such as +5V)".

Also refer to the minimal circuit diagram in Philips Application Note AN461, which applies to this device.

Embedded Systems Academy, Inc.
support at esacademy dot com

erikm

An electrical engineer would tell you that this is wrong. Use a 4.7K resistor to +5
Absolutely right if the name were !EA.  However the name is !EA/Vpp and to supply programming power through a 4k7 is not very useful.

Erik

Tom

In Flash Magic demo the "StartBootROMDemo" algorithm for programming "boot vector" and "status byte" includes also previous erasing.

In the documents " backdoor.doc" and "notouch.doc" previous erasing is not foreseeing.

So is previous erasing necessary or not if I wont to recover boot vector?

In the "P89C669 USER MANUAL" nowhere is mention that P2.6 & P2.7 must be in any particular state for ISP. Can you give me more information about that?

erikm

>>In the documents " backdoor.doc" and "notouch.doc" previous erasing is not foreseeing.<<

ALL AND ONLY what NoTouch and the backdoor does is to bring you to be in ISP mode.  What you are asking for is what you do with FlashMagic  in ISP mode.

Erik

Andy Ayre

Tom, are you using the 668 or the 669? This thread is about the 668, but you mentioned the 669 - which is a completely different device.
The 669 does not need P2.6 and P2.7 in any particular state as far as I know.

Embedded Systems Academy, Inc.
support at esacademy dot com

Tom

>>Tom, are you using the 668 or the 669? This thread is about the 668<<

Sorry I have 669, and I must excuse myself; maybe I was not clear with the question.

Case A: --------------------
In the " StartBootROMDemo" demo SW, transition to ISP is described:
(1) ---> iap_erase_boot_vector_status_byte();
(2) ---> iap_program_boot_vector(0xFC);
(3) ---> iap_program_status_byte(0xFF);
--------------------

Case B: --------------------
In the "backdoor" document transition to ISP is described:
mov  AUXR1,#020h  ;enable boot
(2) ---> Set boot vector    
call 0fff0h
(3) ---> Set status byte
call 0fff0h
--------------------

As you can see in Case A:
- Before programming the "boot vector" and "status byte" erasing is implemented.

In Case B:
Programming the "boot vector" (2) and "status byte" (3) go on directly without previous erasing (1).

Is erasing before programming necessary or not?

Respectively
- is erasing in Case A just to show the way, how to access the function
- or erasing is missing in Case B.

Sorry for my annoying question, but at that moment I have only one sample chip (no possibility for too many testing and losing ISP possibility).

Thank you for the reply.
Best regards.

Andy Ayre

On the 662/664/668 the Boot Vector and Status Byte are erased to 00H. This means that you can program these locations and set bits, but you cannot program and unset bits.

If the Boot Vector is the default, then you can program the default value into that location all you want without needing to erase, because you are not changing the bits.

If the Status Byte is 00H then you can program it to 01H or FFH without having to erase it, because you are not unsetting any bits.

Therefore it is possible to program the Boot Vector to the default and the status byte to FFH without having to erase, assuming the Boot Vector is already at the default.

HOWEVER, the 669 is an MX core device and I don't know if the Boot Vector and Status Byte erase to 00H or if it is the opposite way around and they erase to FFH. In all our code and in the Flash Magic source code, we always perform the erase first so we don't need to worry about such things.

Embedded Systems Academy, Inc.
support at esacademy dot com

Rons

Applications engineer from philips suggested this for safety. Been using
a 4.7k pullup for about a year now,  no problems. Very useful.