Author Topic: Early design review: MCU with Quad SPI and External Memory Interface.  (Read 9535 times)

0 Members and 1 Guest are viewing this topic.

Offline obiwanjacobiTopic starter

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
For my Z80 computer project I am now researching how to make a Video circuit (GPU).

The computer is to become a game console and the Video card/GPU is to offload the Z80 as much as possible. It will be more powerful than the Z80 itself. Here's a block diagram of what I had in mind.



The FTDI EVE2 chip is to take care of the grunt work and the MCU will need to supply the commands over (quad) SPI to drive it. Any graphic function that is not already in the EVE chip, I will code in the MCU. The plan is to start with Tiled-based games so moving graphic tiles around and having several (soft?) sprites will be the immediate goal.

The extra memory will be used to store all the tiles and tile maps etc. - close to the EVE chip. The game program on the Z80 directly moves the tile files from disk to GPU at startup.

The idea is to use an ARM MCU - because I want to learn ARM - to use as the brains of the GPU. I just need to find one that has (hardware) support for a quad SPI port AND an external memory interface. Higher speed is better, more on board memory is better, lower price is better.  :P

The extra Memory will probably be a couple of MBs of some cheap DRAM, as fast as possible. I have never worked with DRAM before, so that will be fun to learn too.

As an alternative I have thought of replaceing the MCU for an FPGA (I have an Altera Cyclone II) and obviously that will solve the hardware interfacing problems, but I do not know if I can make all the graphic-functional aspects work (and fit)...

disclaimer: I do not want to use vintage period correct video chips of the time when Z80 was all the rage. I want to build a video GPU that performs good and learn new stuff doing it.

So can you help me find a suitable ARM chip?
Other thoughts?
« Last Edit: January 30, 2017, 11:16:04 am by obiwanjacobi »
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline ale500

  • Frequent Contributor
  • **
  • Posts: 415
Re: Early design review: MCU with Quad SPI and External Memory Interface.
« Reply #1 on: January 31, 2017, 06:29:08 am »
Depending on what you want regarding dept of color and resolution, it may be a good idea to use a FPGA. If you can fit your framebuffer in block memory, you save on complexity... if not... it may not be the easiest why of doing things.
I'd ask what are your requirements ? not only resolution and dept, but play fields, sprites and the such., before you commit to a hw/sw solution.

Edit: I re-read your comment and I think that a couple things are a bit mixed up:

You want to learn ARM microcontrollers: choose a board with LCD & SDRAM like the discovery 746 480x272 TFT 24 bit color and like 8 MB SDRAM. It is like 50 €. There is also the Discovery 429 with the same SDRAM and a 320x240 TFT, for something like 30 €. Ready to go.
DRAM ? you mean async DRAM ?... used and maybe NOS parts available... I'd go for SRAM 256kx16 or similar: easier, plentiful, fast.

I rather decide on the requirements first than commit to a unsuitable platform.

« Last Edit: January 31, 2017, 06:37:00 am by ale500 »
 

Offline obiwanjacobiTopic starter

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Early design review: MCU with Quad SPI and External Memory Interface.
« Reply #2 on: January 31, 2017, 07:23:26 am »
The EVE2 chip can do 800x600 with 24 color bits (3x8). That is plenty for the graphics I had in mind. I looked into building it from scratch with an FPGA, but I have very limited experience with FPGAs and thought that would be too much to handle at one time (I do know how to program C/C++ etc). I also just want to try out the EVE2 chip.

I want the game to interface with this GPU at a logical level. So tiles are indexed/named and tile maps are uploaded to the GPU as well so it can auto display it. There will be functions for (setting up) scrolling and perhaps rotation. I want at least 3 layers of tiles for back-, mid- and foreground. I may want transparency, dependent on performance cost. I want enough sprites to make the games interesting. Dependent on the sprite-size and MCU performance I may need more/or less. I don't think the EVE2 chip really supports sprites so that would be the job of the MCU.

I dont want a small LCD, I want VGA so I can connect to the TV and Monitors. I have a simple STM32F103 dev board I can experiment with to get started with ARM. I also already program on a Cypress PSoC5 - that is also ARM, but you hardly notice because of the good IDE.

