How to display more than 65536 with MAX7219


Closed Thread
Results 1 to 27 of 27

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    brighton
    Posts
    149


    Did you find this post helpful? Yes | No

    Default

    its installed ok
    the upgrade was from crowhill
    here is the readme file

    Isaac
    Attached Images Attached Images  

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Are you using an old version of MCS?
    Do not know if that would make a difference or not. When I upgraded PBP I also upgraded MCS and MPLAB.
    Dave
    Always wear safety glasses while programming.

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    I thought MCS 3.0.0.5 was the first version to recognize PBPL?

  4. #4
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Default

    An upgrade to PBP 2.50B will give you LONG variables. From there, you can split up your 'huge' number into smaller numbers and display the chunks individually.
    Is there another way i can use to display the number without having to use
    Long?
    isaac, depending on what you need, you may also be able to manipulate your data in software and massage it into individual digits for serial output. What is the nature of the information you want to read? And from what is that information derived?
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

  5. #5
    Join Date
    May 2004
    Location
    brighton
    Posts
    149


    Did you find this post helpful? Yes | No

    Default

    Hi Russ

    i am trying to implement a 6 digit display
    the problem is my variable Max_Disp which holds the data that is displayed
    can only hold up to 5 digits so 12345 displays ok but when its 123456
    this is grater than a word variable can hold so i need so help in how to do this i am following all the advice given but still lost

    Regards
    ISAAC
    Quote Originally Posted by RussMartin View Post
    isaac, depending on what you need, you may also be able to manipulate your data in software and massage it into individual digits for serial output. What is the nature of the information you want to read? And from what is that information derived?
    Code:
    	
    Again:		
    	Max_Disp=12345
    	Gosub Display			' Display the Value of Counter
    	Pause 150			' Delay, so we can see whats happening
      goto again
    
    
    Display:
    	Digit=0						' Start at Digit 0 of Max_Disp Variable
    	For Position=6 to 1 step -1			' Start at Farthest Right of Display 		
    	Register=Position				' Place Position into Register
    	R_Val=Max_Disp Dig Digit			' Extract the individual numbers from Max_Disp			
    	If Max_Disp<10 and Position=3 then R_Val=15	' Zero Suppression for the second digit
    	If Max_Disp<100 and Position=2 then R_Val=15	' Zero Suppression for the Third digit
    	If Max_Disp<1000 and Position=1 then R_Val=15	' Zero Suppression for the Forth digit
    	If Max_Disp<10000 and Position=0 then R_Val=15	' Zero Suppression for the Fifth digit
    	If Digit=Max_Dp then R_Val.7=1			' Place the decimal point, held in Max_DP
    	Gosub Transfer					' Transfer the 16-bit Word to the MAX7219
    	If Digit>=5 then Digit=0			' We only need the first 6 digits
    	Digit=Digit+1					' Point to next Digit within Max_Disp
    	Next Position					' Close the Loop
    	Return						' Exit from subroutine
    
    ' Send a 16-bit word to the MAX7219 
    Transfer:
      	Shiftout Dta,Clk,msbfirst,[Register,R_Val] ' Shift Out the Register first, then the data
    	High Load				' The data is now acted upon
    @	Nop
    @	Nop					' A small delay to ensure correct clocking times
    	Low Load				' Disable the MAX7219 
    	Return					' Exit from Subroutine

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by isaac View Post
    can only hold up to 5 digits so 12345 displays ok but when its 123456
    this is grater than a word variable can hold so i need so help in how to do this i am following all the advice given but still lost
    Regards
    ISAAC
    As I said in the other post on the basically the same subject, think fingers and hands. A WORD (hand) can only 'hold' 5 digits (fingers), you can count up to 10,000 but you can't count up to 100,000...
    So, two words (hands) to hold your data, one word (hand) holds 0-9999 the other word (hand) holds the places above 9999.
    Code:
    max_displow = 0 : max_disphigh = 0
    Again: max_displow=maxdisplow+1
    if max_displow>999 then maxdisplow=maxdisplow-1000 : maxdisphigh=maxdisphigh+1
    Gosub Display : Pause 150 : goto again
    Display: For Position=1 to 6 step -1 : Register=Position
    R_Val=Max_Disphigh Dig Digit : if position>3 then r_val=max_displow dig digit
    Gosub Transfer : Digit=Digit+1 : Next Position : Return
    Transfer: Shiftout Dta,Clk,msbfirst,[Register,R_Val] : load=1 : load=1
    load=0 : return
    But again, get PBPL and LONGs working and it'll be a bit easier...

  7. #7
    Join Date
    Aug 2006
    Location
    Omaha, Nebraska USA
    Posts
    263


    Did you find this post helpful? Yes | No

    Default

    I've looked at the MAX7219 data sheet:

    http://datasheets.maxim-ic.com/en/ds...19-MAX7221.pdf

    . . . but only briefly.

    It looks to me (on page 6) as if you send each digit separately, along with the address of the digit's position (Table 2 on page 7). It also appears that the MAX7219 would be happy with a 4-bit BCD input for each digit. This means you can break your large number down into individual digits, each of which is only 4 bits and can be accomodated by a byte variable. Then you send each digit, and its position address, in a 16-bit word to the display.

    But there's no way to tell you how to break down the number without knowing where you are getting the number from in the first place. Are you counting something? Or measuring something? What is your input? Why do you need 6 digits of output? What is the display telling--this many somethings or this much something?
    Russ
    N0EVC, xWB6ONT, xWN6ONT

    "Easy to use" is easy to say.

Similar Threads

  1. MAX7219 Helping Hand Please
    By isaac in forum mel PIC BASIC Pro
    Replies: 22
    Last Post: - 14th February 2014, 16:07
  2. Hdsp 21xx display
    By Original in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th June 2012, 21:07
  3. 7 Segment Displays and MAX7219
    By Bill Legge in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 31st October 2010, 19:30
  4. Replies: 2
    Last Post: - 14th July 2008, 23:11
  5. Replies: 14
    Last Post: - 26th September 2007, 06:41

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