Arduino to Commodore User Port

I'm brand new to the world of Arduino (and electronics in general), approaching from a background in programming

I'm attempting to interface a Duemilanove to the USER PORT of a Commodore PET 4032. Eight of the port's bottom pins interface with a MOS6522 VIA and act as a parallel TTL input (when the data direction register is configured as such). The pins are pulled-up while in input mode. To represent a logical 0, a pin is to be coupled to ground.

I've connected each user port pin to an Arduino digital pin (2 through 9). Writing a LOW to any one of them has no effect. Am I oversimplifying the interface? Do I need to throw a driver (a la 74LS244) between the PET's port and Arduino's digital pins?

Sounds like you neglected to connect the ground on the PET to the ground on the Arduino.

No, I did that. I neglected to mention it.

Writing a LOW to any one of them has no effect.

What do you mean by this? are you writing low from the arduino or from the PET?
Have you initialised the 6522 in the PET to be inputs or outputs?

If it's inputs have you tried just reading the port and putting a wire to ground on the input lines to see if you can read that?

You don't need any extra hardware but you will need some software.


  1. I'm writing LOW to the Arduino pins. They are configured as outputs and working fine, confirmed.

  2. I've configured the data direction register on the 6522 to treat the user port pins as inputs.

  3. Yes, I've tried grounding the PET's pins directly (both to the port's own gnd pin and the Arduino's two gnd pins, individually) and I can read the bit changes successfully. No problem there.

Perhaps the Arduino's io pins can't sink the user port's pins completely?

Perhaps the Arduino's io pins can't sink the user port's pins completely?

No defiantly not, the PET uses a CMOS interface chip that is nothing in comparison to what the arduino will sink.

If point 3 is really true then it has to be a grounding issue between arduino and PET. I know you said these are connected but is there any chance there could be a misidentification of something.
You could try putting an LED on one of the inputs and see if you are able to toggle it.


If it's true that the Arduino can't sink the 6522 data pins, then wouldn't that explain why this isn't working?

Today, I tried connecting one of the user port pins to a switching transistor driven by an Arduino pin and grounded by the user port gnd, and it worked.

Thanks for your insight, by the way. I really appreciate it.


If it's true that the Arduino can't sink the 6522 data pins,

No it is not true, it's not what I said.

Glad you got it working but there should be no need for a transistor.

One thing you haven't shown is your code on the Arduino...I do find the whole situation odd, though...


@Mike: Sorry, I misconstrued your reply regarding sinking. Now I see what you mean.

@cr0sh: Your post inspired me to start from scratch. I'm thrilled to say it's working now with no additional components. My head was so deep into the hardware, I neglected my software instincts!

Thanks for the hand, fellas!

I too have a C64. I also have two supposedly nonfunctioning 1541 drives, unfortunately. However, since I only have one C64 and have never tried a guaranteed working drive, I don't know if my drives are at fault or the controller is. Has someone made an Arduino program to communicate with a 1541 drive? This system would be more compatible with today's computers, as I don't know of many laptops and even desktops with parallel ports nowadays. The XCable uses the parallel port, as you might know. Sorry to be slightly off-topic.


I have a sneaking suspicion that someone didn't configure there arduino pin as an output...

pat :wink: