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

Wed Nov 08 2017, 01:35 PM
Anirudh jain
I want to burn code in atmel 89s51 24pc 0329 but cannot get the connection with the burner. Can somebody provide me with the circuit diagram for connecting controller to burner. I'm using usb burner
Thu Nov 02 2017, 11:44 AM
karpal
write a program to exchange the content of b register with external RAM address 02CFH help me
Wed Nov 01 2017, 05:47 PM
sanae
i am using the DHT11 but i'm getting some errors in the simulate the programe in proteus 8 professional,: 1)cannot find model file 'DHTXX.MDF'.2)simulation failed due to netlist linker error(s).
Fri Sep 29 2017, 02:45 AM
Maaz
i am doing the same project on verilog please contact me [email protected]
Wed Sep 20 2017, 12:36 AM
Ted
In a missing pulse detector using a 555 timer connected as a monostable vibrator with a PNP transistor,how does the positve input pulse turn on the PNP transistor?
Sun Sep 03 2017, 02:29 PM
martymarty
How do I connect an <NOKIA 1100 LCD > to an atmega328P ?
poojab51296
Sun Aug 20 2017, 10:23 AM
i am intending to interface sd card with STM32F4 and want to write a file in sd card using SPI protocol but using HAL only. Can anyone help me PLEASE!!!!
poojab51296
Sun Aug 20 2017, 10:22 AM
hello
rawat742
Fri Aug 18 2017, 11:37 AM
hi @ angel patel i will attach a file i hope it will be helpfull for you
ExperimenterUK
Mon Aug 14 2017, 09:57 PM
@ angel patel... just log in and post your problem

Downloads

Comments

PANDIKOTESWARARAO
Mon Nov 20 2017, 07:40 PM
Hemantika
Sun Nov 19 2017, 07:34 PM
Wed Nov 15 2017, 10:46 AM
Ansh12
Sat Nov 11 2017, 03:43 AM
AngelGT93
Fri Nov 10 2017, 06:53 AM
JardCrocker
Wed Nov 08 2017, 05:27 PM
vivitern
Tue Nov 07 2017, 09:08 AM
catrons
Sat Nov 04 2017, 10:46 PM

Online

Guests: 48, Members: 0 ...

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

Members: 37918
Newest member: PANDIKOTESWARARAO
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Nov 20 2017, 10:18 PM
Here is a version of the tutorial that reads a key...
Ansh12 Avatar
Posted By Ansh12
Mon Nov 20 2017, 02:15 AM
As a starting point, can you tell us how much of t...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sun Nov 19 2017, 08:35 PM
As a starting point, can you tell us how much of t...
Ansh12 Avatar
Posted By Ansh12
Fri Nov 17 2017, 04:07 AM
I am looking keypad interfacing program. I was rea...
JardCrocker Avatar
Posted By JardCrocker
Wed Nov 08 2017, 05:29 PM
Hi...i am a new user here. I was also facing the s...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Nov 07 2017, 07:13 PM
> It employs a fairly advanced technique to detect...
vivitern Avatar
Posted By vivitern
Tue Nov 07 2017, 09:33 AM
I own a used Clavia ddrum4 SE drum module. It empl...
bvdb Avatar
Posted By bvdb
Wed Oct 18 2017, 01:50 AM
I purchased the RKitL51 8051 C compiler from Raiso...
ExperimenterUK Avatar
Posted By ExperimenterUK
Mon Oct 16 2017, 11:44 PM
That looks complicated.Is 8051_BLK a standard 80...
ExperimenterUK Avatar
Posted By ExperimenterUK
Sun Oct 15 2017, 07:29 PM
According to this, gmail should support POP3.https...