View Single Post
Old 02 March 2017, 14:16   #70
Registered User

MickGyver's Avatar
Join Date: Oct 2008
Location: Finland
Posts: 294
Originally Posted by robinsonb5 View Post
That's a great idea - but there are a couple of pitfalls to watch out for.
Because the Amiga's POTX/Y lines do double-duty as analogue input and digital IO they have unusual characteristics, and it's not uncommon for a microcontroller to be unable to pull those lines low enough for the Amiga to see a logic 0. You may need to factor an external transistor into your design.
(Actually, thinking about it, this same issue could be why your existing boards aren't working, if the shift register IC doesn't have exactly the same characteristics as the original?)
Thanks for the help! At the moment I'm thinking of only replacing the shift register with an Atmega microprosessor and leaving the tri-state buffer in place to have better compatibility. I have already have the CD32 gamepad working with the lines going directly to the microprocessor but it's not safe to do it this way because of the input/output on the same pin issue (this could do damage to the microprocessor or the Amiga). Also I'm only testing on my A500 at the moment, it's working on that but I guess the problem with logic zero can show up on other motherboards.

The current design is exactly the same as the small pcb I first made and is identical to the original CD32 gamepad circuitry, the only difference is that I use smd components, they are of the LS family though, as the original. For the first version I confirmed that 74HCT and 74LS worked, 74HC did not work (HC is CMOS, LS and HCT are TTL).

Originally Posted by robinsonb5 View Post
You'll also need to make sure your shift register reacts very quickly. I did something similar using a PIC once, but struggled to get it working quickly enough, especially once the extra delays from the external transistor were taken into account. Another interesting option is the Cypress PSOC chips - there's a low-end PSOC4 chip with an Arm M0 CPU and a small amount of programmable logic on board - so with that, it's possible to do the shift register in hardware, which relaxes the timing requirements on the software quite considerably.
In my experiments with the Atmega328 I have set up external interrupts for the clock and latch pins so it should react quite quickly to the clock. I do everything with setting the registers directly (not using the slow attachInterrupt and using direct port manipulation). First I was updating the shift data output on RISING edge but this wasn't reliable, instead updating the data on the FALLING edge of the clock seems to be reliable on the A500 at least, but haven't tried other software then JoyPortTest for the moment. JoyPortTest can work without lowlevel.lib, don't know what the practical difference is. I will look into the Cypress PSOC chips, sounds interesting, I will experiment with the Atmega now and see how it goes (I'm used to that processor).

Originally Posted by robinsonb5 View Post
Test widely, with as many different models of Amiga and as many different games as possible - there are many variants of the CD32 pad reading code out there, all with slightly different timing requirements!
Ok, good to know! I guess the timing for when sending the clock signals and reading the data can vary in the code. I have three CD32, two A1200 and three A500 machines I can test on here. Will test with different games also of course, I hope I will get this to work since I have some nice features I would like to implement!

Last edited by MickGyver; 02 March 2017 at 14:21.
MickGyver is offline  
Page generated in 0.03966 seconds with 10 queries