Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,497,086
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 04-28-24 06:14 PM
Guest: Register | Login

0 users currently in General Chat | 1 guest

Main - General Chat - Playing around with electronics New thread | New reply


Sukasa
Posted on 09-24-09 06:56 PM Link | Quote | ID: 116043


Red Birdo
Level: 92

Posts: 2003/2112
EXP: 7690777
Next: 66160

Since: 02-19-07

Last post: 4450 days
Last view: 3222 days

Bukkarooo
Posted on 09-25-09 12:20 AM Link | Quote | ID: 116073


Fuzzy
Son of a bitch, I'm sick of these dolphins...
Level: 59

Posts: 655/778
EXP: 1634703
Next: 38425

Since: 10-15-08
From: Florida

Last post: 5186 days
Last view: 4953 days




Pretty nifty, though I don't see a lot of utility in it.

____________________



Layout made by Stark.





boingboingsplat
Posted on 09-25-09 01:20 AM Link | Quote | ID: 116084


Giant Koopa
[PREFSTRING:wonderful bounciness]
Level: 74

Posts: 1019/1292
EXP: 3634402
Next: 19142

Since: 07-23-07
From: Michicola

Last post: 4844 days
Last view: 4807 days
I've been wanting to get an old SNES controller and rip it apart, put some memory in it, make it USB so I can store an Emulator+Roms on it, and essentially have a plug and play SNES.

That would be so cool.

____________________
 

Sukasa
Posted on 09-25-09 01:28 AM Link | Quote | ID: 116087


Red Birdo
Level: 92

Posts: 2015/2112
EXP: 7690777
Next: 66160

Since: 02-19-07

Last post: 4450 days
Last view: 3222 days
The biggest utility in this is that it basically gives me 12 control buttons, for the price of 3 pins.

Not bad considering I have only 16 pins in total to work with. I could probably even make this PC-compatible using some extra code.

Bukkarooo
Posted on 09-25-09 01:43 AM Link | Quote | ID: 116090


Fuzzy
Son of a bitch, I'm sick of these dolphins...
Level: 59

Posts: 658/778
EXP: 1634703
Next: 38425

Since: 10-15-08
From: Florida

Last post: 5186 days
Last view: 4953 days




Posted by Sukasa
The biggest utility in this is that it basically gives me 12 control buttons, for the price of 3 pins.

Not bad considering I have only 16 pins in total to work with. I could probably even make this PC-compatible using some extra code.


oooh, I hadn't noticed that. very nice. I just saw that it was an SNES controller hooked up to an LCD screen that showed when the buttons were pressed hehe

____________________



Layout made by Stark.





Sukasa
Posted on 09-25-09 07:51 AM (rev. 3 of 09-25-09 07:57 AM) Link | Quote | ID: 116111


Red Birdo
Level: 92

Posts: 2016/2112
EXP: 7690777
Next: 66160

Since: 02-19-07

Last post: 4450 days
Last view: 3222 days
Here's the basic read-controller function
DataLine    PIN 2
LoopCounter VAR Nib ' 0 1 2 3 4 5 6 7 8 9 A B
Buttons VAR Bit(12) ' B Y Sl St ^ v < > A X L R
' A B C D E F G H I J K L

'Pins 0, 1 output to SNES controller
'Pin 2 is input from controller
DIRS = %0000000000000011 //Set the I/O pints
DO
HIGH 1 'Pulse Load (SNES Pin 5)
LOW 1
FOR LoopCounter = 0 to 11
Buttons(LoopCounter) = 1 - DataLine 'Read Button State (SNES Pin 4)
HIGH 0 'Pulse Clock (SNES Pin 6)
LOW 0
NEXT
LOOP
END


I clipped out the LCD code and unused stuff to make it easier to understand.

Here's the full code file:

'{$STAMP BS2}
'{$PBASIC 2.5}


'READSNES1.bs2 - Reads button input from a normal Super Nintendo controller and outputs the state of the twelve buttons on it
'to an LCD display.

'WIRE AS FOLLOWS:

'Pin0 - Connect to Clock pin on SNES controller (Pin 6)
'Pin1 - Connect to P/S (Load) pin on SNES controller (Pin 5)
'Pin2 - Connect to Data pin on SNES controller (Pin 4)
'Pin5 - Connect to RX on LCD screen (Set to 19200 baud)

'Connect pin 7 of SNES controller to Vdd (Last pin on square end of connector)
'Connect Pin 1 of SNES Controller to Vss (Last pin on rounded end of connector)
'Connect LCD to Vss and Vdd as per LCD wiring schematic

