PDA

View Full Version : Siemens SDA5708



Robotec
- 18th April 2015, 18:06
Hi everybody,

After almost 10 years of inactivity I'm back and with pleasure I see that the forum is still alive.
I do not even remember my old nick, I will search if some my old posts are still there.
Let's get to the point. I have here in front of me a Siemens SDA5708-24 display 8 character 7x5 dot matrix LED display.
Some of you has any experience with this display ?

Cheers

Roberto

Demon
- 18th April 2015, 19:40
Not me, I don't know if you have this but I did find this page on google:

http://sbprojects.com/knowledge/footprints/sda5708.php


;---------------------------------------------------------------------------
;
; Demo program to interface with the SDA5708-24 alpha numeric display
; Designed to run on the 6802 Nano computer
;
; Author: San Bergmans
; www.sbprojects.com
;
;---------------------------------------------------------------------------

.CR 6800
.OR $F000
.TF SDA5708.S19,S19,32

;---------------------------------------------------------------------------
; Declarations
;---------------------------------------------------------------------------

PIA_A .EQ $80 PIA Port A data register
PIA_B .EQ $81 PIA Port B data register
CON_A .EQ $82 PIA Port A control register
CON_B .EQ $83 PIA Port B control register

; PIA_A.0 = Display's -Reset line Output
; PIA_A.1 = Display's -Load line Output
; PIA_A.2 = Display's Clock line Output
; PIA_A.3 = Display's Data line Output

TEMP .EQ $00,$01 Used as temporary data register
SHIFT_DATA .EQ $00 Data to be shifted out
BIT_COUNT .EQ $01 Data bit counter
SAVE_X .EQ $02,$03 Location to save the X register
CURSOR .EQ $04 Character pointer (0..7)

SDA_BRIGHT .EQ %1110.0000 Control word value for brightness

;---------------------------------------------------------------------------
; ROUTINE : RESET
; FUNCTION : Get started
;---------------------------------------------------------------------------

RESET LDS #$007F Initialize the stack

LDAA #%0000.0100 PIA_A bits 0..3 are going to be
STAA CON_A outputs. But before we switch mode
LDAB #%0000.1111 we must ensure that the data
STAB PIA_A register holds 1's to avoid spikes

CLRA Now it's save to switch from inputs
STAA CON_A
STAB PIA_A
LDAA #%0000.0100 Finally select data register again
STAA CON_A

LDAA #%1111.1110 Send a -Reset signal to the display
STAA PIA_A
LDAA #%1111.1111
STAA PIA_A

LDAA #SDA_BRIGHT Set preselected display brightness
JSR WRITE_DSP

CLRA Reset cursor to 0
STAA CURSOR

;---------------------------------------------------------------------------
; ROUTINE : MAIN
; FUNCTION : Main program loop
;---------------------------------------------------------------------------

MAIN LDX #TEXT Load text pointer in index register

LDAA 0,X Print 1st character
JSR ASCII_2_DSP
LDAA 1,X Print 2nd character
JSR ASCII_2_DSP
LDAA 2,X Print 3rd character
JSR ASCII_2_DSP
LDAA 3,X Print 4th character
JSR ASCII_2_DSP
LDAA 4,X Print 5th character
JSR ASCII_2_DSP
LDAA 5,X Print 6th character
JSR ASCII_2_DSP
LDAA 6,X Print 7th character
JSR ASCII_2_DSP
LDAA 7,X Print last character
JSR ASCII_2_DSP

.4EVER JMP .4EVER

TEXT .AS "SDA-5708" This text is displayed!

;---------------------------------------------------------------------------
; ROUTINE : WRITE_DSP
; FUNCTION : Write 8 bit data in A to display controler
;---------------------------------------------------------------------------

WRITE_DSP PSHA Save affected registers
PSHB
STAA SHIFT_DATA
LDAB #8 Setup bit counter
STAB BIT_COUNT
LDAB PIA_A Get a copy of current PIA lines
ANDB #%1111.1011 Make Clock line low
STAB PIA_A
ANDB #%1111.1101 Make LOAD line low
STAB PIA_A

.LOOP ORAB #%0000.1000 In case data must be high
LSRA SHIFT_DATA Get databit
BCS .BIT_HIGH Data must be high!
ANDB #%1111.0111 Make data bit low

.BIT_HIGH STAB PIA_A
ORAB #%0000.0100 Pulse clock line high/low
STAB PIA_A
ANDB #%1111.1011
STAB PIA_A
DEC BIT_COUNT Do all bits
BNE .LOOP

