BCD problem


Closed Thread
Results 1 to 3 of 3

Thread: BCD problem

  1. #1

    Default BCD problem

    I am using a 16F876A. I am using a Grayhill BCD on the PortB.0-3 ports. I followed the example awesome Melanie gave in http://www.picbasic.co.uk/forum/arch....php/t-66.html

    Here is my problem, when I ICD I don't get the values expected. I check the each ports state and they are correct except for PortB.3, its high at 1.5 v and all others are 5v when high. Yet in the ICD I don't get the right number most of the time. Here is what I get

    BCD ICD
    0 8
    1 9
    2 10
    3 11
    4 12
    5 13
    6 14
    7 15
    8 8
    9 9

    Here is my code

    myvar var word

    define OSC 20

    loop:
    TRISB=$FF
    OPTION_REG.7=0
    Myvar=PORTB
    Myvar=Myvar & $0F
    pause 10
    Myvar=Myvar ^ $0F


    goto loop

    Any help? This is driving me nuts. I am sure its simple yet I have been staring at this damn thing for hours.

  2. #2
    Join Date
    Aug 2008
    Posts
    66


    Did you find this post helpful? Yes | No

    Default

    You need to disable LVP.

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Thank you, that did it.

Similar Threads

  1. Bcd Fomat Help
    By Santana in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 28th November 2012, 06:00
  2. Problem to compile my program
    By wagner in forum Off Topic
    Replies: 5
    Last Post: - 7th July 2008, 20:17
  3. Rotary BCD
    By Tobias in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th October 2007, 03:04
  4. USART Problem , but don't know where, in pc? or in PIC?
    By precision in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th July 2007, 08:12
  5. 1 slave 1 master 1 MAX232 1 problem ?
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 31st July 2005, 22:59

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