Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
12/17/04 07:28
Read: times


 
#83294 - two DPTRs
Responding to: ???'s previous message
hi,

AT89S52 has two DPTR registers, AT89C52 only one. If you use DPTR register with AT89S52 you must define actual DPTR register in AUXR1 register first.

Not necessary. I agree that setting of SFRs at start-up is the "good programming" style. Nevertheless, AUXR1 has defined reset value where its DPS bit is zero after reset. It means that after reset, AT89S52 uses DPTR0 which address is the same as one of DPTR in AT89C52.

And this everytime you address the DPTR, equally whether you switch between both DPTRs or not.

Could you explain, please?

So, a code which works for AT89C52 will very probably not work with AT89S52, if you use DPTR register!!

No, if you do not change DPS bit of AUXR1 register anyhow accidentally, then it is not a reason of the incompatibility. As AT89C52 has not defined SFRs address 0xA2 (where AUXR1 is placed at for AT89S52) so it is very unlikely that original poster accesses this address and does un-controlled switching of DPTRs.

The actual reason I see is hardware problems. For example, if Kuldeep Singh uses RC reset net then it may be a real problem:
AT89C52 has reset pull-down resistor 50-300k, while
AT89S52 does 10-30k only.
So it may happen then reset time is not enough with low value of capacitor.

Regards,
Oleg

List of 30 messages in thread
TopicAuthorDate
whats that            01/01/70 00:00      
   compare the datasheets            01/01/70 00:00      
   What crazy?            01/01/70 00:00      
   Are they drop-in replacements?            01/01/70 00:00      
   Two DPTR registers            01/01/70 00:00      
      Two DPTR registers            01/01/70 00:00      
         compatiblity            01/01/70 00:00      
      two DPTRs            01/01/70 00:00      
         reset resistor            01/01/70 00:00      
            RC reset            01/01/70 00:00      
               Don't touch the oven...            01/01/70 00:00      
                  not just code loss            01/01/70 00:00      
                  I know its hot will fix it soon promise.            01/01/70 00:00      
         Datasheet tells it's necessary...            01/01/70 00:00      
            DPS setup            01/01/70 00:00      
               But what makes me wonder...            01/01/70 00:00      
                  rc reset            01/01/70 00:00      
                     Atmel App. notes might help you            01/01/70 00:00      
                        Brown-out kills            01/01/70 00:00      
                           perverse !            01/01/70 00:00      
                              Thanks            01/01/70 00:00      
                     elaborating on RC reset            01/01/70 00:00      
                        Absolutely right!            01/01/70 00:00      
   Rocking & Rolling AT89S52            01/01/70 00:00      
      please don't            01/01/70 00:00      
         Re: RC reset            01/01/70 00:00      
      Decoupling is stil missing!            01/01/70 00:00      
         Will Change it soon.            01/01/70 00:00      
            BOM            01/01/70 00:00      
               sure Ijaz            01/01/70 00:00      

Back to Subject List