Detection of Family BASIC keyboard possible?

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

Post Reply
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Detection of Family BASIC keyboard possible?

Post by rainwarrior »

Is it possible to detect for the presence or absence of a Family BASIC keyboard without user interaction? I don't see anything in the interface described on the Wiki that would produce a detectable signature.

I could assume it's there, by default, but I don't like that this could conflict with an expansion controller on the second D1 line. The alternative question is whether I can detect the absence of a controller on D1?

Also assuming PowerPak / Everdrive could be in the mix here, though I also assume D1 is already pulled down to 0 when not connected regardless?

The backup plan is just letting the user choose manually, but I just want to know if I'm missing something that would make it easier.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Detection of Family BASIC keyboard possible?

Post by lidnariq »

You should be able to use the "enable keyboard matrix" to detect it.

When it's disabled, the resistor array pulls the matrix all high, and the CD4019 will relay that, and then the 74'368 will return logical 0 when you read from it.

When it's enabled, the resistor array pulls the matrix low, except for whatever buttons are pressed, the CD4019 will relay the low voltage, and the 74'368 will return logical 1 for any buttons that aren't pressed.
User avatar
rainwarrior
Posts: 8734
Joined: Sun Jan 22, 2012 12:03 pm
Location: Canada
Contact:

Re: Detection of Family BASIC keyboard possible?

Post by rainwarrior »

Ah1 Thank you, I missed the line that said a held key is 0. Well that's easy then. :)
Post Reply