Top Banner
CS150 Project Checkpoint 1
22

CS150 Project Checkpoint 1. Controller Interface Dreamkatz Controller Interface 1. The N64 Controller 2. Physical interface 3. Communication protocol.

Dec 20, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CS150 Project Checkpoint 1. Controller Interface Dreamkatz Controller Interface 1. The N64 Controller 2. Physical interface 3. Communication protocol.

CS150 ProjectCheckpoint 1

Page 2: CS150 Project Checkpoint 1. Controller Interface Dreamkatz Controller Interface 1. The N64 Controller 2. Physical interface 3. Communication protocol.

Dreamkatz Controller Controller InterfaceInterface

1.1.The N64 ControllerThe N64 Controller2.2.Physical interfacePhysical interface3.3.Communication protocolCommunication protocol4.4.Design structure and FSMDesign structure and FSM5.5.Design implementationDesign implementation6.6.Hints & cautionsHints & cautions

Page 3: CS150 Project Checkpoint 1. Controller Interface Dreamkatz Controller Interface 1. The N64 Controller 2. Physical interface 3. Communication protocol.
Page 4: CS150 Project Checkpoint 1. Controller Interface Dreamkatz Controller Interface 1. The N64 Controller 2. Physical interface 3. Communication protocol.

The Nintendo 64 The Nintendo 64 controllercontroller

The Dreamkatz Controller has 9 action buttons, a digital directional pad and an analog stick.

Fits nicely in the average person’s hand

The original connector end have been replaced with a DreamKatz compatible plug.

Has 3 pins: VCC, GND, DATA

Page 5: CS150 Project Checkpoint 1. Controller Interface Dreamkatz Controller Interface 1. The N64 Controller 2. Physical interface 3. Communication protocol.

Dreamkatz Controller Controller InterfaceInterface

1.1.The N64 ControllerThe N64 Controller

2.2.Physical interfacePhysical interface3.3.Communication protocolCommunication protocol4.4.Design structure and FSMDesign structure and FSM5.5.Design implementationDesign implementation6.6.Hints & cautionsHints & cautions

Page 6: CS150 Project Checkpoint 1. Controller Interface Dreamkatz Controller Interface 1. The N64 Controller 2. Physical interface 3. Communication protocol.

Establishing the physical Establishing the physical interface: interface: wire wrappingwire wrapping

Materials needed: wire wrap, wire wrap tool, and a little practice.

Wire wraps available from the IEEE office at 204a Cory. (Next door)

Pick three consecutive pins where controller will connect to.

Wire wrap according the diagram on the right.

Wrapping End Unwrapping End

Hole for Wire

Hole for Pin

Slot for Wire

Wire Stripper

three consecutive pins

GND P41 VCC

Page 7: CS150 Project Checkpoint 1. Controller Interface Dreamkatz Controller Interface 1. The N64 Controller 2. Physical interface 3. Communication protocol.

Dreamkatz Controller Controller InterfaceInterface

1.1. The N64 ControllerThe N64 Controller2.2. Physical interfacePhysical interface

3.3.Communication Communication protocolprotocol

4.4. Design structure and FSMDesign structure and FSM5.5. Design implementationDesign implementation6.6. Hints & cautionsHints & cautions

Page 8: CS150 Project Checkpoint 1. Controller Interface Dreamkatz Controller Interface 1. The N64 Controller 2. Physical interface 3. Communication protocol.

Establishing data Establishing data communication:communication:Protocol Specifications Part IProtocol Specifications Part I

One data line means it handles receiving and transmitting serially. The way you had input data into your LFSRs from a ROM this week is an example of a serial input.

Board sends a request and controller responds with its status.

000000011…

1 s 3 s

logic 11 s3 s

logic 0

Data line when IDLE, is high.

Bits are encoded, each 4us long:

Page 9: CS150 Project Checkpoint 1. Controller Interface Dreamkatz Controller Interface 1. The N64 Controller 2. Physical interface 3. Communication protocol.

Establishing data Establishing data communication:communication:Protocol Specifications Part IIProtocol Specifications Part II

Example, the above sequence is 0x01. This happens to be the request byte.Notice transmission always begins with a falling edge.MSB of the data is sent out first. The last bit is always a stop bit.After the request byte is sent, the controller will respond with a 32 bits of data and also a stop bit.Basically, each bit will correspond to a button.

0 0 0 0 0 0 0 1 stop bit

MSB first

Page 10: CS150 Project Checkpoint 1. Controller Interface Dreamkatz Controller Interface 1. The N64 Controller 2. Physical interface 3. Communication protocol.

Dreamkatz Controller Controller InterfaceInterface

1.1. The N64 ControllerThe N64 Controller2.2. Physical interfacePhysical interface3.3. Communication protocolCommunication protocol

4.4.Design structure and Design structure and FSMFSM

