Tach Project (binary counting)...


Results 1 to 9 of 9

Threaded View

  1. #3
    Join Date
    Oct 2004
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    Originally posted by mister_e
    The same weird situation will happen also when using SPI EEPROM.

    As i can see, the device don't accept the non decode mode. So $0F is Blank output. The only thing i can suggest is add

    HIGH Load
    Pause 20 ;maybe unecessary

    before Gosub DecodeMode line.

    let me know

    regards
    Hi mister_e,
    I tried your suggestion with the Pause 20, it had no effect. As far as $0F value I re-wrote the the shiftout command so that it now passes the binary equivalent. This works great for certain binary numbers. As an example:

    00001111 (works)
    00011111 (doesn't work)

    00001111 0000111 00001111 00000111 (works)
    00001111 0001111 00001111 00011111 (doesn't work)

    I can adjust any bank with certain binary numbers. I've posted modified code below. Along with some photos of the setup. One curious affect is that no matter what binary numbers I have "ON" after a period of time ALL the banks will turn off.

    Thanks for the suggestions I really appreciate it!
    Netjammer-


    Here is the code...

    ' ================================================== =======================
    '
    ' File......MAX7219
    ' Purpose...
    ' Author...
    ' E-mail....
    ' Started...
    ' Updated...
    '
    ' {$}
    ' {$PicBasicPro 2.5}
    '
    ' ================================================== =======================
    include "modedefs.bas"

    ' -----[ Program Description ]---------------------------------------------
    ' 4 Sets of 8 LED's (32 total). Each Dig# able to have an 8 bit number
    ' assigned to it.

    ' -----[ Revision History ]------------------------------------------------

    ' -----[ I/O Definitions ]-------------------------------------------------


    symbol DOUT = PORTC.5 'line for data input connected to RC5
    symbol CLK = PORTC.3 'CLK line connected to pin RC3
    symbol Load = PORTA.3


    ' -----[ Constants ]-------------------------------------------------------
    IsLow CON 0
    IsHigh CON 1

    ' -----[ Variables ]-------------------------------------------------------
    COUNter var byte
    ' -----[ EEPROM Data ]-----------------------------------------------------

    ' -----[ Initialization ]--------------------------------------------------

    ' -----[ Program Code ]----------------------------------------------------
    Begin:

    GOSUB DecodeMode
    GOSUB ShutDownMode
    GOSUB ScanLimit
    GOSUB Intensity
    ' gosub displaytest

    Continue:

    'first LED bank
    LOW Load
    ShiftOut DOUt,clk,MSBFIRST,[%0000000100001111\16]
    HIGH Load
    PAUSE 100

    'second LED bank
    LOW Load
    ShiftOut DOUt,clk,MSBFIRST,[%0000001000111000\16]
    HIGH Load
    PAUSE 10

    'third LED bank
    LOW Load
    ShiftOut DOUt,clk,MSBFIRST,[%0000001100000111\16]
    HIGH Load
    PAUSE 10

    'fourth LED bank
    LOW Load
    ' 87 0
    ShiftOut DOUt,clk,MSBFIRST,[%0000010011100000\16]
    HIGH Load
    PAUSE 10

    GOTO continue
    END
    ' NEXT


    ' -----[ Subroutines ]-----------------------------------------------------
    DecodeMode:
    LOW Load
    ' SHIFTOUT DOUT, CLK, MSBFIRST,[$090F\16]
    SHIFTOUT DOUT, CLK, MSBFIRST,[$0900\16]
    HIGH Load
    PAUSE 20
    RETURN
    'Set shutdown mode so device is active
    ShutDownMode:
    LOW Load
    SHIFTOUT DOUT, CLK, MSBFIRST,[$0C01\16]
    HIGH Load
    PAUSE 20
    RETURN
    'Set scan limit mode for three digits
    ScanLimit:
    LOW Load
    SHIFTOUT DOUT, CLK, MSBFIRST,[$0B03\16]
    HIGH Load
    PAUSE 20
    RETURN
    'Set intensity of LEdDs
    Intensity:
    LOW Load
    SHIFTOUT DOUT, CLK, MSBFIRST,[$0A09\16]
    HIGH Load
    PAUSE 20
    RETURN
    'Set Display Test mode active
    DisplayTest:
    LOW Load
    SHIFTOUT DOUT, CLK, MSBFIRST,[$0F01\16]
    HIGH Load
    PAUSE 20
    RETURN

    Photo attached...
    Attached Images Attached Images  

Similar Threads

  1. A Serial GLCD 128x64 Simple Project
    By Oldspring in forum Off Topic
    Replies: 0
    Last Post: - 8th March 2010, 20:58
  2. PIC16F628 - Convert Binary to BCD?
    By steng in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th March 2009, 08:17
  3. A Temperature & Humidity Data Recorder Project
    By Oldspring in forum Off Topic
    Replies: 0
    Last Post: - 9th July 2008, 18:47
  4. help required regarding reading binary files
    By shaiqbashir in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th March 2008, 22:30
  5. A category for Project Ideas
    By Pic_User in forum Forum Requests
    Replies: 2
    Last Post: - 23rd June 2006, 07:29

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