ATMEGA103 Internal VS External Memory

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am designing a memory map where the first 4K is internal and
then the next 32K is an external 32K RAM. Do I need to disable
the External memory during the first 4k? or will the atmega103
automatically write internally so I can leave the external memory
enabled and not worry about accidentally writing to the external
memory in the first 4k?

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

Some ideas:

If you map the 32k ram to begin from address 0x0000, you lose the first 4k. You don't however need any glue logic, since you could use A15 signal as chip select.

If you want the external ram to start immediatelly after internal, you need some more glue logic for address decoding.

If you map the external ram to start from address 0x8000 you could use A15 signal as chip select
for the ram. Usually it needs to be inverted, because CS is in most cases active low. This is how I would do it. I think it's easier to handle the ram in software when the starting address is simple.

You don't need to disable the external ram when you access the internal ram. According to datasheets, there might be random pulses in ALE signal during internal access. Usually this isn't a problem.

Tommi

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Michael,

there was no external fetch done during access the lower 4k. And all fetches above 4k always done external, if enabled.
So you can connect the 32k RAM and have 36k in the sum and without a gap. Since the lower 4k external RAM are accessible above 0x8000 (A15 output left unconnected).

0x0000 - 0x07FF: internal
0x0800 - 0x87FF: external

Peter