PDA

View Full Version : tell me what I am doing wrong.



TC
08-18-2008, 08:47 AM
I am using a MAX7219. I am trying to place a·decimal point with digit number 2. But instead, the display drops brightness, and locks digit 2. What am I missing.


sensor CON 0
DATA_n CON 1
CLK CON 2
Load CON 3
decode CON 9
brite CON 10
scan CON 11
switch CON 12
test CON 15
max_dat VAR Word
index VAR Nib
temp VAR Nib
nonZ VAR Bit
dispVal VAR Word
odd VAR index.BIT0
DP VAR index.BIT3

OUTS = 0
DIRS = $000E

FOR index = 0 TO 7
LOOKUP index,[scan,2,brite,15,decode,$7,switch,1],max_dat
SHIFTOUT DATA_n,CLK,MSBFIRST,[max_dat]
IF odd = 0 THEN noLoad
PULSOUT Load,1

NoLoad:
NEXT

Loop:
GOSUB MaxDisplay
COUNT sensor,2930,dispVal
GOTO LOOP

MaxDisplay:
nonZ = 0
FOR index = 3 TO 1
GOSUB ADD_DP
SHIFTOUT DATA_n,CLK,MSBFIRST,[index]
temp = dispVal DIG (index-1)
IF temp = 0 THEN skip1
nonZ = 1

skip1:
IF nonZ = 1 OR temp <> 0 OR index <= 2 THEN skip2
temp = 15

skip2:
SHIFTOUT DATA_n,CLK,MSBFIRST,[temp]
PULSOUT Load,5
NEXT
RETURN

ADD_DP:
IF index = 2 THEN ADD_DP1
RETURN

ADD_DP1:
DP = 1
RETURN

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
We all make mistakes when we are young………That’s why paste is edible!

sam_sam_sam
08-18-2008, 06:28 PM
TC

Please give a link to the dislplay that you are using

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any·http://forums.parallax.com/images/smilies/idea.gif·that you may have and all of your time finding them

·
·
·
·
Sam

PJ Allen
08-18-2008, 07:03 PM
http://pdfserv.maxim-ic.com/arpdf/MAX7219-MAX7221.pdf

TC
08-19-2008, 03:15 AM
Thanks PJ for posting the link before I could. also, here is the appkit that I copied from.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
We all make mistakes when we are young………That’s why paste is edible!

sam_sam_sam
08-19-2008, 08:09 PM
TC

What LED Display are you using can post a link to it

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any·http://forums.parallax.com/images/smilies/idea.gif·that you may have and all of your time finding them

·
·
·
·
Sam

TC
08-19-2008, 08:47 PM
sam_sam_sam said...

TC

What LED Display are you using can post a link to it


It is a three digit 7-segment display drivin by a MAX7219, PJ already posted the link for the MAX7219. It is just a LED controler/driver.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
We all make mistakes when we are young………That’s why paste is edible!

Chris Savage
08-21-2008, 06:04 AM
TC,

The code for the Binary / Digital Clock uses the decimal points for the colons in the display. You should be able to see how I turn them on/off by simply setting a bit in the data sent out to the MAX7219. I hope this helps. Take care.

http://forums.parallax.com/showthread.php?p=552892

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Engineering