LCD Maze generating using the SPI Protocol on the Z80

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ก.ค. 2024
  • ** For $5 off your first order at PCBWay, click here: www.pcbway.com/setinvite.aspx... **
    www.pcbway.com PCBWay Printed Circuit Boards the Easy Way.
    Learn how to communicate with an LCD Screen using the Serial Peripheral Interface or SPI. In fact, communicate with any peripheral that uses the SPI Protocol. All specifically for the Z80 Microprocessor.
    Also, just for fun, I've created a Maze Generating program that uses the Recursive Backtrack method.
    The code is written in Z80 assembly and using a 128x64 Graphical LCD.
    For the code, datasheets and resources look at the GitHub repo:
    github.com/bchiha/Z80_LCD_128...
    This code is so awesome it has its own repository!
    00:00 Intro with Elite and 3D fundamentals
    00:46 LCD Screen SPI protocol for serial communication
    02:21 LCD Pin connections for serial interface
    04:03 PCB and TEC-1F Connection
    06:22 SPI code walkthrough for the Z80
    11:11 Demonstration of SPI code on the LCD Screen
    12:03 Idea for the Maze Generation program
    13:20 Recursive Backtrack algorithm theory
    15:10 Refactoring the code for the Z80
    18:13 Code highlights for the maze program
    21:08 Maze generation on the LCD!
    23:43 Fast maze generation
    24:30 Even faster maze generation with animation
    And here are some additional links:
    Excellent article on the Recursive Backtrack Algorithm: weblog.jamisbuck.org/2010/12/...
    Other maze-generating algorithms with examples: professor-l.github.io/mazes/

ความคิดเห็น • 18

  • @RealElaineee
    @RealElaineee 10 หลายเดือนก่อน +1

    nice job!!!! So happy to be one part!

  • @lis6502
    @lis6502 11 หลายเดือนก่อน +7

    I love such niche channels. 2023 and people still squeezing last FLOP out of 8bit cpus in such way thaty i actually want to retry this at home :D

  • @ssl3546
    @ssl3546 10 หลายเดือนก่อน

    I know you said VMS Alpha in the narration but when you showed a picture of a VAX 11/780 and showed a copyright date of 2004, that threw me for a loop!

  • @dazealex
    @dazealex 11 หลายเดือนก่อน +2

    Wow, very cool!

  • @ReinouddeLange
    @ReinouddeLange 11 หลายเดือนก่อน +2

    Very nice video, great explanation! I can already see myself watching it over and over how the mazes are generated! 🙂

  • @DaveEverett01
    @DaveEverett01 11 หลายเดือนก่อน +1

    Love these videos. Every time I see that display I think about building a handheld TEC-1 with just the lcd display and keyboard

    • @ReadyZ80
      @ReadyZ80  11 หลายเดือนก่อน

      Well the TEC-1G includes a 4x20 LCD and will have the ability to add-on the GLCD which will act as a terminal. There's a picture of the 1G at the end of this video

    • @DaveEverett01
      @DaveEverett01 11 หลายเดือนก่อน

      Yeah I'm a member of the facebook group and will get a G board when they become available. I built my first tec in about 1989 and used it for years to program eproms for microcontroller programming. I'm just thinking of a handheld TEC without the LEDs just the graphic LCD and keypad, the chips on the back of the LCD and keypad area and serial interface port. It's completely unnecessary, that's why it appeals to me :)

  • @MicroMouse
    @MicroMouse 10 หลายเดือนก่อน +1

    Z80s and mazes what's not to like (my first micromouse used a Z80) back in 1984

  • @AK-vx4dy
    @AK-vx4dy 11 หลายเดือนก่อน

    It could be "desk toy" instead of bouncing balls :D

  • @geowar20
    @geowar20 10 หลายเดือนก่อน

    You only need to push cells that have more than one empty neighbour. IOW: if there’s only one direction you can go then don’t push the backtrack cell.

    • @ReadyZ80
      @ReadyZ80  10 หลายเดือนก่อน +1

      Yes, this is correct. Only one free adjacent cell, no need to backtrack back to it after pushing through. But there is a loss of sequential current cell animation. Trade off!

    • @geowar20
      @geowar20 10 หลายเดือนก่อน

      @@ReadyZ80 True… if you ever need speed thou… ;-)

  • @jimtekkit
    @jimtekkit 10 หลายเดือนก่อน

    I'm halfway done on my TEC-1F build, just in time to learn that the TEC-1G is coming soon and it's quite a radical upgrade. You planning on building one? (Edit: I suppose it's an obvious answer when your name is on the back of the PCB!)

    • @ReadyZ80
      @ReadyZ80  10 หลายเดือนก่อน

      I have a Beta 1G board and will most likely do a vid on it. Stay tuned.

  • @AK-vx4dy
    @AK-vx4dy 11 หลายเดือนก่อน +1

    8:19 I don't know what clock you running your cpu but those clock pluse is not to fast/short ?

    • @ReadyZ80
      @ReadyZ80  11 หลายเดือนก่อน +2

      Good question. I was going to talk about this but cut it out.
      I'm using a 4Mhz clock, one clock cycle is 1/4000000 or 250ns. The OUT instruction takes 11 clock cycles (2750ns). The minimum SPI clock cycle as per the spec is 400ns.
      What would be the fastest clock that can do two OUT instructions and an XOR A in 400ns? The three instructions take 26 CPU clock cycles. Therefore
      CPU Clock = 26 / (4x10^-7) = 65Mhz

    • @AK-vx4dy
      @AK-vx4dy 11 หลายเดือนก่อน

      @@ReadyZ80 Oh I didn't know that SPI is so fast...
      Cycles i know and can calculate but I didn't know SPI specs, my bad 😅