Because the joystick port requires a variable resistance rather than a voltage this isn't overly simple. A digital pot is the easiest way as you have already found. You could use the PIC's PWM, (low pass filitered) to drive a FET which will operate as a crude voltage controlled resistor. Linearity should be reasonable, but it will have a fairly high temperature coefficient. Take a look at http://www.vishay.com/document/70598/70598.pdf for lots of information on using FET's as voltage controlled resistors. Regards Mike > -----Original Message----- > From: BBJ [SMTP:bbj@plz.co.za] > Sent: Friday, May 10, 2002 6:02 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: [pic]: Analog values using PWM > > I have an application that uses the joystick ports on a pic to read values > on 4 20K pots. > > apart form using digital pots, which i may very well have to use, how can > i > simulate the pot values with a PIC ( some PWM ?? ) ?? > > Accuracy is not THAT important, as i think the A/D on the joystick port > isnt all that acurate anyway. I do however need decent linearity. > > The end result is a pic will receive a signal via rs485 that it must then > "send" to the joystick ports. I dont have access to the original pc side > program to change the way it works. > > Any ideas??? > > John > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body