ORAB #%0000.0010 Make LOAD line high again which
STAB PIA_A copies shift register to display
ORAB #%0000.1100 Finally make clock+data high
STAB PIA_A
PULB Restore affected registers
PULA
RTS

;---------------------------------------------------------------------------
; ROUTINE : ASCII_2_DSP
; FUNCTION : Send ASCII to current digit
; A = ASCII character
; CURSOR = Digit to print to
; CURSOR is incremented afterwards (wraps to 0 after 7)
;---------------------------------------------------------------------------

ASCII_2_DSP PSHA Save affected registers
PSHB
STX SAVE_X
TAB Save ASCII character in B
LDAA CURSOR Setup display pointer
ORAA #%1010.0000 Make it a digit selector
JSR WRITE_DSP Send digit address to display

SUBB #' ' Table starts at space, skipping the
CLRA control characters
STAB TEMP+1 Save Character-" "
ASLB Each table entery is 7 bytes long
ROLA so we must multiply the character
ASLB by 7 before we can use it as index
ROLA
ASLB
ROLA
SUBB TEMP+1 We multiplied by 8 instead of 7, so
SBCA #0 we'll have to subtract once
ADDB #ASCII_TABLE Add ASCII table offset to the index
ADCA /ASCII_TABLE
STAA TEMP Then use it as an index
STAB TEMP+1
LDX TEMP

LDAB #7 Count the number of display rows
.LOOP LDAA 0,X Get bit pattern
JSR WRITE_DSP and write it to the display
INX Increment table index
DECB Decrement row pointer
BNE .LOOP Continue until all rows are done

LDAA CURSOR Increment the display's cursor
INCA but limit range from 0 to 7
ANDA #%0000.0111
STAA CURSOR

LDX SAVE_X Restore the affected registers
PULB again
PULA
RTS

;---------------------------------------------------------------------------
; ASCII TABLE
;---------------------------------------------------------------------------

ASCII_TABLE .DA #%00000 Space $20
.DA #%00000
.DA #%00000
.DA #%00000
.DA #%00000
.DA #%00000
.DA #%00000

.DA #%00100 ! $21
.DA #%00100
.DA #%00100
.DA #%00100
.DA #%00100
.DA #%00000
.DA #%00100

.DA #%01010 " $22
.DA #%01010
.DA #%00000
.DA #%00000
.DA #%00000
.DA #%00000
.DA #%00000

.DA #%01010 # $23
.DA #%01010
.DA #%11111
.DA #%01010
.DA #%11111
.DA #%01010
.DA #%01010

.DA #%00100 $ $24
.DA #%01111
.DA #%10100
.DA #%01110
.DA #%00101
.DA #%11110
.DA #%00100

.DA #%11000 % $25
.DA #%11001
.DA #%00010
.DA #%00100
.DA #%01000
.DA #%10011
.DA #%00011

.DA #%00000 & $26
.DA #%01000
.DA #%10100
.DA #%01000
.DA #%10101
.DA #%10010
.DA #%01101

.DA #%00100 ' $27
.DA #%00100
.DA #%00000
.DA #%00000
.DA #%00000
.DA #%00000
.DA #%00000

.DA #%00010 ( $28
.DA #%00100
.DA #%01000
.DA #%01000
.DA #%01000
.DA #%00100
.DA #%00010

.DA #%01000 ) $29
.DA #%00100
.DA #%00010
.DA #%00010
.DA #%00010
.DA #%00100
.DA #%01000

.DA #%00000 * $2A
.DA #%10101
.DA #%01110
.DA #%00100
.DA #%01110
.DA #%10101
.DA #%00000

.DA #%00000 + $2B
.DA #%00100
.DA #%00100
.DA #%11111
.DA #%00100
.DA #%00100
.DA #%00000

.DA #%00000 , $2C
.DA #%00000
.DA #%00000
.DA #%00000
.DA #%01100
.DA #%00100
.DA #%01000

.DA #%00000 - $2D
.DA #%00000
.DA #%00000
.DA #%11111
.DA #%00000
.DA #%00000
.DA #%00000

.DA #%00000 . $2E
.DA #%00000
.DA #%00000
.DA #%00000
.DA #%00000
.DA #%01100
.DA #%01100

.DA #%00000 / $2F
.DA #%00001
.DA #%00010
.DA #%00100
.DA #%01000
.DA #%10000
.DA #%00000

.DA #%00100 0 $30
.DA #%01010
.DA #%10001
.DA #%10001
.DA #%10001
.DA #%01010
.DA #%00100

