Discussion in "Project Help" started by    Utsavi    Jun 12, 2017.
Mon Jun 12 2017, 10:36 AM

I am working on PXAG-49 IAP.

To erase blocks I write like.,

MOV R6H, #40H //indicates blocks to erase
MOV R0H, #01H //Erase Command
OR AUXR, #80H //ENBOOT set
CALL 0FFF0H     //call bootROM

(Note that I write above assembly code in my .c file with help of #pragma asm/endasm)

When I am calling 0FFF0H program doing nothing.No erase operation performed. XAG-49 bootROM is at 0xFFF0 address(PGM_MTP).

One more thing on reading PXAG-49 datasheet, I read line which I dont understand that is.,


Setting the ENBOOT bit in the AUXR register enables the Boot
ROM and activates the on-chip VPP generator if VPP is connected to
VDD rather than 12 V externally. The PWR_VLD flag indicates that
VPP is available for programming and erase operations. This flag
should be checked prior to calling the Boot ROM for programming
and erase services. When ENBOOT is set, it typically takes
5 microseconds for the internal programming voltage to be ready

Is PWR_VLD already Enabled? My Vdd is connected to Vpp directly. will PWR_VLD bit be 1 or 0 for Vpp connected to Vdd?

Erase is not working. Is there any settings to do?

Utsavi Bharuchwala

[ Edited Mon Jun 12 2017, 11:45 AM ]
Mon Jun 12 2017, 06:18 PM
If Vpp is connected to 12 volts PWR_VLD should be 1
If Vpp is connected to 5 volts PWR_VLD should be 0

If Vpp is connected to 5 volts, set ENBOOT ,
then wait until PWR_VLD is set.
R6L should be 0.

Tue Jun 13 2017, 12:02 PM

Thanks for reply.

Yes,I disabled all interrupt.
I set R0H to #01H, R6H to #00H, R6L to #00H
I wait till PWR_VLR set to 1.
On PWR_VLD set, I called bootROM,
I cleared ENBOOT.
I checked R4L, which is not 0 ....!!!!

Means Erase is not done... Why?

Why bootROM is not erasing block? I did every steps which are mentioned in datasheet,though I am unable to erase..

[ Edited Tue Jun 13 2017, 12:12 PM ]
Tue Jun 13 2017, 05:31 PM
Yes that should have worked.
Can you post your full code just to double check.
Have you found any example code on-line ?
According to this document in circuit erasing may be unreliable.
Wed Jun 14 2017, 04:35 AM

Thanks for reply. Erasing blocks is called as auto erasing? And Yes for simplicity, I was erasing only block 0. As mentioned in my previous I move R6H to 00H. will it not erased this block?

Wii this create problem in erasing block 0 and block 1 ??

I am using 27MHz crystal oscillator. WDT is not enabled in my program.

I want a patch for xaAutoBlockErase234() function.Please provide me link to download.

My erase code is below,

	 MOV.b R0H,#01H
	 MOV.b R6H,#00H    ;;Erase block 0
	 MOV.b R6L,#00H
 	 OR.b AUXR ,#080H  ;;set ENBOOT 
       MOV.b R3L,AUXR         
       AND.b R3L ,#020H 
       CJNE.b	R3L,#020H,REPEAT_STEP	;; checked PWR_VLD prior calling bootROM
       AND.b AUXR, #07FH  ;;clear ENBOOT
       CJNE.b R4L, #00,EraseFail

Utsavi Bharuchwala

Wed Jun 14 2017, 11:52 AM
Hello ExperimenterUK,

Please note that, I also assigned crystal frequency to R0L register(MOV.b R0L, #27 ) according to AN716_1.pdf (page 7)file attached below,which is also not working.

Utsavi Bharuchwala

Wed Jun 14 2017, 08:09 PM
I can't find much on the Web about the XA-G49
and nothing more about IAP erasing.

We seem to be at the "try anything" stage.

I would try:

Use a fixed delay after setting ENBOOT , say 10mS.
Try erasing other blocks.
A lower crystal speed , say under 10MHz
Connect Vpp to 12 volts.

Do the the other 0xfff0 functions work ?

"I want a patch for xaAutoBlockErase234() function.Please provide me link to download."
I couldn't find any trace of it.
You could try NXP (Philips) technical support.
Thu Jun 22 2017, 12:14 PM
Hello ExperimenterUK,

Thanks for your support. From code written upper erase is performed ok. There was problem in my debug.And because of that value of R0H value was changing. But now erase was OK.

Now I want to try erase 2 blocks my code is below...What i note is sometimes block 2 is unable to erase.

MOV.b R1L, #00H  

	MOV.b R0L, #27
	MOV.b R0H,#01H			  
	MOV.b R6H,R1L
	MOV.b R6L,#00H
 	OR.b AUXR ,#080H  
        MOV.b R3L,AUXR
        AND.b R3L ,#020H 
        CJNE.b R3L,#020H,REPEAT_STEP1	 
        CALL PGM_MTP

        AND.b AUXR, #07FH  
      	CJNE R4L, #00, EraseFail	

       	CJNE R1L, #020H, GO4NEXT
	JMP EraseOver

GO4NEXT: ADD.b R1L, #020H
	 JMP EraseAgain

By doing blank check in WinISP i can see that Part 2000H not erased message.. why this is so??

Should I need to check PWR_VLD bits every time on erasing each blocks?


Utsavi Bharuchwala

Fri Jun 23 2017, 08:19 PM
>Should I need to check PWR_VLD bits every time on erasing each blocks?

I think so, and you don't save anything by not checking.

I'm happy to hear you have made great progress.
From reading the data sheet it is not clear whether the block address
goes in R6 high or R6 low.. try R6 low.

One thing to consider, unless a call guarantees the registers are
not changed you should assume they will change.
Use a memory location, not R1L for the block number.
I know its a short piece of code that you know very well,
but add comments to describe what you are doing.

Let us know how you get on.

[ Edited Fri Jun 23 2017, 08:42 PM ]
Thu Jun 29 2017, 12:29 PM
Hello ExperimenterUK,

Thanks for reply. My Erase part to done. Now I am Programming Data Bytes. Small file say 5 to 6 lines .hex file I am successfully able to program.

But when I take a large file say of 375 lines .hex file, I am unable to Program it.Say my programming Bytes fails from line number 321 having address of 29FEH, sometimes from 20 having address of 2BF2H etc. My R4L is not coming 00.

How can trace the reason of program failure?

Note: I am erasing 0 and 1 block . My .hex file has 2D37H Ending Range (note from WinISP by Loading hex file) which is in range of Block 0 and 1.

Its not like that, Block 0 or 1 is not erased, because Programming at address say., 2A0FH and at address say., 0084H is done.

And no address is above 3000H in my hex file.

Utsavi Bharuchwala

Get Social


Powered by e107 Forum System


Wed Jul 26 2017, 07:51 PM
Please post questions in the forum, the chat box is for chat
Wed Jul 26 2017, 11:27 AM
i need code if any one have aduc706 interfacing lcd 16*2
Wed Jul 26 2017, 11:26 AM
pl help me how to write code of interfacing ADuc7026 controlleo lcd pl any one help me hoe to initializend configure the direction
Wed Jul 26 2017, 06:04 AM
can you explain what is timer and how to use their modes ...
Wed Jul 26 2017, 06:03 AM
ExperimenterUk thank you for your quick reply okay
Wed Jul 26 2017, 01:43 AM
rammichael & Sarvn We will help,but mainly by answering questions about problems.
Tue Jul 25 2017, 10:59 AM
i want few tips to learn to become an expert in embedded systems ...?anybody is there to help me?
Sun Jul 23 2017, 04:13 AM
Sir, I wants to make a digital clock with RTC using AT89C51 or AT89C2051 and seven segment led. Sir will u help me?
Sat Jul 22 2017, 11:42 AM
I wnt to learn embedded could anyone help me
Sat Jul 22 2017, 11:41 AM



Wed Jul 26 2017, 11:23 AM
Wed Jul 26 2017, 01:04 AM
Tue Jul 25 2017, 07:12 AM
Tue Jul 25 2017, 04:26 AM
Mon Jul 24 2017, 02:31 PM
Sat Jul 22 2017, 11:34 AM
Fri Jul 21 2017, 01:44 PM
Thu Jul 20 2017, 03:07 PM


Guests: 53, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 37866
Newest member: msd007
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Jul 26 2017, 07:35 PM
A byte such as 0xfa will not pass through the sys...
hmn16 Avatar
Posted By hmn16
Wed Jul 26 2017, 01:08 AM
Hello, I am current;y trying to send a hexadecimal...
Rohanmore26 Avatar
Posted By Rohanmore26
Tue Jul 25 2017, 04:29 AM
Hello I want to know How 3D stitching of 2 3D imag...
AlFaller Avatar
Posted By AlFaller
Mon Jul 24 2017, 02:40 PM
Here is a lot information about using virtual COM ...
ExperimenterUK Avatar
Posted By ExperimenterUK
Thu Jul 20 2017, 04:08 PM
can it be possible ?? Alihaider.007No.You will nee...
Alihaider.007 Avatar
Posted By Alihaider.007
Thu Jul 20 2017, 03:14 PM
Sir I am using AT89S8253 I have trying to use this...
Utsavi Avatar
Posted By Utsavi
Mon Jul 17 2017, 09:57 AM
Hello Ajay_Bhargav,Thanks for your reply. Yes, you...
ajay_bhargav Avatar
Posted By ajay_bhargav
Mon Jul 17 2017, 06:41 AM
I do not think it would be a good idea to kind of ...
ajay_bhargav Avatar
Posted By ajay_bhargav
Mon Jul 17 2017, 06:32 AM
Tasking EDE has linker script facility available y...
Ramweit Avatar
Posted By Ramweit
Thu Jul 13 2017, 06:58 AM
Thank you for response,Sim300 gsm Modem am using h...