I am attempting to use a maxium 7219 serial multipexing chip
with a pic 16c74a. I am running the pic at 4MHz. I have the
serial port on the pic working and after 16 bits are sent I pulse the load
line on the 7219. It appears to me that everything is correct.
However the chip is not displaying anything. I have included with
this message a copy of my program. If anyone can figure out what
I am doing wrong please let me know, or if you have a program that already
does this task correctly please send it to me.
************This is the program I have so far*********
;this is the pic and display information needed to init the
;Serial port and the multiplexing chip.
;
;
;init these values
LIST P=16C74A, F=INHX8M
include <p16c74a.inc>
&nbs
p;
ORG
0x00 &nb
sp;
;reset program
position
&nbs
p;
GOTO
START
;go to the start of the program
;init serial port
START clrf PORTA
&nbs
p;
movlw 0x00
&nbs
p;
tris PORTA
&nbs
p;
clrf
PORTB &n
bsp;
;portb is used to pulse a line so that
&nbs
p;
movlw
0x00 &nb
sp;
;there is a point we can check to see that
&nbs
p;
tris
PORTB &n
bsp;
;the pic program is running
&nbs
p;
clrf
PORTC &n
bsp;
;clears port
&nbs
p;
movlw
0x00 &nb
sp;
;sets i/o pins to proper values
&nbs
p;
tris
PORTC &n
bsp;
;port is now set for only outputs
&nbs
p;  
;
&n
;because we are not going to receive data
&nbs
p;  
;
&n
;only 5 pins are required at this point these
&nbs
p;  
;
&n
;are pins 18, 23, 24, 25, 26
&nbs
p;
movlw
0x00 &nb
sp;
;set proper bits for spi operation
&nbs
p;
bsf STATUS, RP0
;switch to bank 1
&nbs
p;
movwf
SSPSTAT
;
&nbs
p;
bcf STATUS, RP0
;switch to bank 0
&nbs
p;
movlw
0x21 &nb
sp;
;pic is set as master with
&nbs
p;
movwf
SSPCON
;a 1/4 the fosc
&nbs
p;
bsf PORTC, 6
;test porgram
repeat movlw
0x0c &nb
sp;
;Set to normal operation
&nbs
p;
call SEND
&nbs
p;
movlw
0x01 &nb
sp;
;take maxium chip out of shutdown
&nbs
p;
call SEND
&nbs
p;
bcf PORTC,
6
;pulse load line to latch 16 bits
&nbs
p;
nop
&nbs
p;
nop
&nbs
p;
nop
&nbs
p;
bsf PORTC, 6
&nbs
p;
movlw
0x09 &nb
sp;
;declare decode mode b
&nbs
p;
call SEND
&nbs
p;
movlw
0xff &nb
sp;
;Set all digits to decode B
&nbs
p;
call SEND
&nbs
p;
bcf PORTC,
6
;latch data
&nbs
p;
nop
&nbs
p;
nop
&nbs
p;
nop
&nbs
p;
bsf PORTC, 6
&nbs
p;
movlw
0x0a &nb
sp;
;init intensity
&nbs
p;
call SEND
&nbs
p;
movlw
0x0f &nb
sp;
;intensity set to max
&nbs
p;
call SEND
&nbs
p;
bcf PORTC,
6
;latch data
&nbs
p;
nop
&nbs
p;
nop
&nbs
p;
nop
&nbs
p;
bsf PORTC, 6
&nbs
p;
bcf PORTB,
1
;set a bit on port b high
&nbs
p;  
;
&n
;to confirm this point has
&nbs
p;  
;
&n
;been reached
&nbs
p;
movlw
0x0b &nb
sp;
;init scan limit
&nbs
p;
call SEND
&nbs
p;
movlw
0x00 &nb
sp;
;only one digit is being displayed so far
&nbs
p;
call
SEND &nb
sp;
;other digits will be added once 1 display is
&nbs
p;
bcf PORTC,
6
;working
&nbs
p;
nop
&nbs
p;
nop
&nbs
p;
nop
&nbs
p;
bsf PORTC, 6
&nbs
p;
movlw
0x0f &nb
sp;
;turn display test off
&nbs
p;
call SEND
&nbs
p;
movlw
0x00 &nb
sp;
;takes maxium chip out of test mode
&nbs
p;
call SEND
&nbs
p;
bcf PORTC, 6
&nbs
p;
nop
&nbs
p;
nop
&nbs
p;
nop
&nbs
p;
bsf PORTC, 6
&nbs
p;
movlw
0x01 &nb
sp;
;send data to digit
&nbs
p;
call SEND
&nbs
p;
movlw
0x01 &nb
sp;
;this should display the digit 1
&nbs
p;
call SEND
&nbs
p;
bcf PORTC, 6
&nbs
p;
nop
&nbs
p;
nop
&nbs
p;
nop
&nbs
p;
bsf PORTC, 6
&nbs
p;
bsf PORTB,
1
;set pin on port b high to confirm
&nbs
p;  
;
&n
;porgram finished
&nbs
p;
goto
repeat &
nbsp;
;repeat program
;send subroutine
SEND movwf
SSPBUF &
nbsp;
;move data to transmit to proper register
&nbs
p;
bsf STATUS,
RP0
;switch to bank 1
LOOP btfss SSPSTAT,
BF
;has final bit been sent
&nbs
p;
goto
LOOP &nb
sp;
;if not loop
&nbs
p;
bcf STATUS,
RP0
;switch to bank 0
&nbs
p;
movf SSPBUF, W
&nbs
p;
return ;
end