.DA #%00100 1 $31
.DA #%01100
.DA #%00100
.DA #%00100
.DA #%00100
.DA #%00100
.DA #%01110

.DA #%01110 2 $32
.DA #%10001
.DA #%00010
.DA #%00100
.DA #%01000
.DA #%10000
.DA #%11111

.DA #%11111 3 $33
.DA #%00001
.DA #%00010
.DA #%00110
.DA #%00001
.DA #%10001
.DA #%01110

.DA #%00010 4 $34
.DA #%00110
.DA #%01010
.DA #%10010
.DA #%11111
.DA #%00010
.DA #%00010

.DA #%11111 5 $35
.DA #%10000
.DA #%10000
.DA #%11110
.DA #%00001
.DA #%10001
.DA #%01110

.DA #%01111 6 $36
.DA #%10000
.DA #%10000
.DA #%11110
.DA #%10001
.DA #%10001
.DA #%01110

.DA #%11111 7 $37
.DA #%00001
.DA #%00010
.DA #%00100
.DA #%00100
.DA #%00100
.DA #%00100

.DA #%01110 8 $38
.DA #%10001
.DA #%10001
.DA #%01110
.DA #%10001
.DA #%10001
.DA #%01110

.DA #%01110 9 $39
.DA #%10001
.DA #%10001
.DA #%01111
.DA #%00001
.DA #%00001
.DA #%11110

.DA #%00000 : $3A
.DA #%01100
.DA #%01100
.DA #%00000
.DA #%01100
.DA #%01100
.DA #%00000

.DA #%00000 ; $3B
.DA #%01100
.DA #%01100
.DA #%00000
.DA #%01100
.DA #%00100
.DA #%01000

.DA #%00010 < $3C
.DA #%00100
.DA #%01000
.DA #%10000
.DA #%01000
.DA #%00100
.DA #%00010

.DA #%00000 = $3D
.DA #%00000
.DA #%11111
.DA #%00000
.DA #%11111
.DA #%00000
.DA #%00000

.DA #%01000 > $3E
.DA #%00100
.DA #%00010
.DA #%00001
.DA #%00010
.DA #%00100
.DA #%01000

.DA #%01110 ? $3F
.DA #%10001
.DA #%00010
.DA #%00100
.DA #%00100
.DA #%00000
.DA #%00100

.DA #%01110 @ $40
.DA #%10001
.DA #%10101
.DA #%10111
.DA #%10000
.DA #%10001
.DA #%01110

.DA #%00100 A $41
.DA #%01010
.DA #%10001
.DA #%11111
.DA #%10001
.DA #%10001
.DA #%10001

.DA #%11110 B $42
.DA #%01001
.DA #%01001
.DA #%01110
.DA #%01001
.DA #%01001
.DA #%11110

.DA #%01110 C $43
.DA #%10001
.DA #%10000
.DA #%10000
.DA #%10000
.DA #%10001
.DA #%01110

.DA #%11110 D $44
.DA #%01001
.DA #%01001
.DA #%01001
.DA #%01001
.DA #%01001
.DA #%11110

.DA #%11111 E $45
.DA #%10000
.DA #%10000
.DA #%11100
.DA #%10000
.DA #%10000
.DA #%11111

.DA #%11111 F $46
.DA #%10000
.DA #%10000
.DA #%11100
.DA #%10000
.DA #%10000
.DA #%10000

.DA #%01111 G $47
.DA #%10000
.DA #%10000
.DA #%10000
.DA #%10111
.DA #%10001
.DA #%01110

.DA #%10001 H $48
.DA #%10001
.DA #%10001
.DA #%11111
.DA #%10001
.DA #%10001
.DA #%10001

.DA #%01110 I $49
.DA #%00100
.DA #%00100
.DA #%00100
.DA #%00100
.DA #%00100
.DA #%01110

.DA #%01110 J $4A
.DA #%00100
.DA #%00100
.DA #%00100
.DA #%00100
.DA #%10100
.DA #%01000

.DA #%10001 K $4B
.DA #%10010
.DA #%10100
.DA #%11000
.DA #%10100
.DA #%10010
.DA #%10001

.DA #%10000 L $4C
.DA #%10000
.DA #%10000
.DA #%10000
.DA #%10000
.DA #%10000
.DA #%11111

.DA #%10001 M $4D
.DA #%11011
.DA #%10101
.DA #%10101
.DA #%10001
.DA #%10001
.DA #%10001

.DA #%10001 N $4E
.DA #%10001
.DA #%11001
.DA #%10101
.DA #%10011
.DA #%10001
.DA #%10001

