7 segment display


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,632


    Did you find this post helpful? Yes | No

    Default Re: 7 segment display

    your mainloop is unnecessarily long

    firstly
    I2CRead SDApin,SCLpin,$D0,$00,[RTCSec,RTCMin,RTCHour,RTCWDay,RTCDay,RTCMonth,RTCYear,RT CCtrl]
    why read these when they are never used


    second
    Pause 20 why ????

    third
    all these never change why are they in the loop
    PortA.2 =0
    PortA.4 =0
    PortC.0 =0
    PortC.1 =0

    and finally
    you are reading the time hundreds of times a second when it can only change once a second


    why not
    count var word

    count=1000

    mainloop:
    if count = 1000 then
    I2CRead SDApin,SCLpin,$D0,$00,[RTCSec]
    count =0
    gosub bcd_to_bin
    endif

    count=count+1

    temp1_sec = temp1
    n = temp1_sec
    PortA.0 =1
    gosub display
    PortA.0 =0

    temp2_sec = temp2
    n = temp2_sec
    PortA.1 =1
    gosub display

    goto Mainloop
    end

  2. #2
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default Re: 7 segment display

    Thank you for the help,
    the pause after the I2Cread was screwing me up badly.
    I get clear segments now.
    I now have a different issue !!
    Some of the segments not being used oare still being lit lighty !! I found that the dimm display on one display module was a pale mirror image of the display module next to it. I posted a picture to help understand what i'm talking about.
    Basically i have a 1 and 6 I can see (barely) on the 1 module all the segments of the 6 in the 1 module. I guess thats what is called ghosting..

    UPDATE: solved the problem by adding : PORTB = $00
    Lookup n, [$3F, $06, $5B, $4F, $66, $6D, $7D, $07, $7F, $67], Segments
    PORTB = $00
    PORTB = Segments
    pause 1
    PORTB = $00

    thanks for the really, very much appreciated
    Attached Images Attached Images  
    Last edited by lerameur; - 12th January 2015 at 23:24.

  3. #3
    Join Date
    Dec 2008
    Location
    Ploiesti, ROMANIA
    Posts
    582


    Did you find this post helpful? Yes | No

    Default Re: 7 segment display

    Nice job !
    Please, can you post full code ? Maybe I try to build this clock.
    Thanks !

Similar Threads

  1. 1 Pin 7-Segment Display
    By Mike, K8LH in forum Schematics
    Replies: 0
    Last Post: - 23rd November 2009, 12:35
  2. 7-segment display with P16F84
    By spitfire in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 3rd March 2009, 19:22
  3. 7-segment display driver
    By Klaus in forum General
    Replies: 3
    Last Post: - 15th April 2008, 13:37
  4. 7 segment display with hex
    By g@l@s in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 12th January 2007, 15:28
  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