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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/09/11 14:50
Modified:
  06/09/11 15:16

Read: times


 
#182555 - Bootloading using external RAM and EA switching?
I've got about ten AT89S52 chips that I picked up a while back, and I decided just recently that I want to experiment with external RAM and loading programs dynamically. The datasheet on the S52 mentions that I should strap EA to VCC to use internal code memory, and strap it to GND to use external code memory. I was wondering if it's possible to use a latch to switch the value of EA dynamically to make it start in internal code, reset, then start from external code?

My program would work like this:

* Power turned on, EA starts low
* S52 loads bootloader from internal ROM, which loads code into external RAM using MOVX
* S52 then writes to the latch which switches EA from high to low
* S52 enables the watchdog timer, waits for it to trigger
* WDT drives reset high, upon coming out of reset the EA line is still low, and starts at $0000 executing external code.

This looks good on paper, but my question is, will the chip let me switch EA while it's still running? The datasheet says that if Lock Bit 1 is programmed, it will sample and latch EA on reset, which is what I need, but I don't want to lock myself out of programming the flash memory. Does anyone know if it still samples and latches EA out of reset without lock bit 1, or will I have to experimentally determine this?

EDIT: I just checked the way EA works according to another guide on 8051 architecture and apparently I don't need to worry about it considering anything outside of normal program space will turn into an external fetch. Whoops!

List of 21 messages in thread
TopicAuthorDate
Bootloading using external RAM and EA switching?            01/01/70 00:00      
   Not sufficient!            01/01/70 00:00      
      Use single SRAM chip by tying PSEN to RD?            01/01/70 00:00      
         That qualifies as...            01/01/70 00:00      
            Experimentation ;)            01/01/70 00:00      
               No need for experimentation            01/01/70 00:00      
                  Fast-forward to 2010 or thereabouts            01/01/70 00:00      
                     It would be a pretty narrow window, but ...            01/01/70 00:00      
                        methinks the real reason            01/01/70 00:00      
                           That's true for program updates, but ...            01/01/70 00:00      
                           visualizing any case where the regular ISP/IAP is too slow            01/01/70 00:00      
                              ... and FRAM's pretty fast, too ...            01/01/70 00:00      
                                 Would have liked to have used FRAM...            01/01/70 00:00      
   As long as intervening RESET            01/01/70 00:00      
   do You need EA controlled?            01/01/70 00:00      
      hmm            01/01/70 00:00      
         not surprised            01/01/70 00:00      
         Decided not to use EA (rather, shouldn't)            01/01/70 00:00      
            i'm confused by AT89S52            01/01/70 00:00      
               This is the page I found            01/01/70 00:00      
                  great            01/01/70 00:00      

Back to Subject List