.DA #%01110 O $4F
.DA #%10001
.DA #%10001
.DA #%10001
.DA #%10001
.DA #%10001
.DA #%01110

.DA #%11110 P $50
.DA #%10001
.DA #%10001
.DA #%11110
.DA #%10000
.DA #%10000
.DA #%10000

.DA #%01110 Q $51
.DA #%10001
.DA #%10001
.DA #%10001
.DA #%10101
.DA #%10010
.DA #%01101

.DA #%11110 R $52
.DA #%10001
.DA #%10001
.DA #%11110
.DA #%10100
.DA #%10010
.DA #%10001

.DA #%01110 S $53
.DA #%10001
.DA #%10000
.DA #%01110
.DA #%00001
.DA #%10001
.DA #%01110

.DA #%11111 T $54
.DA #%00100
.DA #%00100
.DA #%00100
.DA #%00100
.DA #%00100
.DA #%00100

.DA #%10001 U $55
.DA #%10001
.DA #%10001
.DA #%10001
.DA #%10001
.DA #%10001
.DA #%01110

.DA #%10001 V $56
.DA #%10001
.DA #%10001
.DA #%10001
.DA #%01010
.DA #%01010
.DA #%00100

.DA #%10001 W $57
.DA #%10001
.DA #%10001
.DA #%10001
.DA #%10101
.DA #%10101
.DA #%01010

.DA #%10001 X $58
.DA #%10001
.DA #%01010
.DA #%00100
.DA #%01010
.DA #%10001
.DA #%10001

.DA #%10001 Y $59
.DA #%10001
.DA #%01010
.DA #%01010
.DA #%00100
.DA #%00100
.DA #%00100

.DA #%11111 Z $5A
.DA #%00001
.DA #%00010
.DA #%00100
.DA #%01000
.DA #%10000
.DA #%11111

.DA #%01111 [ $5B
.DA #%01000
.DA #%01000
.DA #%01000
.DA #%01000
.DA #%01000
.DA #%01111

.DA #%00000 \ $5C
.DA #%10000
.DA #%01000
.DA #%00100
.DA #%00010
.DA #%00001
.DA #%00000

.DA #%11110 ] $5D
.DA #%00010
.DA #%00010
.DA #%00010
.DA #%00010
.DA #%00010
.DA #%11110

.DA #%00100 ^ $5E
.DA #%01010
.DA #%10001
.DA #%00000
.DA #%00000
.DA #%00000
.DA #%00000

.DA #%00000 _ $5F
.DA #%00000
.DA #%00000
.DA #%00000
.DA #%00000
.DA #%00000
.DA #%11111

.DA #%00100 ' $60
.DA #%01000
.DA #%00000
.DA #%00000
.DA #%00000
.DA #%00000
.DA #%00000

.DA #%00000 a $61
.DA #%01110
.DA #%00001
.DA #%01101
.DA #%10011
.DA #%10001
.DA #%01111

.DA #%10000 b $62
.DA #%10000
.DA #%10000
.DA #%10110
.DA #%11001
.DA #%10001
.DA #%11110

.DA #%00000 c $63
.DA #%00000
.DA #%01111
.DA #%10000
.DA #%10000
.DA #%10000
.DA #%01111

.DA #%00001 d $64
.DA #%00001
.DA #%00001
.DA #%01101
.DA #%10011
.DA #%10001
.DA #%01111

.DA #%00000 e $65
.DA #%00000
.DA #%01110
.DA #%10001
.DA #%11110
.DA #%10000
.DA #%01110

.DA #%00110 f $66
.DA #%01001
.DA #%01000
.DA #%11100
.DA #%01000
.DA #%01000
.DA #%01000

.DA #%00000 g $67
.DA #%01111
.DA #%10001
.DA #%10011
.DA #%01101
.DA #%00001
.DA #%01110

.DA #%10000 h $68
.DA #%10000
.DA #%10000
.DA #%10110
.DA #%11001
.DA #%10001
.DA #%10001

.DA #%00000 i $69
.DA #%00100
.DA #%00000
.DA #%00100
.DA #%00100
.DA #%00100
.DA #%00100

.DA #%00000 j $6A
.DA #%00010
.DA #%00000
.DA #%00010
.DA #%00010
.DA #%10010
.DA #%01100

.DA #%10000 k $6B
.DA #%10000
.DA #%10001
.DA #%10010
.DA #%11100
.DA #%10010
.DA #%10001

.DA #%01100 l $6C
.DA #%00100
.DA #%00100
.DA #%00100
.DA #%00100
.DA #%00100
.DA #%01110

