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

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
AND AUXR, #7FH //clear ENBOOT


(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.,

ENBOOT and PWR_VLD

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?

Regards
Utsavi Bharuchwala



[ Edited Mon Jun 12 2017, 11:45 AM ]
Mon Jun 12 2017, 06:18 PM
#2
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
#3
Hello,

Thanks for reply.

Yes,I disabled all interrupt.
I set R0H to #01H, R6H to #00H, R6L to #00H
I set ENBOOT in AUXR,
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
#4
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
#5
Hello,

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,

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


Regards
Utsavi Bharuchwala

Wed Jun 14 2017, 11:52 AM
#6
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.

Regards
Utsavi Bharuchwala



Attachment
Wed Jun 14 2017, 08:09 PM
#7
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
#8
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  

EraseAgain:
         	 		 	 
	MOV.b R0L, #27
	MOV.b R0H,#01H			  
	MOV.b R6H,R1L
	MOV.b R6L,#00H
 	OR.b AUXR ,#080H  
 	  
REPEAT_STEP1:	
        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?

Regards

Utsavi Bharuchwala



Fri Jun 23 2017, 08:19 PM
#9
>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.
Also...
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
#10
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.

Reagrds
Utsavi Bharuchwala




Get Social

Information

Powered by e107 Forum System

Conversation

Sat Feb 24 2018, 09:05 AM
Aaquib
I want help for digital ic tester
ExperimenterUK
Tue Feb 20 2018, 09:31 PM
Join up.. and post your problem
Mon Feb 19 2018, 04:47 PM
ashishkumar
i needs help for my project
Mon Feb 19 2018, 04:46 PM
ashishkumar
can i join you guys
ExperimenterUK
Mon Feb 05 2018, 03:08 AM
Hi Dave. Good to see you.
DavesGarage
Wed Jan 10 2018, 01:25 AM
It's been a few years since I poked around here - Hi all...
ExperimenterUK
Tue Jan 09 2018, 12:49 AM
Hi TPS. it's been a while..
۞ TPS ۞
Mon Jan 08 2018, 12:12 AM
hello
Thu Jan 04 2018, 07:20 PM
sayyad affrid
its AT89S52
Thu Jan 04 2018, 07:20 PM
sayyad affrid
sir, i want embedded c code for ultrasonic sensor having buzzer interfaced with AT9S52

Downloads

Comments

Manojsanghavi
Sat Feb 24 2018, 12:47 PM
Daro12_76
Wed Feb 21 2018, 05:01 PM
radhikanathani
Wed Feb 21 2018, 06:55 AM
Narayani
Wed Feb 21 2018, 04:10 AM
Parth09
Tue Feb 20 2018, 07:53 AM
goutham
Mon Feb 19 2018, 02:49 AM
kks
Sun Feb 18 2018, 05:59 PM
justotemon
Sat Feb 17 2018, 07:14 AM

Online

Guests: 29, Members: 0 ...

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

Members: 37971
Newest member: Manojsanghavi
Forum Activity
Manojsanghavi Avatar
Posted By Manojsanghavi
Sat Feb 24 2018, 01:03 PM
Dear allCan someone please help me on how to progr...
Ansh12 Avatar
Posted By Ansh12
Fri Feb 23 2018, 07:10 PM
sbit E = P0^7; //E pin for LCD //use port 0sb...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Feb 23 2018, 02:43 PM
sbit NOT #definesbit E = P0^7; //E pin for LCD ...
Ansh12 Avatar
Posted By Ansh12
Fri Feb 23 2018, 01:55 PM
change your defines tosbit E = P0^7; //E pi...
ExperimenterUK Avatar
Posted By ExperimenterUK
Fri Feb 23 2018, 01:12 AM
Add pull- ups for EN and RS.change your defines t...
Ansh12 Avatar
Posted By Ansh12
Thu Feb 22 2018, 01:36 AM
Can you post your Proteus files.ExperimenterUKThan...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Feb 21 2018, 09:07 PM
The code you refer to is to drive the circuitshown...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Feb 21 2018, 05:41 PM
Can you post your Proteus files.You will need pull...
radhikanathani Avatar
Posted By radhikanathani
Wed Feb 21 2018, 02:39 PM
I want to design a system for vehicle tracking and...
Narayani Avatar
Posted By Narayani
Wed Feb 21 2018, 04:17 AM
Hello,Your tutorial really helped me understand st...