TTL input - 3rd states possible?


Closed Thread
Results 1 to 27 of 27

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    964


    Did you find this post helpful? Yes | No

    Default Good documentation

    Thanks to both of you,

    The Tips & Tricks documentation is cool :-)

    I'll have a try with tis stuff.
    Roger

  2. #2
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    964


    Did you find this post helpful? Yes | No

    Unhappy Can't get it working...

    Well,

    After a few hours trying to get a positiv result, I just got nothing working.

    I would like to read two buttons connected to one pin.

    The states are "0" and "1". The third "Z" state is not relevant to me here.

    To make sure I have an intermediate level, I use a 2 resistor divider like described in the first post.

    Currently, I can't get clear "0" or "1" states.

    Any idea?

    Code:
    OSCCON       = %01100000  '4MHz
    OPTION_REG   = %10000000  'D I S A B L E PORTB's Pull-Ups for buttons
    ANSEL        = %00000000  'Disable Analogue Inputs
    TRISB        = %00010000  'Inputs/Outputs
    PORTB        = %00000000  'Drive all ports low
    
    MAIN:
        IF PORTB.5 = 0 THEN PORTB.0 = 1
        IF PORTB.5 = 1 THEN PORTB.1 = 1
        PAUSE 1000
        PORTB.0 = 0
        PORTB.0 = 0
        Goto MAIN
        end
    I use PORTB.5 of my PIC16F88 for buttons because it is a TTL input only.
    Roger

  3. #3
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Smile

    Code:
    TRISB        = %00010000  'Inputs/Outputs
    you have PORTB.4 set as input, not PORTB.5
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  4. #4
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    964


    Did you find this post helpful? Yes | No

    Red face How can I be so blind?

    Thanks Paul,

    It was again far to obvious to me (the tree in the forest story...).

    I'll try again tomorrow and let you know.

    Thanks a lot.
    Roger

  5. #5
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    964


    Did you find this post helpful? Yes | No

    Default Just tried - didn't want to go to bed frustrated...

    Well,

    I've still got one led always ON.

    In my understanding, I should get a state where no Led is ON.

    Is this correct?
    Roger

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by flotulopex View Post
    Well,

    I've still got one led always ON.

    In my understanding, I should get a state where no Led is ON.

    Is this correct?
    Show us your code again...

  7. #7
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    964


    Did you find this post helpful? Yes | No

    Default My code

    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1504&stc=1&d=117511986 5">

    I'm not sure about the ANSEL register. Shall I stay DIGITAL or ANALOG?

    I tried both but I get always the same result.

    I found this in the data-sheet; it's about the TTL levels.<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1505&stc=1&d=117512006 5">

    As far as I can understand, the LOW level will be between Vss and 0,15V and the HIGH level between 2V and Vdd.

    Is this correct?
    Attached Images Attached Images   
    Roger

Similar Threads

  1. Sony LanC Program
    By l_gaminde in forum Code Examples
    Replies: 2
    Last Post: - 25th September 2009, 18:51
  2. RB0 + Internal Pullup + Interrupt
    By Freman in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 10th August 2009, 11:11
  3. LED "capacitance" won't get lower
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 3rd May 2007, 20:31
  4. Timing input pulses and re-outputting them
    By jamie_s in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 28th February 2007, 01:50
  5. Using LEDs as light sensors
    By skimask in forum Code Examples
    Replies: 3
    Last Post: - 30th December 2006, 22:19

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