Custom data pin for display.


Closed Thread
Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2011
    Posts
    14

    Default Custom data pin for display.

    Traduzione da italiano verso inglese

    Hi,
    I'm translating code from C to PicBasic Pro, and I ran into a problem. Hardware requirements for a diaplay he has the following pin:

    DB0 -> RB1
    DB1 -> RB2
    DB2 -> RB3
    DB3 -> RB4

    In C this is not a problem, but in PicBasic I saw that you can only set the pin to 4 or 0 for the data. Is there a way to customize every single bit?
    Last edited by Ziko87; - 15th July 2011 at 07:26. Reason: Translate error!

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    947


    Did you find this post helpful? Yes | No

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: Custom data pin for display.

    On some PICs RB4 is open drain meaning it can only sink current not supply. If you can show me the C compiler that can change that I'll be impressed ;-)

    Look at the datasheet for the PIC you're using, it will tell you if RB4 is open drain or push-pull output. If it's push-pull you'll be fine otherwise it might be enought to add a pullup resistor.

    /Henrik.

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: Custom data pin for display.

    Sorry, early in the morning i here..... It's RA4 that's open drain on some PICs - not RB4. So I can't see any reason for RB4 not working for you.

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Custom data pin for display.

    HENRIIIIIIIIIIIK !!!!



    PBP allow data bit to start from PORTx.0 OR PORTx.4. Jerson's suggestion's right.

    However, a slight modification to the whole code should be easy to suit PBP requirement... but we don'gt know anything about the actual project... so
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,521


    Did you find this post helpful? Yes | No

    Default Re: Custom data pin for display.

    Ahh, I (mis)read the question as in PicBasic I saw that you can only set pin 4 to 0 for the data.

    Have never smoked in my life but apparently I might as well have been since not doing it doesn't seem to help....

    Sorry for any confusion I've brought upon the subject.

  7. #7
    Join Date
    Jul 2011
    Posts
    14


    Did you find this post helpful? Yes | No

    Default Re: Custom data pin for display.

    Quote Originally Posted by Jerson View Post
    This is perfect. Just I can, I will try this code! Thank you for now!

  8. #8
    Join Date
    Jul 2011
    Posts
    14


    Did you find this post helpful? Yes | No

    Default Re: Custom data pin for display.

    It work correctly thank you at all!

  9. #9
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Wink Re: Custom data pin for display.

    Quote Originally Posted by HenrikOlsson View Post

    Have never smoked in my life but apparently I might as well have been since not doing it doesn't seem to help....
    'I have never looked left, or right, crossing the street; and, I'm alive; Conclusion: It must be dangerous to look to your left and right, before crossing.'

  10. #10
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Custom data pin for display.

    True story: "I don't see you, you don't see me". This is why you're still alive ardhuru
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Members who have read this thread : 1

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