Using MAX 7221 LED driver


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    JDM160's Avatar
    JDM160 Guest


    Did you find this post helpful? Yes | No

    Red face Help please

    I am trying to use the code achuri posted to better understand how to interface the MaX 7219 with my PIC (18F2331).

    I am having a hard time compiling it because of errors, namely with the rowxVar statements. Obviously what was posted is not complete code, but I need help putting it to use for me.

    Ultimately what I'm trying to do is display a 3 digit number on a 3 digit LED display using the 18F2331. How exactly do I update or write the number to each digit? Any help would be greatly appreciated...

  2. #2
    Join Date
    Nov 2006
    Location
    Tulare CA
    Posts
    4


    Did you find this post helpful? Yes | No

    Default 7219 Code

    The following is code that I wrote for the MAX 7219. This is only the sub that I call to initialize and test the display. This was written for a 16F877 but can be ported to just about anything. I am far from a programmer so if anyone out there can clean this up or make it better please let me know. I know this code works, as we have shipped many units running it. You must, of course, setup your ports and outputs. Hope this helps - if anyone finds this usefull I would love to hear from you! Feel free to cut and paste this but please pass on help to others - we all must stick together!

    LEData VAR PORTC.1
    CLK VAR PORTC.5
    Load VAR PORTC.0




    Max_init:

    ShiftOut LEData,clk,MSBFIRST,[%0000100111111111\16] ' Reg. 9 Decode
    PulsOut Load,10


    ShiftOut LEData,clk,MSBFIRST,[%0000101000001111\16] ' Reg. A Intensity
    PulsOut Load,10


    ShiftOut LEData,clk,MSBFIRST,[%0000101100000111\16] ' Reg. B Scan Limit
    PulsOut Load,10



    ShiftOut LEData,clk,MSBFIRST,[%0000110000000001\16] ' Reg. C Shutdown
    PulsOut Load,10



    ShiftOut LEData,clk,MSBFIRST,[%000011110000000\16] ' Reg. F Display Test
    PulsOut Load,10



    ' Blank the display
    digit = 8
    For x = 1 TO 8

    ShiftOut LEData,clk,MSBFIRST,[digit,$F]
    PulsOut Load,10
    digit = digit - 1

    Next

    ' Test the display by writting 8's to each digit and scrolling them across

    digit = 8
    For x = 1 TO 8

    ShiftOut LEData,clk,MSBFIRST,[digit,8]
    PulsOut Load,10
    Pause 500
    ShiftOut LEData,clk,MSBFIRST,[digit,$F]
    PulsOut Load,10
    digit = digit - 1


    Next





    ' Write H
    digit = 1
    ShiftOut LEData,clk,MSBFIRST,[digit,$C]
    PulsOut Load,10


    ' Write E
    digit = 2
    ShiftOut LEData,clk,MSBFIRST,[digit,$B]
    PulsOut Load,10

    ' Write L
    digit = 3
    ShiftOut LEData,clk,MSBFIRST,[digit,$D]
    PulsOut Load,10
    digit = 4

    ' Write L
    digit = 4
    ShiftOut LEData,clk,MSBFIRST,[digit,$D]
    PulsOut Load,10
    digit = 4

    ' Write 0
    digit = 5
    ShiftOut LEData,clk,MSBFIRST,[digit,0]
    PulsOut Load,10
    digit = 4

    Pause 250

    ' Blink it 5 times

    For x = 1 TO 4

    ShiftOut LEData,clk,MSBFIRST,[%0000110000000000\16] ' Reg. C Shutdown ON
    PulsOut Load,10

    Pause 150


    ShiftOut LEData,clk,MSBFIRST,[%0000110000000001\16] ' Reg. C Shutdown OFF
    PulsOut Load,10

    Pause 200

    Next

    Pause 1000

    Return

  3. #3
    Join Date
    Feb 2010
    Posts
    6


    Did you find this post helpful? Yes | No

    Default does not work

    Unfortunaly none of these projects does not work.
    The program of using the PROTEUS to check.
    I want to do a project with a running line is from PIC 16f877 and driver MAX 7221.

    We also managed if someone let the finished project + program

    I apologize for my English, I am from Ukraine and use a translator Google.

  4. #4
    Join Date
    Feb 2010
    Posts
    6


    Did you find this post helpful? Yes | No

  5. #5
    Join Date
    Nov 2006
    Location
    Tulare CA
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Max 7221

    What about the code does not work? We have shipped many units running this code??
    Have you actually compiled and ran it?
    Plasma Jocky

  6. #6
    Join Date
    Feb 2010
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    У МЕНЯ НЕ работает код. что-то не так

  7. #7
    Join Date
    Feb 2010
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    sorry.

    I did not have working code. something wrong

Similar Threads

  1. Conway's Game Of Life
    By wellyboot in forum mel PIC BASIC Pro
    Replies: 45
    Last Post: - 28th May 2020, 06:14
  2. Help with LED driver fade on/off
    By dfort in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 25th July 2009, 00:39
  3. new and need help
    By smeghead in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 3rd November 2008, 20:19
  4. Alegro 6276 LED driver?
    By [email protected] in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd August 2007, 00:25
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30

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