Atmega64 with external ram

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

Hi all,

 

I'm trying to interface mega64 with external ram but there is some strange behavior when debugging it.

 

I'm using 74AHC573 as D latch and IS61LV256 as external ram. The linker options that I'm using in Atmel Studio is:

 

-Wl,--defsym=__heap_start=0x801100,--defsym=__heap_end=0x8090ff

 

The memory initialization is done in .init3 section so it should be up and running before any variable initialization. I'm using short program from https://scienceprog.com/adding-external-memory-to-atmega128/ to test the XRAM.

 

The problem that I'm having is when the program is populating the memory it always stores same data in two addresses (duplicating the data) but can't figure what could be causing it. Data array starts at beginning of XRAM (0x1100).

 

 

I was suspecting on timing constrains but they are generally focused on D-latch chip as stated in mega64 datasheet:

 

 However, most latches can be used as long they comply with the main timing parameters. The main parameters for the address latch are:

  •  D to Q propagation delay (tpd).
  •  Data setup time before G low (tsu).
  •  Data (address) hold time after G low (th).

 

Anybody has any idea what could be causing this behavior ?

This topic has a solution.
Last Edited: Mon. Apr 9, 2018 - 10:42 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So did you resolve the problem in your previous thread?

 

https://www.avrfreaks.net/forum/external-memory-5

 

If so, see tip #5

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi awneil,

 

no, the issue is still present in AS. Now I'm just trying to make XRAM functional and test it. When XRAM is up an running I'll be back on that one. Also I noticed that even though AS failes with overflow error it will build the necessary files so I can upload the program anyway, but it's definitely annoying.

 

 

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all,

 

I have gotten another clue for this bug and eventually solved it. After noticing that I could only write even numbers to the XRAM I have checked D0 pin and it turned out to be shorted to the ground. My first check was the HW connection but only between pins of each chip and based on this I have ruled out possible HW issue which turned out to be my mistake.

 

Awneil I apologize for wasting Your time.

 

 

Last Edited: Mon. Apr 9, 2018 - 10:43 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

geronimo350 wrote:
even though AS failes with overflow error it will build the necessary files

I think clawson explained that in the other thread?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...