Summary of my understanding of ISP/ICP...

Started by Apatbol, May 14, 2012, 03:39:46 PM

Previous topic - Next topic

Apatbol

Dear All,

I'm currently making some circuits with 89LPC922 (these µC are completly new for me...).
For some of them, I can programm them via ISP once... then, no way to reprogram them..

As I have about 50 circuits to make, I try to understand why I am burning time and µC (meaning money)...

Hereafter is a summary of my understanding of ISP, and potential ICP solution to recover my 12 already burnt µC... (and not burn the following ones !).

According to the Datasheet of the LPC922, there is 3 ways to flash the µC:

Parrallel programming : Programmed or erased using the parallel method by using an EPROM programmer which supports the device.

ISP programming : Depending on the Boot Status Bit, after a reset, the execution jump to a bootloader (located at the Boot Vector).
This BootLoader (sort of small program) allow to write or erase in the memory of the µC. This boot loader is pre-programmed at the factory into the BootVector address (located in 1FH) and can be erased by the user. There is the possibility in Flashmagic to protect the chip against the erasure of this bootloader (at this point, my problems started... :-\).
The ISP function uses five pins (VDD, VSS, TXD, RXD, and RST).
To enter the ISP mode (= put BootStatus Bit at 1), 2 possibilities:
  - Pulses on RST entry (3 pulses method)
  - Break detect (7 pulses method)

ICP programming : It is a bit similar to ISP, but in this case we do not rely on a bootloader, but on a hardware function implemented in the µC. So whatever has been done with ISP, ICP should allow to recover (it is a kind of idiotproof mode..  ;D).
The used pins are : P0.4/PDA programming Data pin, P0.5/PCL programming clock pin, P1.5/RST ICP mode entry pin, VDD needed for ICP mode entry, VSS.

The solution ?

I have bought a nice USB-dongle from FDITeam (which does not work with W7-64 bits... obliged to re-install an old WinXP... :'().

According to what is written just above, I should be capable to enter ICP mode to reprogram the bootloader, the adress of the bootloader (BootVector, at adress 1FH), and also the program I want to flash...


My questions:
- Is my summary/reasonning correct (I hope it can help some other people...)
- Where can I find a bootloader ? (the hex file)

Some additions as  soon as I have reinstalled XP and tried the ICP mode with USB-Dongle !

Regards

Apatbol...





Andy Ayre

Assuming you have not erased the bootloader, then your symptoms of only being able to program once are a classic sign that you are failing to put the device into programming mode.

A brand new device has the status bit set! This means it will always reset into ISP mode. Once you have programmed it Flash Magic will clear the status bit. Now, it is your job to ensure the conditions are met to put the device back into ISP mode for further programming.

Check the three pulses you are sending with a scope.

Also FDI will provide technical support for their interface if you wish to use ICP instead.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

Andy Ayre

Also the break detect feature has to be enabled in your code. If you didn't do that or your code has a bug and doesn't execute as far as the point where break detect ISP entry is enabled, then it won't work. This leaves you with only the three pulse method for ISP.

Note that break detect is not pulses but a low on the UART Rx pin for more than 2 character periods.
Embedded Systems Academy, Inc.
support at esacademy dot com

Apatbol

Hello !

Thanks for the quick answer !

According to all the documentation I have read, I fully agree with you.
I will check the 3 pulses (When I come back home, on trip currently !), but my first feeling is that should be OK, because I can reprogram some of my devices (and response OK to the command "StartBootloader" for these devices).


I have checked nearly everything on the programmer (voltage, connexions, etc...) and the actions decribed in "Flash Magic Application Note 4 - What to do if ISP Does Not Work" (timings T1 and T2,...).

I am not so concerned about the re-programming of the devices (The pins necessary for ICP have been let "free", so I can do it easily.. the longer thing is to re-install Win XP for the fdi programmer !!!).

I am a bit concerned to understand why some devices are gone and other not (I do not remember having changed settings in the configuration of Flashmagic".


Thanks !

Apatbol




Andy Ayre

If some devices can be reprogrammed and others cannot, then something is marginal. Either timing issues with the pulses or electrically with rise times of the signals or noise. It could even be down to bad solder joints!

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com

Apatbol

Hello !

It is not the solder joints... It is the 1st thing I have checked (<0,1 Ohm for each solder joint).

I will have a (precise) look on the pulses... and also (re)check the settings in Flashmagic.

Suspense, suspense !!!

Regards

Apatbol

Apatbol

Hello !

Pulses were OK, but still I have doubts on the programmer.

I have used the FDI programmer, and thinks are fine now...

Thanks to FDI team for their cheap and useful programmer, and also to the flashmagic team for their software (and forum support !).

Regards

Apatbol