![]() |
![]() |
![]() |
|
|
|||||||
| Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
I have only a week to do this, so I'm kinda getting desperate. However, I discussed it with my friend who is also interested in doing this conversion and found a pretty good example on how the app might work.
Plan A: PWM to Analog (Got it working to some degree, thanks guys. Plan B: Serial sending 4 bytes, each byte to be sent to a certain pin based on the order it is recieved. The process being: The strand of bits are loaded into a bucket 8 bits at a time, the bucket moves along a convayer belt to 4 seperate pipes. When the bucket is filled with 8 bits, it dumps the bits into the pipe and moves to the next pipe. As the bits flow down the pipe, they arive at a station where they are seperated and sent to a resistor tree, where the final analog voltage is sent to the designated pin. When the final byte is reached, the bucket goes back to the starting position and does it all over again, sending 4 bytes down 4 seperate pipes and 4 seperate analog pins on a common gameport. a.k.a. Serial to Analog Gameport conversion. Any ideas? Our last resort is the PWM to Analog converter, using an IFI EduRobot's PWM's to simulate the values, however, if there is some way to directly use the serial port and convert the serial data to multiple analog values it would be much of help. |
|
|
|
|
|
|
(permalink) |
|
The generation of analogue voltages from a serial port is easy to do using a PIC, the PIC reads the incoming serial data and outputs the values via a digital to analogue converter - which can be simple R2R ladder networks buffered with an opamp.
This gets you a nice easy analogue VOLTAGE output, but joysticks are resistive (not a voltage), and not referenced to ground. The difficult part is generating the floating variable resistance. One possibility is using digital potentiometers - these could be fed directly from the PIC, no D2A required. |
|
|
|
|
|
|
(permalink) |
|
Any specific PIC that can do this job well?
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
|
||
|
|
|
|
|
(permalink) |
|
For four seperate analog voltage outputs?
|
|
|
|
|
|
|
(permalink) | |
|
Quote:
|
||
|
|
|
|
|
(permalink) |
|
Datasheets say that it consists of Analog Inputs, not Analog outputs. And it is a bit value, not a byte value.
I need each of 4 bytes from the serial port to represent a variable voltage ranging from 0 (0 volts) to 255 (+5 volts). Or is MicroChip documentation leaving something out? |
|
|
|
|
|
|
(permalink) | ||
|
Quote:
Quote:
|
|||
|
|
|
|
|
(permalink) |
|
Use PWM and a filter, 1 pin per output.
|
|
|
|
|