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?
I'm writing LOW to the Arduino pins. They are configured as outputs and working fine, confirmed.
I've configured the data direction register on the 6522 to treat the user port pins as inputs.
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.
@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!
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.