From: Scott McDonnell (netsamurai_at_comcast.net)
Date: 2007-04-10 18:25:40
Sure, just as a come up with some numbers! :) It's not perfect yet, but is working in simulation. The range is 2.9mA @ 5V to about 11uA @ 200mV. At 3mA, the 1nF cap would charge in one clock cycle, at 10uA it would take 256 clock cycles. (5V would equal 1 and 200mV would equal 255) The 270ohm (R1) resistor is meant to be the 250 ohms through the CD4066. The upper and lower limits are working, haven't looked at the linearity too much and need to tweak the circuit a bit. The circuit itself is very simple and uses a common 2N3904 NPN transistor with a hfe (beta) of about 300 typical. I wasn't able to get the full range until I figured out how to bias it correctly. As I said, it is working in simulation, need to do some "real world" experiments to see how it will really work. I am sure it could be done better, but this is a start. Preliminary, but here are the pics of the simulation: http://netsamurai.home.comcast.net/5v.png http://netsamurai.home.comcast.net/200mv.png Scott McDonnell > -----Original Message----- > From: owner-cbm-hackers@ling.gu.se > [mailto:owner-cbm-hackers@ling.gu.se] On Behalf Of Daniel O'Shea > Sent: Tuesday, April 10, 2007 9:50 AM > To: cbm-hackers@ling.gu.se > Subject: Re: Commodore joystick ports > > > Hársfalvi Levente wrote: > > Still, it should be easier to take the digital approach, > especially if > > the original form of your "0...5v signal" is digital. Todays cheap > > microcontrollers (Atmel AVRs especially) are fast and > flexible enough to > > create a precise converter (linear response, no jitter), > provided that > > you're goot at their assembly language. > > Köszönöm! > > Yes, I'm starting to think that a microcontroller might be the best > solution after all... what I'm trying to come up with is a > multi-purpose > 9-pin controller that I can use to interface with an XScale PXA270 > processor, but also maintain C64 compatibility as an > alternate function. > What's complicating things is that the C64 joystick port has all its > switches on the GND (0V) line, but the PXA270 direct-keypad interface > wants its switches on a 3.3V line... Which at first doesn't seem like > such a problem, until you want to start adding in variable voltage > sources that want a connection to ground and power, if the ground and > power lines are moving around! So now what I'm thinking is if I input > seven switches and two variable voltages to a > microcontroller, and then > have seven outputs from the microcontroller, with a jumper or toggle > switch connected to select between 0V and 3.3V mode, so then in 3.3V > mode the seven outputs would be: > > Up, Down, Left, Right, 3 buttons @ 3.3V (and X/Y variable voltage > sources which can bypass the microcontroller and be separately fed > directly to the PXA270, as it has its own ADC) > > ...and in 0V mode, the seven outputs would be: > > Up, Down, Left, Right, 1 button @ 0V and X/Y PWM outputs (here the > variable voltage sources are translated through the microcontroller's > ADC into PWM outputs for the C64) > > After a quick search I'm thinking a PIC16F87xA variant as it > has 10-bit > ADC inputs, and two 10-bit PWM outputs - does this seem > achievable? (is > the microcontroller's TTL I/O 3.3V?) thanks! > > Message was sent through the cbm-hackers mailing list > Message was sent through the cbm-hackers mailing list
Archive generated by hypermail pre-2.1.8.