.DA #%00000 m $6D
.DA #%00000
.DA #%11010
.DA #%10101
.DA #%10101
.DA #%10101
.DA #%10101

.DA #%00000 n $6E
.DA #%00000
.DA #%10110
.DA #%11001
.DA #%10001
.DA #%10001
.DA #%10001

.DA #%00000 o $6F
.DA #%00000
.DA #%01110
.DA #%10001
.DA #%10001
.DA #%10001
.DA #%01110

.DA #%00000 p $70
.DA #%11110
.DA #%10001
.DA #%11001
.DA #%10110
.DA #%10000
.DA #%10000

.DA #%00000 q $71
.DA #%01111
.DA #%10001
.DA #%10011
.DA #%01101
.DA #%00001
.DA #%00001

.DA #%00000 r $72
.DA #%00000
.DA #%10110
.DA #%11001
.DA #%10000
.DA #%10000
.DA #%10000

.DA #%00000 s $73
.DA #%00000
.DA #%01111
.DA #%10000
.DA #%01110
.DA #%00001
.DA #%11110

.DA #%00100 t $74
.DA #%00100
.DA #%01110
.DA #%00100
.DA #%00100
.DA #%00101
.DA #%00010

.DA #%00000 u $75
.DA #%00000
.DA #%10001
.DA #%10001
.DA #%10001
.DA #%10011
.DA #%01101

.DA #%00000 v $76
.DA #%00000
.DA #%10001
.DA #%10001
.DA #%10001
.DA #%01010
.DA #%00100

.DA #%00000 w $77
.DA #%00000
.DA #%10001
.DA #%10001
.DA #%10101
.DA #%10101
.DA #%01010

.DA #%00000 x $78
.DA #%00000
.DA #%10001
.DA #%01010
.DA #%00100
.DA #%01010
.DA #%10001

.DA #%00000 y $79
.DA #%00000
.DA #%10001
.DA #%10001
.DA #%01111
.DA #%00010
.DA #%01100

.DA #%00000 z $7A
.DA #%00000
.DA #%11111
.DA #%00010
.DA #%00100
.DA #%01000
.DA #%11111

.DA #%00011 { $7B
.DA #%00100
.DA #%00100
.DA #%01000
.DA #%00100
.DA #%00100
.DA #%00011

.DA #%00100 | $7C
.DA #%00100
.DA #%00100
.DA #%00000
.DA #%00100
.DA #%00100
.DA #%00100

.DA #%11000 } $7D
.DA #%00100
.DA #%00100
.DA #%00010
.DA #%00100
.DA #%00100
.DA #%11000

.DA #%01000 ~ $7E
.DA #%10101
.DA #%00010
.DA #%00000
.DA #%00000
.DA #%00000
.DA #%00000

.DA #%11111 sqaure $7F
.DA #%11111
.DA #%11111
.DA #%11111
.DA #%11111
.DA #%11111
.DA #%11111

;---------------------------------------------------------------------------
; Vectors
;---------------------------------------------------------------------------

.OR $FFF8
.DA RESET IRQ (Not used)
.DA RESET SWI (Not used)
.DA RESET NMI (Not used)
.DA RESET Reset

.LI OFF

I know it's in Assembler, but at least it has comments and shows how to use the device.

Robert

Robotec
- 19th April 2015, 15:59
Demon, thank you for yr reply.
Yes I saw it but unfortunately I don't know assembler.
Any help will be appreciated.

Bye

Roberto

Acetronics2
- 21st April 2015, 08:13
may be closer to pbp ...
http://en.pudn.com/downloads356/sourcecode/app/detail1551831_en.html

alain

Tabsoft
- 21st April 2015, 19:27
Not able to test this since I don't have the SDA5708, but this might get you started.
For a 16F887.

7806

Robotec
- 24th April 2015, 17:44
@ Acetronics2

Thank you for the link but unfortunately it needs to be member to see or download the code

@ Tabsoft

Thank you for the code. I'll try it. Do you think I could use an 877 ? I believe I do not need the extra features of the 887.
I'll check for the hardware.

Bye

Roberto

Tabsoft
- 24th April 2015, 19:22
I don't see any reason you couldn't use an 877.

You'll just have to adjust for the specific 877 hardware.
The test program only takes 1070 words of flash, so no problem there.

Tabsoft
- 24th April 2015, 22:34
You just have to be mindful of the size of the datatable.
As is, it takes 672 code words of space to store just the table.

There are ways to compress the table, but maybe for another discussion.