I have developed a program using a PIC Microntroller 16F84A. The PIC basically works as a 4 channel Digital to Analog Converter. It receives a signal serially and then uses Pulse Width Modulation to individually alter the voltage on the 4 outputs between 0 and 5V. The code I can supply basically works but needs some improvements in relation to PWM part. The trick is to alter the code so that the output voltage remains the required level while the PIC is busy receiving the asychronous serial data. At the moment the code works like this: GetValueSerially (Between 0 & 255) TurnTheOutputPinOn Do IncrementCounterByOne If ValueReceived = Counter then TurnOutputPinOff loop As you can see if the value 1 was received then it would be turned off as soon as the counter hit1. Ie it theoretically would be on for 1/255th of the time. If the value 128 was received then the it would be turned off halfway through the count ie on 50% of the time. In theory this is OK but where it falls down is when the PIC is busy receiving the data because the interval is longer. Each instruction in loop above takes 1 to 4 cycles. The serial reception however takes about 700 cycles. I suspect the solution might be to make each counter cycle longer or do some multiplexing when receiving the data (time is pretty tight at 250kps though). The current code is in a mix of PicBasic & Parrallax but I would be happy with Microchip assembler.
Need code written in MicroChip assember (Or Parrallax) to achive the above. 3) Exclusive and complete copyrights to all work purchased. (No GPL, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site).