What type of DRAM to use, I don't know yet. Big, fast and cheap - and as wide as possible for better throughput - at least 16 bits - also depends on the width of the external memory interface. If that is 32 bits, I will do 32 bits (or put 2 16bits DRAM chips in parallel).

So, I have thought about the requirements, but I find it hard to predict if the hardware will deliver. This is a hobby-project and the main goal is to learn new things. I don't mind failing or making mistakes, I will try again. I thought this design would be a good starting place and have some room for change as the experience progresses and teaches me different.

That is why I figured I needed an ARM MCU with an external memory interface and a quad SPI port (EVE2 talks up to quad SPI)....
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline obiwanjacobiTopic starter

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Early design review: MCU with Quad SPI and External Memory Interface.
« Reply #3 on: February 01, 2017, 12:55:09 pm »
Does anybody know an ARM MCU with an external memory interface and a quad SPI port?

thanx.
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: lt
Re: Early design review: MCU with Quad SPI and External Memory Interface.
« Reply #4 on: February 01, 2017, 01:45:21 pm »
Does anybody know an ARM MCU with an external memory interface and a quad SPI port?
STM32F4 ?
 

Offline obiwanjacobiTopic starter

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Early design review: MCU with Quad SPI and External Memory Interface.
« Reply #5 on: February 01, 2017, 02:37:14 pm »
Does anybody know an ARM MCU with an external memory interface and a quad SPI port?
STM32F4 ?

Thanx.
The STM32F446 seems a likely candidate.
However they keep harping on about the quad-SPI being used to interface memory devices, but that is not what I need it for... Will this quad SPI work as a generic interface?

Quad SPI app note:
http://www.st.com/content/ccc/resource/technical/document/application_note/group0/b0/7e/46/a8/5e/c1/48/01/DM00227538/files/DM00227538.pdf/jcr:content/translations/en.DM00227538.pdf

Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: Early design review: MCU with Quad SPI and External Memory Interface.
« Reply #6 on: February 01, 2017, 03:12:18 pm »
IIRC some of the higher end ARM7TDMI based controllers (LPC2000 series) from NXP have an external memory interface and 4 bit parallel SPI-ish interfaces (for use with SD cards).
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline hans

  • Super Contributor
  • ***
  • Posts: 1638
  • Country: nl
Re: Early design review: MCU with Quad SPI and External Memory Interface.
« Reply #7 on: February 01, 2017, 03:12:35 pm »
I think you will have to put all the instruction phases, dummy cycles, etc. on non used if you want to do that. Then you can just bang bytes out like SPI, but now on 4 lines.

But Quad SPI is useful if you can memory map it into MCU's memory architecture. I guess you want to use the FT81x series of chip using quad SPI. Paragraph 5 (page 40) tells you how the memory map looks like, and where the registers etc. of the FT81x chip map to.

If you map the FT81x memory address range into the STM32F4's memory map (at some kind of offset) over quad SPI (using the correct instruction phases), reading/writing to the LCD registers becomes transparent like any other hardware peripheral. All the random access addressing should be handled by the hardware.
You could also write software for it like Ft810WriteRegister(), Ft810WriteBitmap(), etc., and as long as it's software you can change it at any time.
« Last Edit: February 01, 2017, 03:14:16 pm by hans »
 

Offline daveshah

  • Supporter
  • ****
  • Posts: 356
  • Country: at
    • Projects
Re: Early design review: MCU with Quad SPI and External Memory Interface.
« Reply #8 on: February 01, 2017, 05:10:24 pm »
If you're going for something like the STM32F4 (STM32F7 would be another option if you need even more power) you might be better off using the builtin TFT controller (which will also drive VGA with a suitable DAC) rather than the FTDI device.
 

Offline jnz

  • Frequent Contributor
  • **
  • Posts: 593
Re: Early design review: MCU with Quad SPI and External Memory Interface.
« Reply #9 on: February 01, 2017, 11:55:34 pm »
There are a lot of Quad SPI Cortex M micros.