DataLine PIN 2
LoopCounter VAR Nib ' 0 1 2 3 4 5 6 7 8 9 A B
Buttons VAR Bit(12) ' B Y Sl St ^ v < > A X L R
LED0 PIN 3 ' A B C D E F G H I J K L
LED1 PIN 4
'Pins 0, 1 output to SNES controller
'Pin 2 is input from controller
'Pins 3, 4 are output to LEDs
DIRS = %0000000000011011

SEROUT 5, 32, 5, [$FE, $80, $FE, $80, $FE, $80, $FE, $80, $FE, $80]
SEROUT 5, 32, 5, [$FE, $16, $FE, $16, $FE, $16, $FE, $16, $FE, $16]

DO
HIGH 1 'Pulse Load (SNES Pin 5)
LOW 1
FOR LoopCounter = 0 to 11
IF DataLine = Buttons(LoopCounter) THEN
IF DataLine THEN
BRANCH LoopCounter, [BPressed, YPressed, SlPressed, StPressed, UpPressed, DownPressed, LeftPressed, RightPressed, APressed, XPressed, LPressed, RPressed]
ENDIF
ENDIF
ContinueLoop:
Buttons(LoopCounter) = 1 - DataLine 'Read Button State (SNES Pin 4)
SEROUT 5, 32, [32 + Buttons(LoopCounter)]
HIGH 0 'Pulse Clock (SNES Pin 6)
LOW 0
NEXT
SEROUT 5,32,[$20,$20,$20,$20,"BYST^v<>AXLR",$20,$20,$20,$20]
LOOP
END

BPressed:
GOTO ContinueLoop

YPressed:
GOTO ContinueLoop

SlPressed:
GOTO ContinueLoop

StPressed:
GOTO ContinueLoop

UpPressed:
GOTO ContinueLoop

DownPressed:
GOTO ContinueLoop

LeftPressed:
GOTO ContinueLoop

RightPressed:
GOTO ContinueLoop

APressed:
GOTO ContinueLoop

XPressed:
GOTO ContinueLoop

LPressed:
GOTO ContinueLoop

RPressed:
GOTO ContinueLoop

blackhole89
Posted on 09-25-09 10:40 AM Link | Quote | ID: 116112


The Guardian
Moloch whose eyes are a thousand blind windows!
Level: 124

Posts: 2682/4196
EXP: 21536897
Next: 299704

Since: 02-19-07
From: Ithaca, NY, US

Last post: 473 days
Last view: 86 days



What hardware are you using to do that? I've heard of some microcontrollers that have a BASIC interpreter included, but then, you might just as well be using one of those PC serial or parallel port based tinkering kits with an appropriate binding.

____________________



Sukasa
Posted on 09-25-09 06:12 PM Link | Quote | ID: 116121


Red Birdo
Level: 92

Posts: 2017/2112
EXP: 7690777
Next: 66160

Since: 02-19-07

Last post: 4450 days
Last view: 3222 days
A Basic Stamp II mounted on a Board of Education, USB variant. I got it as part of a kit for my engineering class, I might have to look at getting my own at some point since I'll be returning this one at the end of the semester

jargon
Posted on 09-28-09 11:45 AM (rev. 2 of 09-28-09 11:48 AM) Link | Quote | ID: 116287


Ninji
Banned until 2010-10-15 for an utterly psychedelic posting style
Level: 36

Posts: 191/247
EXP: 300298
Next: 7812

Since: 12-10-07
From: 480/85260

Last post: 4951 days
Last view: 4609 days
Posted by Sukasa
A Basic Stamp II mounted on a Board of Education, USB variant. I got it as part of a kit for my engineering class, I might have to look at getting my own at some point since I'll be returning this one at the end of the semester


This is a chip that interprets BASIC? If it is, that is pretty nifty!

____________________
NIHYFDTTMWTMR

Sukasa
Posted on 09-28-09 04:25 PM Link | Quote | ID: 116296


Red Birdo
Level: 92

Posts: 2020/2112
EXP: 7690777
Next: 66160

Since: 02-19-07

Last post: 4450 days
Last view: 3222 days
Tokenized PBASIC, yes.

TheGigaParagoomba
Posted on 10-09-09 07:23 PM Link | Quote | ID: 116795


Goomba
Level: 15

Posts: 25/34
EXP: 14453
Next: 1931

Since: 10-09-09
From: Time'n'space

Last post: 5314 days
Last view: 5249 days
Cool!

____________________
Call me when you see fungi with angel wings ok!

Main - General Chat - Playing around with electronics New thread | New reply

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.026 seconds. (323KB of memory used)
MySQL - queries: 82, rows: 101/102, time: 0.016 seconds.