I added "TRISB = 0" and still read approximately 2.5V at portb.7
Thanks,
T
I added "TRISB = 0" and still read approximately 2.5V at portb.7
Thanks,
T
Then either :
a) your Vdd is 2,5 volts
b) your PIC is gone nuts
c) any other I dont know right now - time to sleep here
Cheers.
How long is "pausetime"
You are toggling the pin between high and low and your meter will probably not see the voltage stable for long enough to get a true reading.
Currently the pin is operating on a 50% duty cycle and 2.5 volts just happens to be 50% or 5V !!!!
Comment out the "low port b.7" statement which means once the LED comes on it will stay on but you will then have a stable condition on the pin to be able to measure.
My guess is that it will then read 5V![]()
Keith
www.diyha.co.uk
www.kat5.tv
also cant see what the code is meant to achieve because irrespective of whatever value you have for pausetime the led will alsways be at 50% brightness as the on and off times are the same.
If you are trying to get a variable brightness then with pausetime being 0-255 you should have something like
which will give a total time of 255 but the on will vary from 0-255 whilst off will also change from 255-0Code:main: adcin 0, timeVar pauseTime = timeVar / 12 high portb.7 pause pauseTime low portb.7 pause (255-pauseTime) goto main
Keith
www.diyha.co.uk
www.kat5.tv
Yes, you're right. The on-off time is too fast for the meter to register.
I am just trying to achieve a TTL pulsing; 5V, 0V, on/off at different rates. The LED was put in there just for a visual reference, it's not part of my finished circuit.
The purpose of this pulsing of the pic pin is to replace a Schmitt Trigger Pulse Oscillator.
It is working the way I expected "in circuit", but I was just wondering why I couldn't read discreet 5V and 0V on my meter, (taking reading on the bare pin, not resistor or LED).
If I had an Oscilloscope I guess I would see the TTL (I would see the square wave pulse).
I'm starting to see the benefits of an Oscilloscope...
Thanks for all the help, I appreciate it very much.
T
Bookmarks