What I've always wondered though is if in the STM32 specifically if you could use hardware SPI combined with bitbanding to make hardware quad SPI in a module that didn't actually have it. Probably pointless though.
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2601
  • Country: us
Re: Early design review: MCU with Quad SPI and External Memory Interface.
« Reply #10 on: February 02, 2017, 03:19:13 am »
If you're going for something like the STM32F4 (STM32F7 would be another option if you need even more power) you might be better off using the builtin TFT controller

As long as you don't mind the signals being strewn randomly about all four sides of the package and hamstringing half of your other peripherals due to pin conflicts |O

It's almost like ST TRIED to make their pin muxing as obnoxious as possible.
 
The following users thanked this post: kony

Offline obiwanjacobiTopic starter

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Early design review: MCU with Quad SPI and External Memory Interface.
« Reply #11 on: February 02, 2017, 11:51:01 am »
If you map the FT81x memory address range into the STM32F4's memory map (at some kind of offset) over quad SPI (using the correct instruction phases), reading/writing to the LCD registers becomes transparent like any other hardware peripheral. All the random access addressing should be handled by the hardware.

That sounds great and would be awesome if that would work, but how would I make sure that the correct protocol is sent over the wire(s)? (4.1.2 and further of the same document) - I have trouble finding the STM32 docs/datasheet for all this stuff...

If you're going for something like the STM32F4 (STM32F7 would be another option if you need even more power) you might be better off using the builtin TFT controller (which will also drive VGA with a suitable DAC) rather than the FTDI device.

Yes, good point. However I have not found the details (docs) for that yet and I am wondering how much performance that will take out of the MCU and if there will be enough left for the higher level graphic functions I was planning to make...?

IIRC some of the higher end ARM7TDMI based controllers (LPC2000 series) from NXP have an external memory interface and 4 bit parallel SPI-ish interfaces (for use with SD cards).
Thanx, will take a look.
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline obiwanjacobiTopic starter

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Early design review: MCU with Quad SPI and External Memory Interface.
« Reply #12 on: February 03, 2017, 01:43:44 pm »
To let you know where I am...

The NXP seem to be older and less fast.
http://www.nxp.com/products/microcontrollers-and-processors/arm-processors/lpc-cortex-m-mcus/lpc2100-200-300-400:MC_71580

This is a one-off project so a couple of bugs extra for the MCU is no problem.

I am looking at the STM32F446 ZE(T=QFP)
http://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit-arm-cortex-mcus/stm32f4-series/stm32f446/stm32f446ze.html

Now reading the reference and programming manuals to gather detailed info if my design will work.
(External Memory Interface, Quad SPI and LCD interface)

Thinking of buying (something like) this for experimentation:
http://www.ebay.com/itm/NUCLEO-F446ZE-STM32-Nucleo-144-STM32F446ZE-Board-for-ST-Zio-and-morpho-/262409768682?hash=item3d18d74eea:g:1ZIAAOSwubRXIeeK

Any suggestions? Shoot!
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline krho

  • Regular Contributor
  • *
  • Posts: 223
  • Country: si
Re: Early design review: MCU with Quad SPI and External Memory Interface.
« Reply #13 on: February 03, 2017, 03:57:36 pm »
Yeah. Buy from farnell. 18,5€
 
The following users thanked this post: obiwanjacobi

Offline obiwanjacobiTopic starter

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Early design review: MCU with Quad SPI and External Memory Interface.
« Reply #14 on: February 04, 2017, 07:55:04 am »
Yeah. Buy from farnell. 18,5€

Thanx! Didn't expect that  ;D

I found some cheap SDRAM but it needs a clock of 133Mhz (lowest). If I read the Reference Manual (at page 313) correctly  the SDCLK is the main clock (HCLK) divided by 2 or 3. So with a main clock of max 180MHz, 90Mhz is the best I can get, correct?

What type of SDRAM can I use then?
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline krho

  • Regular Contributor
  • *
  • Posts: 223
  • Country: si
Re: Early design review: MCU with Quad SPI and External Memory Interface.
« Reply #15 on: February 04, 2017, 09:34:10 am »
AFAIR something like that is on STM32F429I-DISC1 board. What I didn't check is if it has a QSPI.
Find the above disco board info pdf and look at the schematic and BOM.
 

