Easy/decent way to get 64K of SRAM available in an AVR

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

I'm thinking about trying to emulate an 8080 in an AVR, but the largest one I know of has 32K sram (xmega384c3).  I've tried messing with external bus interface memory, and I wonder about SPI based external memory although performance is possibly a concern there.

 

If I just used the 384c3, then I could probably dedicate 24K of its SRAM to the emulator usage, but if I really wanted 64K of SRAM what directions would you guys go/recommend?

 

I know picking a stm32 or something with enough sram to begin with is probably more ideal, but I like 8 bit AVR's and would prefer to use one if I can.

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

512kB SRAM extension for ATMEGA2560, banked into 64kB chunks: https://andybrown.me.uk/2011/08/...

 

One of my favourite sites. Lots of interesting projects.

 

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

alank2 wrote:
I've tried messing with external bus interface memory, ...
ATXMEGA128A1U EBI questions... | AVR Freaks

alank2 wrote:
... but if I really wanted 64K of SRAM what directions would you guys go/recommend?
MT-XRAM-1M 1MB (8Mbit) low power SRAM module - Development Boards to implement a proof-of-concept (bench test)

 

 

"Dare to be naïve." - Buckminster Fuller

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

 

perhaps take a look at AVR emulating cp/m:

 

https://spritesmods.com/?art=avrcpm

 

(I have not used it)

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

alank2 wrote:
stm32

You do realise that Atmel Microchip have their own Cortex-M range - the SAM series ... ?

 

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

I haven't looked at them awneil - can you use AS7 to develop for them?  How much learning curve is there from mega/xmega?

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

Using the Arduino framework, I can port my cpm emulation between different architectures and chips with little effort. Arduino abstracts the Serial interface and hopefully the SD card as well, so assuming you have enough ram, the actual architecture and the chip become near irrelevant.

My recent adventures have included a MaixBit (RISC-V64 dual core @ 400MHz with 8MB of ram) and Teensy4.0(Cortex M7 @600MHz 1MB ram). My cpm emulation runs freekin fast on the Teensy assuming I put the code in ram vs flash. If the code executes from flash, it is about 20 times slower. The teensy is around twice the speed on the MaixBit. I also tried mapping the Z80 ram out to a serial 8MB dram chip(IPS6404) on the Teensy. Using a 80MHz spi clock the performance was around 20 times slower than using the on chip high speed ram. I tried some simple caching and found that 8 bytes of cache was around optimal, 16 and 32bytes was slower.

 

My benchmark for performance was a simple

10 for t = 1 to 10000

20 next t

in mbasic

 

The fastest was sub 1 second, slowest was 20 seconds or so.

 

Here's another z80/8080 emulation:

https://thehighnibble.com/imsai8...

 

He uses an esp32. The web stuff is impressive.

 

Something like a SAMD51 if you want something from the Atmel/microchip stable. 120MHz Cortex M4 up to 256k ram and has Arduino support.

The teensy4.0 is hard to beat on price/performance though  - $20usd. Need to solder on a sdcard socket though.

 

 

 

Last Edited: Sat. Apr 25, 2020 - 02:23 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I wrote a Z80 emulator for AVR.
I am using AVMACZ80 and AVLINKZ80 from Avocet Systems.
He is very comfortable and familiar to me.
But this is a 16-bit application, and they do not work in the 64-bit version of windows.

 

Question for ALL:
Is there an AVMACZ80 compiler that works on windows 64-bit?

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

You'd want to ask Avocet Systems that question.

 

You can easily run your existing application in a virtual machine.

 

If you want something more modern you could contact IAR - but sit down when you see the price!

 

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

Kartman wrote:

You'd want to ask Avocet Systems that question.

Does Avocet Systems exist?

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

Kartman wrote:

You can easily run your existing application in a virtual machine.

Yes of course, but the compilation time is strong increases.

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

Kartman wrote:

If you want something more modern you could contact IAR - but sit down when you see the price!

I use only the assembler Z80 and / or AVR.
Many projects exist, there is no desire to rewrite to a high-level language.

In some projects, this is simply not possible.

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

That doesn't make sense. A modern machine running a VM will be many times faster than a 16bit machine ever would be.

IAR will happily sell you a Z80 assembler and c compiler.

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

I'm not talking about a 16-bit machine.
I am talking about the runtime of a 16-bit application on a 32-bit machine, and about the time of emulation of a 32-bit system, followed by emulation of a 16-bit application on a 64-bit machine.
Time is increasing!
Sorry for my English.
I’m not sure that you understood me.

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

Virtualbox will happily emulate a machine running msdos faster than a 486 class machine. And you’re complaining about the speed of running an assembler? The speed of the disk alone is many times faster. So i really don’t understand your issue with runtime. Besides, we’re talking about a Z80, so the source files are hardly the size of Linux!
I think you’ll need some hard evidence to convince me otherwise.

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

The code size after compilation is 64 layers, each from 16 to 32 kilobytes.

You can imagine the size of the source files yourself.

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

Why are you talking about Compilation? You said you only do assembler. Your project doesn’t sound particularly large. Come back and tell me how long it takes to ‘compile’ running msdos under virtualbox on a modern machine. Otherwise its all fluff.

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

Kartman wrote:
Why are you talking about Compilation? You said you only do assembler.

What is the name of the process of translating a program from assembly language to machine codes?

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

Assembler.

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

You can also run some 16 bit tools in vDos on an x64.

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

alank2 wrote:

You can also run some 16 bit tools in vDos on an x64.

I need all the .EXE (x16) files to be in the same section declared in path.
The result of the application (.HEX,.LST etc...) should be in the same disk and same section as the source files (.ASM).
I am run a .BAT file using Norton Commander from different drives and folders.
vDOS can provide this?

Last Edited: Sun. Apr 26, 2020 - 06:30 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I know what you want - I want the same thing.  I asked a question on the vcfed.org forum and didn't get any ideas of a standalone tool like this.  There is one for CP/M by the way that will run on win32 and run CP/M applications and redirect file i/o to the host system automatically.  I've done some experimenting with vdos and it does have an autoexec file you can use to automate it somewhat.  I made a replacement exe that would in turn make an autoexec file that would allow it to call vdos and it would then run the application and exit.  Sometimes it works better than others, but a far cry from seamless.  I'm kind of hoping once I get some 8080 emulation code working that I might be able to make an 8086 one down the road.

 

http://www.vcfed.org/forum/showt...

 

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

Alan, At work we used the SAM3 and sam4 series, there are in that series processors with more than enough SRAM.

Today I play with a SAMG55 that is a cortex M4 chip with 512K flash and 178K SRAM, I only use AS7 for personal code development so these processors for sure are supported by AS7.

Mchip has been bringing out newer processors in the mean time, but cannot imagine that they would not be supported by AS7.

You could have a look at the website, and then when you found one see if you can start a project with it in AS7.

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

I got a samd20 xplained board from my friend tpappano yesterday to mess around with.  So far I've connected to it using AS7 just fine.  First up is getting it to send out some serial.  If I can get it to do some stuff I'll get a larger SAM with more SRAM.

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

Thanks meslomp!