Decoding variable into 4 digits of BCD, are there simple ways to this?


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Feb 2013
    Posts
    1,078

    Default Decoding variable into 4 digits of BCD, are there simple ways to this?

    Hello. I have giant 7 segment 4 digit display, which is driven by 4 CD4543BE (Inputs tied together, latches driven separately).

    Say I connected it to MCU, with 1 digit display I can do something like this

    Code:
    IF A=1 THEN HIGH PINA: LOW PINB: LOW PINC: LOW PIND
    IF A=2 THEN HIGH PINB: LOW PINA: LOW PINC: LOW PIND
    And so on. There will be 10 lines of code in case of 1 digit display. But with 2-3-4 digits same approach will generate a huge code. One way I see is to use DIG statement and loop it 4 times to get all digits decoded. Maybe there are other, more elegant ways to do this?

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Decoding variable into 4 digits of BCD, are there simple ways to this?

    It all depends on how the hardware is configured. Is the design optimized for minimal code? With out a schematic it's hard to say...
    Dave Purola,
    N8NTA
    EN82fn

  3. #3
    Join Date
    Feb 2013
    Posts
    1,078


    Did you find this post helpful? Yes | No

    Default Re: Decoding variable into 4 digits of BCD, are there simple ways to this?

    Well, there is no hardware yet I plan to use PIC16F887. The modules itself have A-B-C-D inputs of CD4543BE connected in paralel, and latch pins are also available on connector.

  4. #4
    Join Date
    Feb 2013
    Posts
    1,078


    Did you find this post helpful? Yes | No

    Default Re: Decoding variable into 4 digits of BCD, are there simple ways to this?

    If you mean hooking up A to PORTC.0, B to PORTC.1, C to PORTC.2 and D to PORTC.3, to be able to directly address them, then yes, I can do that.

  5. #5
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Decoding variable into 4 digits of BCD, are there simple ways to this?

    Schematic...... Not some wild a** guess... Definitive schematic Please...
    Dave Purola,
    N8NTA
    EN82fn

  6. #6
    Join Date
    Feb 2013
    Posts
    1,078


    Did you find this post helpful? Yes | No

    Default Re: Decoding variable into 4 digits of BCD, are there simple ways to this?

    Schematic of what?

Similar Threads

  1. Best way or ways?
    By Ramius in forum General
    Replies: 9
    Last Post: - 1st August 2013, 02:01
  2. Ways to make code easily reviewable and extendable
    By Ted's in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 23rd August 2008, 00:10
  3. Array to simple Variable converting
    By mrx23 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd September 2006, 16:44
  4. Showing numbers in diffrent ways?
    By SuB-ZeRo in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 29th July 2005, 15:57
  5. PIC problem, ways to do reset
    By lab310 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 26th May 2005, 14:31

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