Offline hans

  • Super Contributor
  • ***
  • Posts: 1638
  • Country: nl
Re: Early design review: MCU with Quad SPI and External Memory Interface.
« Reply #16 on: February 04, 2017, 11:52:51 am »
I have the STM32F429 DISCO board, and that chip does not support quad SPI.
It's only on the STM32F446 and the STM32F46x and STM32F47x series.

Nevertheless, the IS42S16400J SDRAM chip is also used on the STM32F429 DISCO board. The datasheet says it operates at 80MHz.
 

Offline obiwanjacobiTopic starter

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Early design review: MCU with Quad SPI and External Memory Interface.
« Reply #17 on: February 04, 2017, 12:57:23 pm »
Nevertheless, the IS42S16400J SDRAM chip is also used on the STM32F429 DISCO board. The datasheet says it operates at 80MHz.

This is the datasheet I have found:
http://www.issi.com/WW/pdf/42-45S16400J.pdf

It does not mention a lower clock rate then 133 MHz (that I could find - page 17)...
You have a different datasheet?
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26906
  • Country: nl
    • NCT Developments
Re: Early design review: MCU with Quad SPI and External Memory Interface.
« Reply #18 on: February 04, 2017, 02:02:05 pm »
There is no maximum clock cycle time specified. 133MHz is the maximum frequency for the part for certain operating conditions.
« Last Edit: February 04, 2017, 02:08:37 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline obiwanjacobiTopic starter

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Early design review: MCU with Quad SPI and External Memory Interface.
« Reply #19 on: February 05, 2017, 10:42:39 am »
Ok, so that would work then (obviously when others have used it too).

The STM32F446 does not have the TFT port. It does have a HDMI-CEC function, but if I understand that correctly, that is for control only. So the FTDI EVE chip it is.

I read some more on Quad SPI and it looks like the FT81x chip can indeed be addressed as memory mapped IO (Chapt4 / Page16).
The STM32F446 does seem to have enough configuration options to make that work (Chapt12[.3.2]/ Page 323=>).

As for the Video DACs I was planning on using the ADV7125(KSTZ50), which I've seen being used in other designs. Looks pretty easy to interface and fit straight onto the outputs of the EVE chip. Not sure what the pitfalls are to look out for on this. Obviously the high frequency is something of a concern (no experience with that) and perhaps the analog power supply? Plenty of decoupling needed of course...

So all I need is some level-shifters to interface between the +5V of the system and 3V3 this GPU (STM32F446) will be running at. Any recommendations?
I have some (SN74)CBT16800C's...

Looks like it's coming together nicely (unless you guys can point out some fatal flaws)...
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline obiwanjacobiTopic starter

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Early design review: MCU with Quad SPI and External Memory Interface.
« Reply #20 on: February 05, 2017, 11:14:22 am »
Little more detail...

Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline krho

  • Regular Contributor
  • *
  • Posts: 223
  • Country: si
Re: Early design review: MCU with Quad SPI and External Memory Interface.
« Reply #21 on: February 05, 2017, 11:45:31 am »
If you need tft port do you still need QSPI then?
If answer is yes, then STM32F469 or STM32F479 also has a TFT port. If not, then you can go lower than 446 to 429 (TFT+SDRAM).
Finding the right chip with STM32CubeMX is easy :)
 

Offline obiwanjacobiTopic starter

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Early design review: MCU with Quad SPI and External Memory Interface.
« Reply #22 on: February 05, 2017, 12:05:35 pm »
If you need tft port do you still need QSPI then?

I don't think I need a TFT port. I want VGA to plug in monitors and TVs.
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline krho

  • Regular Contributor
  • *
  • Posts: 223
  • Country: si
 

Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 797
  • Country: lt
Re: Early design review: MCU with Quad SPI and External Memory Interface.
« Reply #24 on: February 06, 2017, 02:47:52 am »
There is no maximum clock cycle time specified. 133MHz is the maximum frequency for the part for certain operating conditions.

Exactly, I've used SDRAM with 50MHz clock and it was perfectly fine.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf