You can use an output in the pwm mode and with a low pass fliter you will get a n analog value of this signal. You will get 256 steps of the analog value from 0 till 100% of the used supplyvoltage.
You can use an output in the pwm mode and with a low pass fliter you will get a n analog value of this signal. You will get 256 steps of the analog value from 0 till 100% of the used supplyvoltage.
In addition to the PWM approach (which works great), PICs like the 16F628A have an on-board Voltage Reference Module (based on a 16- tap resistor ladder) where the output can be directed to RA2. This module provides limited D2A capabilities, but it might be useful for your application. See the data sheet for your PIC (section 11 for the 16F628A) and see if it might work for you.
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Actually the PICs Hardware PWM is 10-bit. The upper 8-bits you can control directly with the HPWM command, and the bottom couple of bits you can manipulate the appropriate Register (also within PICBasic - no Assembler needed)..
I want to thanks the three of you who responded to my plaintive cry of woe....
After careful consideration and further purusal(sp?) of my PBP Manual.....
I happened upon the wonderful 'I2CWRITE' feature! This little gem coupled with an Analog Devices I2C 'digipot' will allow me to use the 2.5volt reference included in my Laser Diode driver to set the Laser Diode Current output to whatever my heart desires!
Were I to use the PWM method, I'd have to worry about the DC Supply (NiMH battery) changing over time as it surely would due the large amount of current I will be drawing to power my Laser Diode.
I will look into to the reference option though....that might be worthy of future consideration!
Thanks Again!
Robert
Bookmarks