Flash Magic Forum

Archive => Old Topics => Topic started by: sdolan on June 15, 2004, 08:40:56 PM

Title: P89C668 ISP
Post by: sdolan on June 15, 2004, 08:40:56 PM
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?
Title: Re: P89C668 ISP
Post by: Andy Ayre on June 16, 2004, 08:34:11 AM
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.

Title: Re: P89C668 ISP
Post by: Scott Dolan on June 16, 2004, 11:46:54 AM
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
Title: Re: P89C668 ISP
Post by: Andy Ayre on June 16, 2004, 11:53:26 AM
Connect it directly to VCC.

Title: Re: P89C668 ISP
Post by: Rons on June 17, 2004, 01:09:48 PM
An electrical engineer would tell you that this is wrong. Use a 4.7K resistor
to +5.
Title: Re: P89C668 ISP
Post by: Andy Ayre on June 17, 2004, 01:24:34 PM
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.

Title: Re: P89C668 ISP
Post by: erikm on June 18, 2004, 06:33:00 AM
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
Title: Re: P89C668 ISP
Post by: Tom on July 13, 2004, 01:52:09 AM
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?
Title: Re: P89C668 ISP
Post by: erikm on July 13, 2004, 05:20:51 AM
>>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
Title: Re: P89C668 ISP
Post by: Andy Ayre on July 13, 2004, 08:40:14 AM
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.

Title: Re: P89C668 ISP
Post by: Tom on July 13, 2004, 10:43:43 AM
>>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.
Title: Re: P89C668 ISP
Post by: Andy Ayre on July 13, 2004, 11:49:07 AM
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.

Title: Re: P89C668 ISP
Post by: Rons on July 16, 2004, 11:08:05 AM
Applications engineer from philips suggested this for safety. Been using
a 4.7k pullup for about a year now,  no problems. Very useful.