Hi mister_e,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
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...
Bookmarks