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
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