gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

OffTopic > NES controller speed?

#56046 - Abscissa - Wed Oct 05, 2005 6:48 pm

(I guess this is rather offtopic for a GBA board, but I don't know where any of the NES scene is, and I'd think there'd probably be some NES people here anyway.)

Does anyone know how fast the NES polls the controller? ie, how fast the strobe pin gets cycled? (Or is it entirely software-controlled?)
_________________
Useless Rants a.k.a. My futile attempts at rationalizing my unreasonable reluctance to call my site a 'blog'.

#56059 - Joat - Wed Oct 05, 2005 8:41 pm

Software controlled, although the vast, vast majority of games poll once per frame (~60 Hz).
_________________
Joat
http://www.bottledlight.com

#56063 - Abscissa - Wed Oct 05, 2005 8:53 pm

Well, what I'm really trying to get at is the time time it takes each bit (since it's serial) to get transfered during any given poll. In other words: the fastest that the strobe pin gets toggled.

Sample ASCII-art waveform to illustrate (Need to view at 1024x768 or higher):
Code:

              Frame 1                                  Frame 2     

      A   B  Sel Strt U   D   L   R           A   B  Sel Strt U   D   L   R
      _   _   _   _   _   _   _   _           _   _   _   _   _   _   _   _
_____/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_________/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_____

         |_|                        |_______________________________________|
          |                                              |
   Speed of this is...?                      1 frame, 60 Hz, or ~17ms

_________________
Useless Rants a.k.a. My futile attempts at rationalizing my unreasonable reluctance to call my site a 'blog'.

#56066 - tepples - Wed Oct 05, 2005 9:12 pm

The NES controller is software polled. The NES runs at a clock speed of 1.8 MHz. In theory, controllers have to be able to respond once every 4 cycles, although real games won't read faster than 8 cycles per read.

Are you trying to make an NES controller to GBA link port adapter? That's already been done, as the Super NES controller is just an NES controller with more buttons, and SNES Advance already supports the Super NES controller. For best reliability, you might want a level converter (GBA 3.3V vs. NES/Super NES 5.0V) in the middle of your cable.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#56082 - Abscissa - Wed Oct 05, 2005 10:24 pm

tepples wrote:
Are you trying to make an NES controller to GBA link port adapter? That's already been done, as the Super NES controller is just an NES controller with more buttons, and SNES Advance already supports the Super NES controller. For best reliability, you might want a level converter (GBA 3.3V vs. NES/Super NES 5.0V) in the middle of your cable.

Oh, heh heh, no it's actually an extremely roundabout question, involving nuerous different platforms. Very very, VERY roundabout ;). Story time:

A few months ago I converted an NES controller into an Atari 2600 controller. In the process I needed to desolder the chip in the NES controller. I had never desoldered a component before, so I was curious whether or not I had overheated and destroyed the chip in the process. So I breadboarded an ad-hoc NES controller using the chip I had taken out of the real NES controller. My ad-hoc controller *sort of* worked, but every once in a while all the buttons would "shift places". Musical chairs, basically. So in the end I didn't know if it was *partially* damaged (if that's posible), or if the breadboard jumper wires I was using were long enough that signals weren't moving fast enough causing timing errors. If I'd had a known working chip of the same kind, I could have swapped it in to check, but I didn't have another one.

Fast forward to this week, and I'm building a parallel port programmer for an EEPROM I'm going to use on this Atari cart PCB. Normally, the EEPROM I'm using would take a couple of minutes to program (up to 10ms per byte), but if I can make my circuit (and the parallel port - but that's another story) push signals around fast enough, than I can take advantage of the EEPROM's paged-write mode which would let me program the chip as fast as two seconds (It allows 10ms per 64-bytes written instead of 10ms per 1-byte).

So...if my wires WERE slowing signals down and causing timing problems AND the NES controller normally operates at around the same speed or slower than what I'll need to use for my EEPROM burner, than I'd know I might run into problems attempting to use the super-fast paged-write programming mode.

Whew! That was a mouthful. Everybody got all of that? ;)

So yea, this doesn't really have anything to do with the GBA, but like I said, I'm not sure where to to find NES-hack/homebrew forums to ask about the timing and figured some of the GBA people here might know about the NES.
_________________
Useless Rants a.k.a. My futile attempts at rationalizing my unreasonable reluctance to call my site a 'blog'.

#56091 - tepples - Thu Oct 06, 2005 12:23 am

Abscissa wrote:
So yea, this doesn't really have anything to do with the GBA, but like I said, I'm not sure where to to find NES-hack/homebrew forums to ask about the timing and figured some of the GBA people here might know about the NES.

I'm also a regular on the NESdev board at nesdev.parodius.com, so you made a lucky guess.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.