N64 Controller - PowerPoint PPT Presentation

1 / 31
About This Presentation
Title:

N64 Controller

Description:

EECS150 Fall2005 Lab Lecture #6. Bryan Brady. Greg Gibeling. 10/8 ... Monochrome screen - Multicolor LCD. Highlights. N64 Controller. NTSC (TV) Video Output ... – PowerPoint PPT presentation

Number of Views:51
Avg rating:3.0/5.0
Slides: 32
Provided by: GregGi7
Category:

less

Transcript and Presenter's Notes

Title: N64 Controller


1
N64 Controller
  • EECS150 Fall2005 Lab Lecture 6
  • Bryan Brady
  • Greg Gibeling

2
Today (1)
  • Administrative Info
  • Lab 4 Solution
  • Project Overview
  • Checkpoint 1
  • Button Parse

3
Today (2)
  • CaLinx Expansion
  • N64 Controller
  • Commands
  • Bit Timing
  • Receive
  • Transmit
  • Testing

4
Administrative Info (1)
  • Midterm I
  • Solutions are posted
  • Re-grade deadline, Right Now!!!
  • Group Signups
  • You should already have a group
  • If not, see me after class today
  • Group names need to be finalized today

5
Administrative Info (2)
  • N64 Controller Checkout
  • One per group
  • Damage
  • You break it, you buy it
  • We dont have replacements, sorry
  • Return
  • Due back by the final
  • Otherwise we dont grade your final

6
Lab 4 Solution (1)
module Lab4PeakDetector(In, Peak, Clock,
Reset) input 30 In output Peak input
Clock, Reset wire GreaterEqual reg Peak
Lab4Comp4 C( .A( Peak), .B( In), .Gre
aterEqual( GreaterEqual)) always _at_ (posedge
Clock) begin if (Reset) Peak lt 4'h0 else
if (GreaterEqual) Peak lt In end endmodule
30 30
7
Lab 4 Solution (2)
  • FSM Debugging
  • Both FSMs were almost Moore
  • Youll build a lot of these
  • Check for this CAREFULLY in your code
  • Reading Logic Analyzer
  • Look at the falling edges
  • This avoids clock-to-output delay
  • Easier to read
  • CurrentState, Input, Output on THIS CYCLE
  • NextState is the NEXT CurrentState

8
Project Overview (1)
  • Electronic Etch-a-sketch
  • Knobs -gt N64 Controller
  • Monochrome screen -gt Multicolor LCD
  • Highlights
  • N64 Controller
  • NTSC (TV) Video Output
  • SDRAM
  • Paint Engine

9
Project Overview (2)
10
Project Overview (3)
  • N64 Input
  • NTSC Output
  • SDRAM
  • Paint Engine
  • Paint Engine -gt SDRAM Interface

11
Project Overview (4)
12
Project Overview (5)
  • Checkpoints
  • Require more design work than labs
  • Were not telling you exactly what to do
  • Part of your project
  • Design them well
  • Test modules thoroughly!
  • Dont lose your code
  • Require more time

13
Checkpoint 1 N64 (1)
  • Primary input for your project
  • Direction Buttons Move cursor, paint
  • Analog Joystick Move cursor, paint
  • Other Buttons
  • Change color
  • Change brush size
  • Extra features, bells and whistles

14
Checkpoint 1 N64 (2)
  • I/O Controller
  • Precise timing requirements
  • You have to match a real piece of hardware
  • You cant change both ends of the problem
  • Hard to simulate
  • You may want to build a model controller
  • We would give you one, but its basically the
    solution with minor changes
  • Hint hint

15
Button Parse (1)
  • Real World Inputs
  • Problem
  • Circuits are fast (27MHz)
  • Humans are slow (100Hz)
  • Mechanical switches are very imperfect
  • Solution
  • Take very long (10ms), very bouncy pulses
  • Clean them up
  • Generate one cycle pulses (1b0, 1b1, 1b0)

16
Button Parse (2)
17
Button Parse (3)
18
Button Parse (4)
19
Button Parse (5)
20
N64 Controller (1)
  • Functionality
  • Fancy Parallel lt-gt Serial Conversion
  • Single bi-directional wire to N64 Controller
  • Core of this module is a Shift Register
  • Polling
  • N64 uses Challenge/Response
  • We send a command, it responds
  • Might need a little state (send/receive)

21
N64 Controller (2)
  • Construction
  • Components
  • Shift Register
  • FSM/State Register
  • What else?
  • Plan your design out in DETAIL

22
N64 Commands (1)
  • Available Commands
  • 8hFF Reset Controller
  • 8h00 Get Status
  • 8h01 Read Buttons
  • 8h02 Read Mempack
  • 8h03 Write Mempack
  • 8h04 Read EEPROM
  • 8h05 Write EEPROM

23
N64 Commands (2)
  • Command Format
  • 8bits of Command
  • 1-bit Stop Bit (1b1)
  • Example
  • Read Buttons 9b000000011
  • How do we generate this?
  • Shift Register
  • Something better

24
N64 Bit Timing (1)
25
N64 Bit Timing (2)
  • Read Buttons Command
  • 8bits of Command 8h01
  • 1bit Stop Marker 1b1

26
N64 Receive (1)
  • Points to Consider
  • Reliability
  • The N64 controllers are NOT 100 reliable
  • Your circuit must be
  • Timing
  • This is not a synchronous design
  • The controller has its own clock
  • We must detect new bits
  • A major part of this design is timing!

27
N64 Receive (2)
  • Detecting a new bit
  • Look for 1b1 (Stop sub-bit) -gt 1b0 (Start
    sub-bit)
  • Falling Edge Detector
  • Wait 1us
  • Capture Data

28
N64 Receive (3)
  • What if we never get another bit
  • Detection
  • Falling edge never happens
  • How do we detect an event that never happens?
  • Recovery
  • Cant wait forever, game will lock up
  • Should reset the controller
  • Should re-request the button status
  • You MUST recover from this condition!

29
N64 Transmit (1)
  • For Each Bit
  • Count 1us (1 sub-bit), Transmit 1b0
  • Count 1us (1 sub-bit), Transmit Data
  • Count 1us (1 sub-bit), Transmit Data
  • Count 1us (1 sub-bit), Transmit 1b1
  • Timing
  • Were driving the bus not a problem
  • Still very important

30
N64 Transmit (2)
31
N64 Testing
  • Required
  • Your circuit must work on board reliably
  • Look at our demo
  • Recommended Testing
  • Build a testbench model of the controller
  • Symmetric Protocol
  • Bits out look like bits in
  • Just a different number of bits
  • Modify your solution
Write a Comment
User Comments (0)
About PowerShow.com