Main Menu

89V51Security Bit.

Started by Harshadbhai Ukani, August 30, 2004, 08:56:05 PM

Previous topic - Next topic

Harshadbhai Ukani

Dear Andy,

I was forced to use 89V51rd2 due to availibity problem, in place of 89C51rd2.

I am using flash magic to proramm the Micro.
If I set the security bit. I am not able to reload the programme. Is there any way?

I have tried 1) RESTIING the Serial no. and 2) Erase block 0, but no recovery.

Please help

-Harshadbhai


Andy Ayre

I believe that selecting "erase all flash" in section 2 of the main window should erase the security bit.

Embedded Systems Academy, Inc.
support at esacademy dot com

lambros sirivlis

1)reset serial number.
2)erase all flash.
3)program again .
the security bit will not be erased but the chip will be programmed.
(use flash magic 2.01 or later)

Lambros Sirivlis

Andy Ayre

I was wrong - the security bit cannot be erased via ISP once programmed, and Flash Magic even warns you of this. Some more information:

1. The security bit has no effect on ISP operations. It only blocks parallel programmer operations.

2. Setting the serial number AND resetting the device will stop ISP from working.

3. To use the device in ISP mode again, the serial number must be reset (which will erase the device) or the unlock feature must be used by supplying the serial number.

Embedded Systems Academy, Inc.
support at esacademy dot com

Harshadbhai Ukani


Dear Andy,

Thanks,

It was a problem of using earlier version of Flash, Which prohibits reading, reprogramming of the device if security bit is SET. But with version 2.05 upward there is no problem with re-programming.

Now the problem is of selective erase of sectors/pages. As Flash magic is supporting it there should be ISP / IAP routines for this. But data sheet is giving any details. Will you please give the details?.

I feel that Phillips should stop reading the Flash if security bit is set, All other function (Erase / Reprogramme) should work. This will give more security to Code.

-Harshadbhai Ukani.

Andy Ayre

You can achieve full security but setting the password (along with the security bit). Someone else will only be able to reset the password, which will cause the device to be erased.

Embedded Systems Academy, Inc.
support at esacademy dot com

Harshadbhai Ukani

Dear Andy,

The problem is any password is succeptible for Crack/Theft, and if some one has the password he can read the Flash Code even if the security bit is Set.

I fail to understand the Purpose of allowing reading of the Code data through ISP even if the security bit is set.

Will you please give me details for selective erase of pages?. It is working in Flash Magic that means there is ISP for the same.

-Harshadbhai Ukani.

Andy Ayre

Page erase:

:0300000308aaaacc

aaaa = page address
cc = checksum

Embedded Systems Academy, Inc.
support at esacademy dot com

Harshadbhai Ukani

Thanks Andy,

I wanted Page erase by IAP as I have to store some data into flash(Default Parameter which very from installation to installation).

If you can have it from phillips, please pass on to me.

-Harshadbhai

erikm

I wanted Page erase by IAP

It is there, pay attention the page is 64k (all of it)

Erik

Harshadbhai Ukani

Dear Erik,

Sorry I wanted sector erase. The default parameters are 256 byte, a sector of 512 bytes is good enough. Erasing whole page is of no use once the application is running at customer's place.

-Harshadbhai

erikm

Sorry I wanted sector erase. The default parameters are 256 byte, a sector of 512 bytes is good enough. Erasing whole page is of no use once the application is running at customer's place.

This is FLASH!!!!!!!

Erik

S.Poduval

Dear Harshadbhai,


  You can erase any sector of 128 bytes.  
 
  Set DPH and DPL for the add. locs to be erased.  Make sure that bits 0-6   of DPL are zeroes.
 
  Clear bit 1 of FCF register (B1H). ( This has to be done once only after reset).

  Clear BSEL bit .  As mentioned in the data sheet ,avoid clearing BSEL bit  when the user program is operating in the range 0000-1FFFH.

  Set R1 = 08H

  Call PGM_MTP at 1FF0H

  Set BSEL bit.


S.Poduval.


Harshadbhai Ukani


Dear Erik,

What do you mean by this is Flash !!!!!.

Yes this is flash and that is why we can think of erasing a sector.

-Harshadbhai


Dear S. Poduval,

Thank you very much. I was debugging the upper block and I felt that for page erase before calling PGM_MTP DPL shall have higher address and ACC should have Lower address. I have missed that for record 3 SS is higher address data is only lower address for function code 8.

Thanks a lot once again
-Harshadbhai

;
;Record no. 3
L01BC:
        JNB     008H,L014C
        ACALL   L01B8           ;Clear bit 0 to bit 7
        MOV        DPTR,#L0000
        MOV        R1,#080H
        MOV      037H,@R1        ;Sub Function
        CJNE     @R1,#007H,L01CD
        SJMP     L01E9           ;Sub function can not be 7
;
L01CD:   CJNE   @R1,#005H,L01D2
;sub function 5
        SJMP    L01DD           ;Prorgrame security bit / Dbl Clock
;
L01D2:  JB      001H,L01E7      ;?? if bit 1 set no action
        CJNE    @R1,#001H,L01DD
;sub function 1 Erase Block
   INC   R1
                MOV         DPH,@R1         ;Selection code at dph
   SJMP   L01E0
;
L01DD:   
   INC   R1
   MOV   DPL,@R1   ;This will be Higher Address in record 3
;
L01E0:
   INC   R1
   MOV   A,@R1      ;This will be Lower Address for
      MOV     R1,037H         ;Sub function in R1(1 for Erase block 8 for sector   erase)
   LCALL   L1FF0
;
L01E7:   AJMP   L0146
;
;
L01E9:   AJMP   L0146
;

Annibal Abreu

Harshadbhai Ukani

Could you resume how to erase a sector ?

I mean, how would be a command for this ?