SAA1064 display driver I2C

Peter KWS
Benutzer
Avatar
Gender: n/a
Age: 41
Posts: 18
Registered: 11 / 2011
Subject:

SAA1064 display driver I2C

 · 
Posted: 25.12.2014 - 21:26  ·  #1
Hi all. Have a nice holidays. I have a question about I2C SAA1064 display driver. I built circuit according to SAA1064 datasheet with four displays (multiplexed in dynamic mode) and try it driving by I2Cport library.

Main test program

.....................................................................................................................

program Modul3CPU;

{ $BOOTRST $00C00} {Reset Jump to $00C00}
{$NOSHADOW}
{ $WG} {global Warnings off}

Device = mega8, VCC=5;

Import SysTick, SerPort, I2Cport;

From System Import ;


Define
ProcClock = 16000000; {Hertz}
SysTick = 10; {msec}
StackSize = $0032, iData;
FrameSize = $0032, iData;
SerPort = 9600, Stop1; {Baud, StopBits|Parity}
RxBuffer = 8, iData;
TxBuffer = 8, iData;
SerPortDTR = PinD, 2, Positive;
I2Cport = PortC;
I2Cdat = 4;
I2Cclk = 5;

Implementation

{$IDATA}

{--------------------------------------------------------------}
{ Type Declarations }

type


{--------------------------------------------------------------}
{ Const Declarations }

{--------------------------------------------------------------}
{ Var Declarations }
{$IDATA}
VAR SysLEDG[@PortD, 5] : Bit;
SysLEDR[@PortD, 6] : Bit;



{--------------------------------------------------------------}
{ functions }

procedure InitPorts;
begin
DDRB:= %00000111;
DDRC:= %00001110;
DDRD:= %11111000;
end InitPorts;


{--------------------------------------------------------------}
{ Main Program }
{$IDATA}

begin
InitPorts;
EnableInts;


mdelay(200);
loop
SysLEDR := false;
SysLEDG := true;


I2Cout(%01110000,%00000000,%01111111);
mdelay(500);

endloop;
end Modul3CPU.


I send every 500ms 3byte.

byte1 is adress, my adress pin on SAA is on GND = 0V therefore adress is 0.
byte2 is master register SAA and determines data from byte 3. I send 0 for setup SAA.
byte3 is data for setup SAA, I want set dynamic mode, segments 1,2,3,4 ON, test mode ON,
output current for all segment max value.

is my program all right? This is my first experience with I2C. Displays not works.
Hardware connections is ok. On i2c pins i have PullUp rezistors 10K.

Any idea? thanks Peter :)
Harry
Moderator
Avatar
Gender:
Location: zwischen Augsburg und Ulm
Age: 59
Posts: 2134
Registered: 03 / 2003
Subject:

Re: SAA1064 display driver I2C

 · 
Posted: 26.12.2014 - 18:36  ·  #2
Hi Peter,

i think the adress is wrong. %01110000 = $70. The right adress is $38 = %00111000.

Code
 { SAA1064 Steuerung                                                        }
    { Adressen $38, $39, $3A, $3B                                              }
    { 2.Byte: $00 = Control-Register, $01 - $04 = Digit 1 - 4                  }
    { Control-Register: Bit 7 = Reserved                                       }
    {                   Bit 6 = +12mA, Bit 5 = +6mA, Bit 4 = +3 mA             }
    {                   Bit 3 = 1=Segment-Test / 0=Normal-Mode                 }
    {                   Bit 2 = Digit 2 + 4 are blanked/not blanked 0/1        }
    {                   Bit 1 = Digit 1 + 3 are blanked/not blanked 0/1        }
    {                   Bit 0 = 0=Static-Mode Digit 1&2/1=Dynamic-Mode 1&3 2&4 }

    I2COut($38,$00,$4F);     { 12mA, Segmenttest, dynamic Mode, Stelle 1-4     }
    MDelay(1500);
    I2COut($38,$00,$47);     { 12mA, Segmenttest aus, dynamic Mode, Stelle 1-4 }

    For Counter:=1 to 4 do   { Alle Stellen löschen                            }
      I2COut($38,Counter,0);
      EndFor;


On AVRCo you must shift right the adress from datasheet. The lowest bit means read/write.

Greetings
Harry
Peter KWS
Benutzer
Avatar
Gender: n/a
Age: 41
Posts: 18
Registered: 11 / 2011
Subject:

Re: SAA1064 display driver I2C

 · 
Posted: 26.12.2014 - 21:08  ·  #3
Yess!! Thank you very much! Now with new adress displays works great. i have SAA1064T and datasheet is from SAA1064 where is slave adress 0 1 1 1 0 A1 A0 1. Maybe old datasheet. Happy new Year 2015 Harry. (are you biker? :) i have tooo bike. CBR1000RR 2005, good machine :))

have nice day
Harry
Moderator
Avatar
Gender:
Location: zwischen Augsburg und Ulm
Age: 59
Posts: 2134
Registered: 03 / 2003
Subject:

Re: SAA1064 display driver I2C

 · 
Posted: 26.12.2014 - 22:34  ·  #4
$70 IS the right adress, but AVRCo expected one right-shift at the adress.
example:
datasheet says %01110000 --> AVRCo %00111000
datasheet says %01101100 --> AVRCo %00110110

yes i'm a biker GSF1200S and a little GS500

Thanks and also a happy new year 2015.

Harry
Peter KWS
Benutzer
Avatar
Gender: n/a
Age: 41
Posts: 18
Registered: 11 / 2011
Subject:

Re: SAA1064 display driver I2C

 · 
Posted: 27.12.2014 - 09:59  ·  #5
Yes now i understand. Thank you for the explanation :) GSF1200S good bike :) Have nice day .)
Selected quotes for multi-quoting:   0

Registered users in this topic

Currently no registered users in this section

The statistic shows who was online during the last 5 minutes. Updated every 90 seconds.
MySQL Queries: 15 · Cache Hits: 14   94   108 · Page-Gen-Time: 0.025347s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI