LED Machine Tach For Tired Eyes


Closed Thread
Results 1 to 34 of 34

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    That's a "Straw", I'm a "Camel", and my back is broken.

    2 days of work, and as I'm posting it I see ... "Nevermind, I'll use mister-e's program".
    Arrrrghhh.

    Enjoy.
    DT

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    That's a "Straw", I'm a "Camel", and my back is broken.

    2 days of work, and as I'm posting it I see ... "Nevermind, I'll use mister-e's program".
    Arrrrghhh.

    Enjoy.
    No NO NO NO Don't be that way Darrel, I really want to see what you have come up with! You and Mister_e, Melanie, and a few others all write really sweet code, and I am humbled, that you have made this effort. I thought you were standing by to see what I could come up with (I know, there I go thinkin' again). I just really thought this example needed to be "showcased"as a lot of NOOBS may have tried unsucessfuly to use it, due to aforementioned . . . misprint? For sure I have no intent to offend Professor Rex Nexus Taylor of the Crownhill University. I'm like an old hound dog with a bone, keep on shakin' it and shakin' it till I get the marrow out of it, now for steak . . . as for you being a Camel, yea like Secretariate was huh?
    Last edited by Archangel; - 21st June 2008 at 12:45. Reason: recap
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Threads left open are useless to others, so I will post what I came up with.
    Code:
    @MyConfig = _HS_OSC  & _LVP_OFF & _WDT_OFF & _CP_OFF
    @MyConfig = MyConfig & _BODEN_OFF & _MCLRE_ON & _PWRTE_ON  
    @ __CONFIG   MyConfig
    '===================== Set Defines ===================================
    '*
    DEFINE OSC 20
    '==================== Set up registers ===============================
    '                   
    INCLUDE "MODEDEFS.BAS"
    CMCON  = 7          ' Shut off comparators
    TRISA  = %00010000  ' Set PORTA to all outputs A.4 
    TRISB  = %00000000  ' Set PORTB Outputs  
    PortA = $20         ' Set all Port A outputs low           
    PORTB = 0           ' Set all Port B outputs low                      
    '
    '=====================Set Constants ================================
    'no constants as yet
    '
    '===================== Alias Ports =================================
    '
    TacInput var PORTA.4 ' Input pin for T0CKI -  Tach In
    '
    SDO      VAR PortB.0              ' 7 Segment Data  Out
    SCLK     var PortB.1              ' 7 Segment Clock Out
    DLE      var portB.2              ' 7 Segment Latch Enable
    '===================== Declare Variables =============================
    Digit_1          var byte    ' Thousands digit
    Digit_2          var byte    ' Hundreds  digit
    Digit_3          var byte    ' Tens      digit
    Digit_4          var byte    ' Units     digit
    DIGIT_OUTPUT     VAR BYTE    ' Storage for each digit before lookup
    CounterTotal     var word    ' Someplace to count input pulses
    Displays         VAR WORD    ' Storage while Countertotal gets cleared
    '===================== Zero Digits ====================================
    Digit_1 = 0
    Digit_2 = 0
    Digit_3 = 0
    Digit_4 = 0
    '===================== EEPROM DATA ===================================
    DATA @ 0,126,48,109,121,51,91,95,112,127,123   'DIGITS WITHOUT DECIMAL
    
    ;DATA @ 10,254,176,237,249,179,219,223,240,255,243 'DIGITS WITH DECIMAL
    
    '=========================== Main Loop ==============================
    LOOP:
    COUNT PortA.4,1000,CounterTotal
    '
    DISPLAYS=0
    DISPLAYS=(DISPLAYS+CounterTotal) ' load OverflowTotal into displays
    
    displays=(displays*60) ' change this formula to agree with encoder
                           ' Formula is for 1 PPR, 30 for 2 PPR, 15 for 4 PPR
                           ' 10 for 6 PPM, ET-AL, OR TURN THEM AROUND 2 FOR 30
                           ' 3 for 20,4 for 15,5 for 12, 6 for 10
    gosub Display
    CounterTotal=0                
    '
    GOTO LOOP
    '
    '=========================== Subroutines ============================
    Display:  
    '
    DIGIT_OUTPUT = DISPLAYS dig 0 ' Load Thousands Digit
    READ DIGIT_OUTPUT, DIGIT_1    ' Convert and Load Thousands Variable
    DIGIT_OUTPUT = DISPLAYS DIG 1 ' Load Hundreds  Digit
    READ DIGIT_OUTPUT, DIGIT_2    ' Convert and Load Hundreds Variable
    DIGIT_OUTPUT = DISPLAYS DIG 2 ' Load Tens of Units Digit
    READ DIGIT_OUTPUT, DIGIT_3    ' Convert and Load Tens  Variable
    DIGIT_OUTPUT = DISPLAYS dig 3 ' Load Ones of Units Digit
    READ DIGIT_OUTPUT, DIGIT_4    ' Convert and Load Units Variable
    '
    shiftout SDO,SCLK,4,[DIGIT_1\8,DIGIT_2\8,DIGIT_3\8,DIGIT_4\8]
    pulsout DLE, 500 
    pause 125
    '
    return
    '
    END
    This Works on the bench , I have yet to try it on the machine as I am still making parts for it.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    A second more complicated unit using a bargraph in addition to numbers is posted in attachment below:
    Attached Files Attached Files
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  5. #5
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Question

    Hi, Joe

    from your program ... may I think you use "something like" a MAX 7219 Serial LedDriver ???

    Alain
    Last edited by Acetronics2; - 20th October 2008 at 10:23.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  6. #6
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Acetronics View Post
    Hi, Joe

    from your program ... may I think you use "something like" a MAX 7219 Serial LedDriver ???

    Alain
    Hi Alain,
    I used this: http://cgi.ebay.com/ws/eBayISAPI.dll...MEWA:IT&ih=022
    and this
    http://cgi.ebay.com/40-segment-2-54m...d=p3911.c0.m14
    The price was right.
    Last edited by Archangel; - 20th October 2008 at 10:38.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  7. #7
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default New data

    Hi everyone,
    Forum member SAM brought to my attention this code wasn't doing as expected
    with the sepecified display. When I first set this up, the display I used did not
    agree with the printed data in the data sheet, the new display they are selling does.
    Replace the eeprom data in the listed code with the following:
    Code:
    data @ 0,252,96,218,242,102,182,62,224,254,230
    Update, the Chinese vendor which supplies this display is : http://www.sureelectronics.net/
    My Thanks to SAM for bringing this to my attention.
    JS
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. Conway's Game Of Life
    By wellyboot in forum mel PIC BASIC Pro
    Replies: 45
    Last Post: - 28th May 2020, 07:14
  2. Free Project - 245 LED Display
    By T.Jackson in forum Code Examples
    Replies: 221
    Last Post: - 16th August 2009, 05:59
  3. new and need help
    By smeghead in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd November 2008, 21:19
  4. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 03:30
  5. LED Tach Sources?
    By Netjammer in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 17th October 2004, 04:47

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