Hi! I use a T89C51CC01 from Atmel WM, I would like to use the dual dptr feature on my program. When I run the Debugger, i can't switch the DPTR. In the µC manual, it says that we must set the DPS bit of the AUXR1 register. I do this just before writing on the DPTR. When i set this bit and write just after on the DPTR register, the debugger show me that i write on the first DPTR and not in the second ? Does anyone konw why ?
save_table_eeprom: MOV A,EECON ANL A,#01H CJNE A,#00,save_table_eeprom ;Test si l'EEPROM n'est pas occupé ;Début de la programmation MOV EECON,#02H ORL AUXR,#020H MOV DPTR,#0081H MOV AUXR1,#01H MOV DPTR,#01C8H ;here it's my problem! MOVX @DPTR,A ;I rite on the bad DPTR ;Lancement du cycle d'écriture en EEPROM MOV EECON,#054H MOV EECON,#0A4H RET
I haven't looked at this closely recently, but the debugger never used to show the 2nd DPTR for the Triscend E5, either! I think it displayed the "currently-selected" DPTR value - according to the DPS (DPTR Select) register. You should be able to view the actual value via the SFR address. I wrote a uVision Debug Function to do this. Both of the DPTR values were displayed in the simulator!
I didn't need to view the actual value by the SFR address! I need to know if i really use two or one DPTR in my program! Does the debugger could show me if my second DPTR is used ? In the debugger mode of µVision, It seem's to me that the register window show the value of the two DPTR normally! There is DPTR[0] and DPTR[1]. So, why DPTR[1] never change and keep the value 0x0000 ?
The support of the second DPTR is available since the 6.02 version of Keil C51. So, how to use it ? I search your knowledge base and i found it: http://www.keil.com/support/docs/1463.htm Is there something else who can help me to simulate correctly the second DPTR ?
C51 only ever uses the extra DPTR(s) in a limited set of library functions (memcpy, memmove, memcmp, strcpy, and strcmp), and you have to specifically enable that usage with a command-line option (or 'Use Multiple DPTR Registers' in the uVision Target Options). See the manual. You won't find C51 using multiple DPTRs in your own application code.