What's the voltage on output pin when it's HIGH?


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Apr 2006
    Posts
    92


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Ramonetnet View Post
    I see no code saying "port b shall be used for output" .... do you ?
    Ramon.
    I was wondering about that too, but when you say "portb.7 HIGH", doesn't that automatically take care of that?

    OR do you still have to define port b as output before the code?

    Thanks,
    T

  2. #2
    Join Date
    Apr 2008
    Posts
    24


    Did you find this post helpful? Yes | No

    Default

    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.

  3. #3
    Join Date
    Apr 2006
    Posts
    92


    Did you find this post helpful? Yes | No

    Default

    I added "TRISB = 0" and still read approximately 2.5V at portb.7

    Thanks,
    T

  4. #4
    Join Date
    Apr 2008
    Posts
    24


    Did you find this post helpful? Yes | No

    Default

    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.

  5. #5
    Join Date
    Apr 2006
    Posts
    92


    Did you find this post helpful? Yes | No

    Default

    I'm sure that I'm getting 5V to power my PIC.

    T

  6. #6
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    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

  7. #7
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    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

    Code:
    main:
    
    adcin 0, timeVar
    
    pauseTime = timeVar / 12
    
    high portb.7
    
    pause pauseTime
    
    low portb.7
    
    pause (255-pauseTime)
    
    goto main
    which will give a total time of 255 but the on will vary from 0-255 whilst off will also change from 255-0
    Keith

    www.diyha.co.uk
    www.kat5.tv

  8. #8
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by TonyA View Post
    I'm sure that I'm getting 5V to power my PIC.

    T
    Depends on where you are measuring your Voltage at.

    A - B, A - C , B - C ?


    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=2534&d=1208936533">
    Attached Images Attached Images  
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

Similar Threads

  1. SERIN MIDI out of Synch?
    By jncortes in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 9th June 2009, 20:08
  2. Old and beyond help ?
    By DavidFMarks in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 11th December 2008, 15:23
  3. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  4. Serious Serial Situation Setbacks...
    By Dansdog in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th February 2007, 03:46
  5. Another RTC, DS1287
    By DavidK in forum Code Examples
    Replies: 0
    Last Post: - 12th December 2006, 17:07

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts