Multiplex Display with count comand


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2005
    Posts
    8

    Red face Multiplex Display with count comand

    Helo All,

    Multiplex 3 Display 7 Seg. blink when I use the command count.

    @ device pic16F628A, wdt_off, pwrt_on, mclr_off, bod_off, lvp_off, protect_off
    TRISB = 0 'set PORTB pins as outputs 0, Input 1
    TRISA = %00001 'set PORTA pins as inputs 1, Output 0
    CMCON = 7 'set PortA = digital I/O
    VRCON = 0 ' Voltage reference disabled

    'Decimal Common Anode
    Zero CON 192 'abcdef
    One CON 249 'bc
    Two CON 164 'abdeg
    Three CON 176 'abcdg
    Four CON 153 'bcfg
    Five CON 146 'acdfg
    Six CON 130 'acdefg
    Seven CON 248 'abc
    Eight CON 128 'abcdefg
    Nine CON 144 'abcfg

    'Variables
    ENTRADA VAR PORTA.0
    FREQ var WORD
    KM var word
    x var byte


    MEDE:

    COUNT ENTRADA,1000,FREQ 'With count display blink
    ' freq = 430 'without normal
    KM = Freq / 4

    MOSTRA:


    For X = 0 to 2 'number of digits 'three in this case

    Display:

    LookUp (KM DIG (X)),[Zero,One,Two,Three,Four,Five,Six,Seven,Eight,Nine],PORTB

    if X = 0 then
    PORTA = 2 ' %00010 2 turn ones display on
    pauseus 500 ' wait for a while
    PORTA.1 = 0 ' %00001 $00 turn all displays off
    eNDIF

    if X = 1 then
    if KM >= 10 then
    PORTA = 4 ' %00100 4 turn ones display on
    pauseus 500 ' wait for a while
    PORTA.2 = 0 ' %00001 $00 turn all displays off
    endif
    ENDIF

    if X = 2 then
    if KM >= 100 then
    PORTA = 8 ' %01000 8 turn ones display on
    pauseus 500 ' wait for a while
    PORTA.3 = 0 ' %00001 $00 turn all displays off
    endif
    ENDIF
    Next X

    Goto MEDE


    As it resolve that problem?

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


    Did you find this post helpful? Yes | No

    Default

    you should use something else than Count.

    Look at the following link...
    http://www.picbasic.co.uk/forum/showthread.php?t=1044
    Steve

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

  3. #3
    Join Date
    Oct 2005
    Posts
    8


    Did you find this post helpful? Yes | No

    Unhappy

    Ok but that codigo does not function, where and used to variavel ClockInput var PORTA.4 ?

  4. #4
    Join Date
    Oct 2005
    Posts
    8


    Did you find this post helpful? Yes | No

    Talking Count Pulse

    Ok Mister_E, Work Fine, I obtained convert to frequencia for Kilometer using the Count_display.bas Thanks!

    Best regards,
    <!-- MDAWEB -->

Similar Threads

  1. Hdsp 21xx display
    By Original in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th June 2012, 20:07
  2. LED Machine Tach For Tired Eyes
    By Archangel in forum mel PIC BASIC Pro
    Replies: 33
    Last Post: - 27th January 2010, 14:55
  3. COUNT is not counting again
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 33
    Last Post: - 19th June 2009, 04:52
  4. Replies: 14
    Last Post: - 26th September 2007, 05:41
  5. Multiplex two 7 segment display
    By Fernando Santos in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 20th July 2003, 13:26

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