may this help you friend:
first you have to setup MAX7219 before send data to digits (7 segment display)
look this example (in picbasic pro 2.47) :
-------------------------------------------
'****************************************************************
'* Name : UNTITLED.BAS *
'* Author : [select VIEW...EDITOR OPTIONS] *
'* Notice : Copyright (c) 2006 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 16/09/2006 *
'* Version : 1.0 *
'* Notes : *
'* : *
'****************************************************************
'-----CHIP SET-UP-----
include "modedefs.bas"
define OSC 4
'-----VARIABLES-----
ADDRESS var word 'variable address for display
DATAREG var word 'variable data register for display
X var word 'misc variable used in loops
Y var word ' DEZE TOEVOEGEN
'-----PIN SETUPS-----
low portb.0 'data pin for MAX7219 (1)
low portb.1 'clock pin for MAX7219 (13)
low portb.2 'load pin for MAX7219 (12)
'-----MAX7219 SETUP-----
ADDRESS = $0C : DATAREG = $01 : gosub MaxWrite
ADDRESS = $09 : DATAREG = $FF : gosub MaxWrite
ADDRESS = $0A : DATAREG = $04 : gosub MaxWrite
ADDRESS = $0B : DATAREG = $03 : gosub MaxWrite
ADDRESS = $0F : DATAREG = $00 : gosub MaxWrite
gosub Blank
'-----PROGRAM-----
Start:
for Y = 0 to 9999
for X = 0 to 9999
gosub ValueToMax
pause 1000
next X
X = 0
NEXT y
goto Start 'do it all over again
end
'-----SUBROUTINES-----
ValueToMax:
ADDRESS = 1 : DATAREG = X DIG 0
gosub MaxWrite
ADDRESS = 2 : DATAREG = X DIG 1
gosub MaxWrite
ADDRESS = 3 : DATAREG = X DIG 2
gosub MaxWrite
ADDRESS = 4 : DATAREG = X DIG 3
gosub MaxWrite
ADDRESS = 5 : DATAREG = y DIG 0
gosub MaxWrite
ADDRESS = 6 : DATAREG = y DIG 1
gosub MaxWrite
ADDRESS = 7 : DATAREG = y DIG 2
gosub MaxWrite
ADDRESS = 8 : DATAREG = y DIG 3
gosub MaxWrite
return
MaxWrite:
shiftout portb.0,portb.1,1,[ADDRESS,DATAREG] 'Shift out the data to the
MAX7219
'first the address, then data.
pulsout portb.2,1 'load the data into the MAX7219
return
Blank:
for X = 1 to 4 'write $0F (blank) to all digits
ADDRESS = X : DATAREG = $0F : gosub MaxWrite
next X
return
---------------------------------------------------------------------------------
good luck friend