Yes, with the resistor and LED disconnected, I still read 2V out of the portb.7
I'm using the pic like this to provide a TTL pulse, (replacing a Schmitt trigger osc.). I had it hooked up in place of the Schmitt trigger and it works the way I expected, however I don't know why I only read 2V from my multi meter.Code:'DEFINITIONS' DEFINE OSC 20 DEFINE ADC_BITS 10 ' Set number of bits in result DEFINE ADC_CLOCK 3 DEFINE ADC_SAMPLEUS 15 'PORT SETUP' TRISA = %11111111 'set up all pins on portA as input pins ADCON1 = %10000010 'Set PORTA analog conversion and right justify result timeVar var word pauseTime var byte main: adcin 0, timeVar pauseTime = timeVar / 12 high portb.7 pause pauseTime low portb.7 pause pauseTime goto main
The Schmitt trigger's pulse read close to 5V.
Last edited by TonyA; - 22nd April 2008 at 23:59.
I see no code saying "port b shall be used for output" .... do you ?
Ramon.
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.
Bookmarks