Shop OBEX P1 Docs P2 Docs Learn Events
MC14489 working with a 7 segment display and BS2 — Parallax Forums

MC14489 working with a 7 segment display and BS2

stampguystampguy Posts: 3
edited 2008-03-26 18:24 in BASIC Stamp
In the example in the Stampworks manual for the 7 seg display working together with the MC14889, it is shown:
·
Say_Hello:
··· config = Blank
··· GOSUB Update_Cfg
··· config = %11101101························· ' setup for "HELLO"
··· dpCtrl = %1000····························· ' display bright, no DPs
··· segs5 = Ltr_H······························ ' H (Special Decode)
··· segs4 = $E································· ' E (Hex Decode)
··· segs3 = Ltr_L······························ ' L (Special Decode)
··· segs2 = Ltr_L······························ ' L (Special Decode)
··· segs1 = $0································ ·' 0 (Hex Decode)
··· GOSUB Update_Segs·························· ' show message
··· GOSUB Update_Cfg··························· ' display on
··· PAUSE 1000
··· config = Blank
··· GOSUB Update_Cfg
·
Update_Cfg:
· LOW Enable··································· ' enable MC14489
· SHIFTOUT SerData, Clock, MSBFIRST, [noparse][[/noparse]config]·· ' send config register
· HIGH Enable·································· ' disable MC14489
· RETURN
·
·
' Update MC14489 decimal point control and segments registers
·
Update_Segs:
· LOW Enable
· SHIFTOUT SerData, Clock, MSBFIRST, [noparse][[/noparse]dpCtrl\4,
············ segs5\4, segs4\4, segs3\4, segs2\4, segs1\4]
· HIGH Enable
· RETURN
·
·
·
What does Update_Cfg really do?
·
What does Update_Segs really do?
·
Why in the say hello section above, is the GOSUB Update_Cfg used 3 times?
·
I do not see the reason for the second Update_Cfg right after the Update_Segs?
·
Why is the Update_Cfg used a 3rd time?
·
When using similar code to display a message, does it matter the order of the subroutines, i.e. does Update_Cfg come first and then Update_segs or the other way around?
·
Where must the Update_cfg and update_segs come (what order) relative to the:
·
··· config = %11101101························· ' setup for "HELLO"
··· dpCtrl = %1000····························· ' display bright, no DPs
··· segs5 = Ltr_H······························ ' H (Special Decode)
··· segs4 = $E································· ' E (Hex Decode)
··· segs3 = Ltr_L······························ ' L (Special Decode)
··· segs2 = Ltr_L······························ ' L (Special Decode)
··· segs1 = $0································ ·' 0 (Hex Decode)
·
code?
·
I need some guidelines to know WHEN, WHERE and how many times update_cfg and update_segs need to be used.
·
Thanks,
Sign In or Register to comment.