Current levels on joystick port

Modding and Technical Issues

Moderator: Moderators

Post Reply
patrickm
Vic 20 Newbie
Posts: 6
Joined: Thu Jan 21, 2021 7:59 pm
Location: Canada

Current levels on joystick port

Post by patrickm »

Hi,

While making my own controller, I decided to measure the current levels on the joystick port.

For joy0, joy1, joy2 and the fire button, I measure between 0.8mA to 0.9mA when connected to ground. But for joy3, I measure 3.1mA, which is significantly more.

Does anyone know what reasonable values should be? Could this be a sign that something is failing?
User avatar
Mike
Herr VC
Posts: 4841
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Current levels on joystick port

Post by Mike »

Joy3 has a dedicated connection to the other 6522 VIA, on port B. Port B is capable of sourcing more current, and normally, this pin also is set to output. Joystick routines temporarily do a POKE37154,127 to make this an input pin and then a POKE37154,255 to restore to default, otherwise the keyboard scan does not work correctly.

You could try POKE37154,127 in direct mode to see if this reduces the current. With STOP/RESTORE you can reinit the register.
patrickm
Vic 20 Newbie
Posts: 6
Joined: Thu Jan 21, 2021 7:59 pm
Location: Canada

Re: Current levels on joystick port

Post by patrickm »

Thanks. The poke did the trick.

The measured current is now much closer to the others at 0.95mA.
User avatar
Mike
Herr VC
Posts: 4841
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Current levels on joystick port

Post by Mike »

Nice! :D

BTW, we discussed the current sourcing/sinking capability of VIA port B some time ago here in Denial when it was used to operate a 4 bit D/A-converter, see here: User port sound.

Here's the relevant schematic in the data sheet:

Image

Note the switching FET to the left of the pull-up FET.
Post Reply