7 segment digit problem (using Mister E's code)


Results 1 to 8 of 8

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    This was the audio frequency counter code... posted there
    http://www.picbasic.co.uk/forum/showthread.php?t=1044

    And like i said it's also post on the Melabs website and include the schematics wich can help to figure few things
    http://www.melabs.com/resources/samp...ed/counter.zip

    Also, what are the CON numbers doing, as I changed them and get different results based on their number?
    i always try to make it easy to read but here's a short explanation of those constants because the choice of their value are important in that.

    If you look to the schematic and comments at the top of the original code, PORTA<3:0> is attach to a transistor wich is driving the Common anode on each 7 segment display. Each transistor need to be drive with a low level signal at the base.

    Using constant make the code easier to read.
    _7Seg1 con 14 ' enable more significant 7 segment display

    and later we use...
    PORTA=_7seg1 ' enable hundreds 7 segment

    same as PORTA=14 or PORTA=%11111110
    only the 'hundreds' display is used. When i look to your own definition, you choose more than one 7 segment display at the time so you display on more than one 7 segment at the time. this is one of the reason you see some odd results. few other things now
    • on PIC16F818, PORTA is analogue, you must set it to digital.
    • PORTA.4 is open drain, you'll need to modify your hardware to fit to this pin.
    • to use PORTA.5 you must set your configuration fuse to disable MCLR pin and use it as an i/o
    • don't forget, the original code was made for a 20MHZ crystal speed and will really not do the same things with a 10 MHZ clock since the DelayBetweenEachDisplay is based on a MPLAB stopwatch simulation. you'll need to divide it by 2 to have about the same delay

    Once everything above is done... it's suppose to give better results. well as i see now before to go to sleep...
    Last edited by mister_e; - 17th June 2005 at 15:13.
    Steve

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

Similar Threads

  1. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  2. pic18F code size problem???
    By dogi in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 7th March 2005, 21:52
  3. WRITE not working
    By servo260 in forum mel PIC BASIC Pro
    Replies: 31
    Last Post: - 29th December 2004, 02:02
  4. Driver code for 14 segment LED display
    By Durward Searcy in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 12th December 2004, 20:08
  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