7-segment display with P16F84


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Jul 2007
    Posts
    5


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by hoops2006 View Post
    quick one.
    in the 7 seg display program what does ~dcd mean in the line
    digits=~dcd i
    thanks

    ~ = NOT
    and
    DCD = it changes a bit number (0-15) into binary and set that bit to a Logic 1

    Basicly it finds out what value digits is (0 to 3, 0 being the first display on the right and so on) and converts that into binary if 0 then to 00, if 1 then to 01, if 2 - 10, if 3 - 11 and instead of applying a logic 1 like DCD is supposed to do it does the opposite because there is ~ infront of it which make it 0

    Its basicly applying a Logic 0 to pin RA0 on the PIC,completing the subroutine and then doing the same for pin RA1, RA2 and RA3. These are the pins that turn on and off each digit.
    Logic 0 normally means 0 or close to 0 Volts but in this case transisors are being used to supply the current to the display. A transistor is basicly an inverting switch so if you input logic 1 (+5V) you get 0 at the output and the opposite if you apply 0 Volts to the input.

    I got a little carried away there and have gone into more detail and answering more than you asked but it might help you understand what the code is doing a bit better. Or atleast I hope so.

  2. #2
    Join Date
    Dec 2006
    Posts
    18


    Did you find this post helpful? Yes | No

    Smile

    Many thanks for your reply spitefire just what i needed. I made a boxing round timer a while back, now im trying to improve it by displaying the time on a 7 seg display. its proving to be tricker than i thought. As im still struggling to get my head round this one as im a newbie to pics your extra info helped alot.

  3. #3
    Join Date
    Jul 2007
    Posts
    5


    Did you find this post helpful? Yes | No

    Default

    No worries hoops, nice project there. Have you got the hardware side finished yet?

    I'm also somewhat of a newbie to PICs but after studying discrete logic and designing a 24 hour clock with cmos 4000 series IC's (made my own 4 digit 7-segment display on veroboard using 58 blue LEDs) I now unterstand abit better.

    I'm interested to see how it turns out.

  4. #4
    Join Date
    Dec 2006
    Posts
    18


    Did you find this post helpful? Yes | No

    Default

    Yes i think i have a fair idea of the hard ware. Pretty much the same set up as the link you gave on the first post. Two microswitches for round selection .With a relay chunked in for the buzzer. But my objective for now is to get minutes and seconds counting down on the display. Once i have that ill start worrying about how to select the times i want ect,

    So i have plenty to keep me going. ill keep you posted.

  5. #5
    Join Date
    Dec 2006
    Posts
    18


    Did you find this post helpful? Yes | No

    Default

    Would a count down timer be as simple as:

    for sec=59 to 0
    pause 1000
    if sec=0
    then minutes=minutes-1
    gosub display.

    the value for display would be (minutes*100)+sec eg if 3mins 59 sec value 359
    then just display the value as per the code on the link.

  6. #6
    Join Date
    Dec 2006
    Posts
    18


    Did you find this post helpful? Yes | No

    Default

    Are u in the raf spitfire?

  7. #7
    Join Date
    Dec 2008
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Hi all friend
    there is someone can create this project in proteuse and poste it
    and thanks

Similar Threads

  1. 7 Segment Displays and MAX7219
    By Bill Legge in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 31st October 2010, 18:30
  2. Weird compile issue 7 segment LED display
    By George in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 21st June 2006, 02:12
  3. 7 segment digit problem (using Mister E's code)
    By jmgelba in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 9th September 2005, 20:25
  4. WRITE not working
    By servo260 in forum mel PIC BASIC Pro
    Replies: 31
    Last Post: - 29th December 2004, 02:02
  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 : 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