Shop OBEX P1 Docs P2 Docs Learn Events
7 - segment help — Parallax Forums

7 - segment help

TCTC Posts: 1,019
edited 2006-08-17 02:47 in Propeller 1
I am trying to make my own 7 - segment driver. I am only starting but I can not find out why I am not getting anything on the display(using a NX-1000 proto board) here is what I have so far. this is just a start, I am learning

{{· 7 - segment test program
seven_seg.spin

· Segment Pins
··· a = A23
··· b = A22
··· c = A21
··· d = A20
··· e = A19
··· f = A18
··· g = A17
·· dp = A16
·· Digit pins
·· digit1 = A12
·· digit2 = A13
·· digit3 = A14
·· digit4 = A15
}}
con
· 'display· digit pins
· Digit1 = 12
· Digit2 = 13
· Digit3 = 14
· Digit4 = 15
· 'clock speed control
· '_clkmode = xtal1 + pll16x
· '_xinfreq = 5_000_000
var
pub start
'pin control
· dira[noparse][[/noparse]16..23] := %11111111···· 'set segment pins to output
· dira[noparse][[/noparse]12..15] := %1111········ 'set digit pins to output
· display

pub display
· outa[noparse][[/noparse]12..15] := %0111
· outa[noparse][[/noparse]16..23] := 1111110_0

dat
{{· Data to control each display. Data is set up as 7+1, 7 segments + 1 Decimal Point}}
seven_data··· byte····· %1111110_0············· 'data for ZERO
············· byte····· %0000000_0············· 'data for ONE
············· byte····· %0000000_0············· 'data for TWO
············· byte····· %0000000_0············· 'data for THREE
············· byte····· %0000000_0············· 'data for FOUR
············· byte····· %0000000_0············· 'data for FIVE
············· byte····· %0000000_0············· 'data for SIX
············· byte····· %0000000_0············· 'data for SEVEN
············· byte····· %0000000_0············· 'data for EIGHT
············· byte····· %0000000_0············· 'data for NINE
············· byte····· %0000000_0············· 'data for HEX "A"
············· byte····· %0000000_0············· 'data for HEX "B"
············· byte····· %0000000_0············· 'data for HEX "C"
············· byte····· %0000000_0············· 'data for HEX "D"
············· byte····· %0000000_0············· 'data for HEX "E"
············· byte····· %0000000_0············· 'data for HEX "F"

I have included my spin file too, I am working to make it an Object.

Thanks
TC

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

Comments

  • TCTC Posts: 1,019
    edited 2006-08-17 02:47
    I got it, Added REPEAT for PUB Display just to get started

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    We all make mistakes when we are young………That’s why paste is edible!
Sign In or Register to comment.