首页 > 器件类别 > 开发板/开发套件/开发工具

32368

Daughter Cards & OEM Boards NES Gamepad Controller Adapter

器件类别:开发板/开发套件/开发工具   

厂商名称:Parallax

器件标准:

下载文档
32368 在线购买

供应商:

器件:32368

价格:-

最低购买:-

库存:点击查看

点击购买

器件参数
参数名称
属性值
Product Attribute
Attribute Value
制造商
Manufacturer
Parallax
产品种类
Product Category
Daughter Cards & OEM Boards
RoHS
Details
工厂包装数量
Factory Pack Quantity
1
单位重量
Unit Weight
0.863859 oz
文档预览
Web Site:
www.parallax.com
Forums:
forums.parallax.com
Sales:
sales@parallax.com
Technical:
support@parallax.com
Office:
(916) 624-8333
Fax:
(916) 624-8003
Sales:
(888) 512-1024
Tech Support:
(888) 997-8267
NES Gamepad Controller Adapter (#32368)
The NES Gamepad Controller Adapter is a printed circuit board with two Nintendo
®
gamepad compatible
sockets routed to a dual row of pins with breadboard spacing. This adapter makes it convenient to
connect up to two gamepad controllers to a breadboard for gamepad-controlled projects.
NOTE: This adapter is designed for gamepads only. It does not have signal lines for Nintendo Zappers
and Power Pads.
Features
Breadboard-friendly 0.1 inch pin spacing
Works great with Nintendo gamepad style controllers (#32365)
Plated holes for mounting in a project box
Two adjacent SIP headers for stability
Data connection indicator LEDs
Compatible with BASIC Stamp
®
, SX, and Propeller™ microcontrollers
Built-in series resistors protect 3.3 V Propeller I/O pin inputs
Key Specifications
Power requirements: +5 VDC, 25 mA
Communication: TTL synchronous serial
Dimensions: 3.1 x 1.6 x 0.91 in (79 x 41 x 23 mm)
Operating temperature: 32 to 131 °F (0 to 55 °C)
Application Ideas
Gamepad controlled robot
Gamepad controlled mechanical arm
Video game system on a breadboard
BASIC Stamp and Propeller are registered trademarks or trademarks of Parallax Inc. NES and Nintendo are registered trademarks
or trademarks of Nintendo of America Inc. All trademarks herein are the property of their respective owners.
Copyright © Parallax Inc.
NES Gamepad Controller Adapter (#32368)
v1.0 10/20/2009 Page 1 of 5
Quick Start Circuit
Figure 1 shows a schematic that can be used with
Nintendo gamepad controllers and the BASIC
Stamp 2 and Propeller test programs featured in
the Source Code section. P4 and P5 drive the
clock and latch lines. P6 receives data from
NES_SOCKET1, and P7 receives data from
NES_SOCKET2.
Figure 1: Quick Start Schematic
Connecting and Testing
Figure 2 shows test results for the BASIC Stamp and Propeller microcontrollers while they execute the
test programs featured in the Source Code section. Messages from the BASIC Stamp are displayed by
the Debug Terminal (left), and messages from the Propeller chip are displayed by the Parallax Serial
Terminal (right). The buttons from left to right are Right, Left, Down, Up, Start, Select, B, and A. When
one of those buttons is pressed and held, the corresponding bit displays a 0; otherwise, it displays a 1.
The AA button causes the A bit to cycle on/off while, and likewise with the BB button. The SLOW button
toggles the ST bit. Press it once, and the ST bit cycles on/off; press it again, and it returns to 1.
Figure 2: NES Controller Test Display
Build the circuit shown in Figure 1.
Download the Source Code from the 32368 product page at
www.parallax.com.
Load it into your microcontroller.
Use the Debug Terminal (BASIC Stamp) or the Parallax Serial Terminal (Propeller) to display the
status display from your microcontroller. See Figure 2.
Try pressing the buttons on the controller and examine the way each bit responds.
Copyright © Parallax Inc.
NES Gamepad Controller Adapter (#32368)
v1.0 10/20/2009 Page 2 of 5
Resources and Downloads
The NES Gamepad Controller Adapter product page has this PDF, source code, and a link to Chapter 6 in
the Hydra Game Development System manual for additional information about the Nintendo gamepad.
Go to www.parallax.com and “search” for 32368.
Device Information
Pin Definitions
Figure 3 shows the module pinout for the pin definitions listed in Table 1. Ratings are not listed because
they will be specific to the make and manufacture of the gamepad that gets connected to the adapter.
Table 1: Pin Definitions
Name
CLK
LATCH
DATA1
DATA2
+5V
GND
Clock input
Latch input
Data output for NES_SOCKET1
Data output for NES_SOCKET2
Positive 5 V supply connection
Ground 0 V supply connection
Function
Figure 3: Pinout
Communication Protocol
A pulse to the LATCH pin causes the gamepad to latch the button values and transmit the first (A button)
bit. The rising edges of the next seven clock pulses deliver the remaining bits (B through RIGHT
buttons). Although both data lines can be shifted in simultaneously, the microcontroller does not
necessarily have to record both data lines at once. For example, the BASIC Stamp 2 test code in the
source code section checks each DATA line individually with separate PULSOUT and SHIFTIN commands.
Note that since the first data value is available before the first clock pulse, the PBASIC SHIFTIN command
uses the LSBPRE argument to specify that the data line transmits the latest value as a pre-clock pulse.
Module Dimensions
Copyright © Parallax Inc.
NES Gamepad Controller Adapter (#32368)
v1.0 10/20/2009 Page 3 of 5
Source Code
BASIC Stamp
®
2 Program
' Test NES Controllers.bs2
' Display NES controller bit states, see Parallax NES Controller
' Adapter (Item# 32368) documentation at www.parallax.com.
' {$STAMP BS2}
' {$PBASIC 2.5}
value
VAR
Byte(2)
' BASIC Stamp 2 module
' PBASIC 2.5 language
' Store NES data
' Wait a second
' Display headings
PAUSE 1000
DEBUG "Socket1
"
SS
"RLDUTEBA
LOW 5
LOW 4
DO
Socket2", CR,
SS", CR,
RLDUTEBA", CR
' Initialize LATCH
' Initialize CLK
' Main loop
' Latch the data
' Shift in socket 1 data
' Latch the data
' Shift in socket 1 data
' Display values
PULSOUT 5, 10
SHIFTIN 6, 4, LSBPRE, [value(0) \8]
PULSOUT 5, 10
SHIFTIN 7, 4, LSBPRE, [Value(1) \8]
DEBUG CRSRXY, 0, 3, BIN8 value(0),
CRSRX, 11, BIN8 value(1)
LOOP
' Repeat main loop
Copyright © Parallax Inc.
NES Gamepad Controller Adapter (#32368)
v1.0 10/20/2009 Page 4 of 5
Propeller Test Application
''File: Test Two NES with PST.spin
''Test two NES controllers and display with Parallax Serial Terminal.
''Requires the NES.spin from John Abshier's NES Controller object. It's available from the
''Parallax Object Exchange at obex.parallax.com.
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
DATA2
DATA1
LATCH
CLK
=
=
=
=
7
6
5
4
' Constant declaration block
' 5 MHz crystal
80 MHz system clock
' I/O pin
'
'
'
'
'
'
(Vss)
& power connections
P7
────
DATA2
P6
────
DATA1
P5
────
CLK
P4
────
LATCH
5 V
────
+5V
GND
────
GND
OBJ
pst
nes[2]
: "Parallax Serial Terminal"
: "NES"
' Object declaration block
' Serial Terminal display
' NES object
'' Main method
' Start Parallax Serial Terminal
' Display headings
PUB Main | buttons[2], index, dataPin
' Initialize display
pst.Start(115200)
pst.Str(String("Socket1
pst.Str(String("
SS
pst.Str(String("RLDUTEBA
Socket2", pst#NL))
SS", pst#NL))
RLDUTEBA", pst#NL))
' Initialize NES Objects
repeat index from 0 to 1
dataPin := lookupz(index: DATA1, DATA2)
NES[index].Init(LATCH, datapin, CLK)
' Main Loop
repeat
pst.Home
repeat index from 0 to 1
buttons[index] := nes[index].buttons
pst.Position(11*index, 3)
pst.Bin(buttons[index], 8)
Pst.NewLine
waitcnt(clkfreq/10+cnt)
' Loop through 2 NES objects
' Get data pin
' Get type of game pad
'
'
'
'
Main loop
Cursor to top-left home position
Loop through 2 NES objects
Get button states from game pad
' Display button states
' Carriage return
' 1/10 s delay
Copyright © Parallax Inc.
NES Gamepad Controller Adapter (#32368)
v1.0 10/20/2009 Page 5 of 5
查看更多>
【Follow me第二季第1期】任务整合贴
# 【Follow me第二季第1期】任务整合贴 ## 物料介绍 1. Adafruit C...
eew_UqDS1M DigiKey得捷技术专区
单片机采用定时器模式输出PWM驱动直流电机
单片机采用定时器模式输出PWM驱动直流电机,如何才能将直流电机的噪音降至最低?就是PWM调速时候脉宽...
xingmiao 单片机
充电电流随VBUS变化太大问题
我做平板的最近用BQ24196这颗充电IC,但发现充电电流随VBUS变化很大,用直流电源模拟适...
yinjie889 电源技术
2812 无刷机的控制 ADC方面
关于这段程序我有一个不懂的地方,就是为什么DatQ15 = (AdcRegs.ADCRESU...
dzy 微控制器 MCU
炼狱传奇-倍频电路之战
炼狱传奇-倍频电路之战 炼狱传奇-倍频电路之战 炼狱传奇-倍频电路之战 炼狱传奇-倍频电路之...
zxopenljx FPGA/CPLD
CCS6.0问题
CCS6.0问题 CCS安装就是很蛋疼的,建议重装操作系统第一个装CCS,不然很难搞! 杀毒软件...
915709857 微控制器 MCU
热门器件
热门资源推荐
器件捷径:
L0 L1 L2 L3 L4 L5 L6 L7 L8 L9 LA LB LC LD LE LF LG LH LI LJ LK LL LM LN LO LP LQ LR LS LT LU LV LW LX LY LZ M0 M1 M2 M3 M4 M5 M6 M7 M8 M9 MA MB MC MD ME MF MG MH MI MJ MK ML MM MN MO MP MQ MR MS MT MU MV MW MX MY MZ N0 N1 N2 N3 N4 N5 N6 N7 N8 NA NB NC ND NE NF NG NH NI NJ NK NL NM NN NO NP NQ NR NS NT NU NV NX NZ O0 O1 O2 O3 OA OB OC OD OE OF OG OH OI OJ OK OL OM ON OP OQ OR OS OT OV OX OY OZ P0 P1 P2 P3 P4 P5 P6 P7 P8 P9 PA PB PC PD PE PF PG PH PI PJ PK PL PM PN PO PP PQ PR PS PT PU PV PW PX PY PZ Q1 Q2 Q3 Q4 Q5 Q6 Q8 Q9 QA QB QC QE QF QG QH QK QL QM QP QR QS QT QV QW QX QY R0 R1 R2 R3 R4 R5 R6 R7 R8 R9 RA RB RC RD RE RF RG RH RI RJ RK RL RM RN RO RP RQ RR RS RT RU RV RW RX RY RZ
需要登录后才可以下载。
登录取消