a) instead of trying to imagine the possible combinations,
I would go and program it !
b) if you "select" Port A mode, why don't you specify the Port B mode of operation ?
It is NOT so large and difficult ...
c) if you say "HIGH PORTB.7" it means you write some data into the port,
not that you somehow are telling the compiler to configure it for you.
Let's do it and let's talk again. Ramon.
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
Bookmarks