5.5. Design implementationDesign implementation6.6. Hints & cautionsHints & cautions

Page 11: CS150 Project Checkpoint 1. Controller Interface Dreamkatz Controller Interface 1. The N64 Controller 2. Physical interface 3. Communication protocol.

Design StructureDesign Structure

Three main blocks:Three main blocks:

Page 12: CS150 Project Checkpoint 1. Controller Interface Dreamkatz Controller Interface 1. The N64 Controller 2. Physical interface 3. Communication protocol.

Controller FSMController FSM

IDLE

REQUESTREQUEST

RECEIVINRECEIVING DATAG DATA

sub-FSM

sub-FSM

Page 13: CS150 Project Checkpoint 1. Controller Interface Dreamkatz Controller Interface 1. The N64 Controller 2. Physical interface 3. Communication protocol.

FSM TimingFSM Timing

Top-level FSM should cycle every 1ms as shown above.

We are basically polling the controller.

Thus, the idea is we have updated info on the controller button status every 1ms.

Page 14: CS150 Project Checkpoint 1. Controller Interface Dreamkatz Controller Interface 1. The N64 Controller 2. Physical interface 3. Communication protocol.

Transmission Timing Transmission Timing Transmitting should be done in the request state. The byte we send is always the request byte, 0x01.How to generate logic 1 and logic 0? 4Mhz clock each clock cycle lasts 250ns.Thus, logic 0: 12 cycles low, 4 cycles highThere is no idle time between consecutive bits.Remember: 9th bit must be a stop bit

Receiving is much trickier.

logic 0

4 us

000000011…

000000011…

Page 15: CS150 Project Checkpoint 1. Controller Interface Dreamkatz Controller Interface 1. The N64 Controller 2. Physical interface 3. Communication protocol.

Super-samplingSuper-sampling

Data rate is 250Khz, can we just stick the data wire to a shift register running on a 250Khz clock? NO

!Have to worry about phase shifts!

Serialdata input

Sample Here

Imagine the waveform going into your flipflops are all shifted in time!Communication between devices running on different clocks requires a special mechanism to synchronize receiving, known as SUPERSAMPLING.Watch the incoming wire at 16 times the send rate. (4Mhz vs. 250Khz)

Page 16: CS150 Project Checkpoint 1. Controller Interface Dreamkatz Controller Interface 1. The N64 Controller 2. Physical interface 3. Communication protocol.

Receive TimingReceive Timing

Line when idle is high. The start of a data stream is characterized by a falling edge.We can use that edge for synchronization.Count 5 or 6 4Mhz clock cycles after a falling edge run and then sample the wire.`

start of bitstart of bit start of next start of next bitbit

supersample interval = 250 ns

(4mhz clock)

sample sample herehere

Logic 1

Logic 0

Page 17: CS150 Project Checkpoint 1. Controller Interface Dreamkatz Controller Interface 1. The N64 Controller 2. Physical interface 3. Communication protocol.

Quick pause… questions?Quick pause… questions?

Page 18: CS150 Project Checkpoint 1. Controller Interface Dreamkatz Controller Interface 1. The N64 Controller 2. Physical interface 3. Communication protocol.

Dreamkatz Controller Controller InterfaceInterface

1.1. The N64 ControllerThe N64 Controller2.2. Physical interfacePhysical interface3.3. Communication protocolCommunication protocol4.4. Design structure and FSMDesign structure and FSM

5.5.Design Design implementationimplementation

6.6. Hints & cautionsHints & cautions

Page 19: CS150 Project Checkpoint 1. Controller Interface Dreamkatz Controller Interface 1. The N64 Controller 2. Physical interface 3. Communication protocol.

IO Block

Make sure there’s always a BUF corresponding to the type of PAD connected.

I/O Block & Clock dividerI/O Block & Clock divider

Clock divider

A counter can divide clocks by multiples of 2.Make sure you use a BUFG before sending the clock out.

Page 20: CS150 Project Checkpoint 1. Controller Interface Dreamkatz Controller Interface 1. The N64 Controller 2. Physical interface 3. Communication protocol.

Controller BlockController Block

Recall that P41 is wired wrapped to the data line.

And also that it serves as input and output of bits.

What’s problem if

Page 21: CS150 Project Checkpoint 1. Controller Interface Dreamkatz Controller Interface 1. The N64 Controller 2. Physical interface 3. Communication protocol.

HintsHints & & CautionsCautions

Counters! Shift registers! Counters! Shift registers!

Avoid the use of copy and paste in your schematics, ESPECIALLY IPADs and OPADs.

Oscilloscope…knows all.(Unless its probes are broken…)

Page 22: CS150 Project Checkpoint 1. Controller Interface Dreamkatz Controller Interface 1. The N64 Controller 2. Physical interface 3. Communication protocol.