Problem with Disp7sPort

  • 1
  • 2
  • 3
  • Page 3 of 3
Harry
Moderator
Avatar
Gender:
Location: zwischen Augsburg und Ulm
Age: 59
Posts: 2134
Registered: 03 / 2003
Subject:

Re: Problem with Disp7sPort

 · 
Posted: 07.02.2015 - 15:24  ·  #17
Hello Thomas,

on my mega644 works it, but only with DDRC:=%00001111; .

Insert it after EnableInts;

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

Re: Problem with Disp7sPort

 · 
Posted: 07.02.2015 - 15:59  ·  #18
I tested something and I hope that I can explain it with my bad english:

If you are sending on a double-digit display a one-digit number, the driver sends only one digit. The contents of the first display is shifted to the second. even if two digits are defined. This applies to "write (DispOut, ByteToStr (i));"

With "write (DispOut, ByteToStr (i:2));" the driver sends always two digits.
3xcs
 
Avatar
 
Subject:

Re: Problem with Disp7sPort

 · 
Posted: 07.02.2015 - 20:18  ·  #19
Hello!! Many many thanks for all the info and all the help!!!!!!!! :) :) You have a very good english!!!!

I have tried it and it´s better....now the two displays lights :) But display two act a little strange. I will try to attach a file showing how it looks like.

The program i´m running in the film is this code...

program Disp7s;

{ $NOSHADOW}
{ $W+ Warnings} {Warnings off}

Device = mega168;

Import SysTick, Disp7sPort;

From System Import ;

Define
ProcClock = 16000000; {Hertz}
SysTick = 10; {msec}
StackSize = $0020, iData;
FrameSize = $0020, iData;
Disp7sPort = PortC, nonmux;
DispDigits = 2, iData;
DispMode = shiftLeft;


Implementation

{$IDATA}

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

type


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

{--------------------------------------------------------------}
{ Var Declarations }
{$IDATA}
var
i : byte;

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

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


begin
EnableInts;
DDRC:=%00001111;
mDelay(1000);
loop
for i:=10 to 20 do
write (DispOut, ByteToStr(i:2));
mDelay(1000);
endfor;
endloop;
end Disp7s.

Kindest regards
Thomas
Attachments
 
Filename: digits.mpg
Filesize: 3.13 MB
Title: Digits
Download counter: 45
3xcs
 
Avatar
 
Subject:

Re: Problem with Disp7sPort

 · 
Posted: 07.02.2015 - 20:42  ·  #20
This is very strange! hmmm.....
If i declare some variables, like a string under var, the second digit is completly dark again. If i remove the decleration except i : byte; digit 2 starts lights again, but with the behaivor like in the film i posted. I don´t know if it's me, my AVR-controller or the AVRCO installation on my pc gone mad!!! Ha ha! :P I will try to write something that does the same as the Disp7port does to see if my hardware is faulty.

Kindest regards
Thomas
Merlin
Administrator
Avatar
Gender:
Age: 24
Posts: 1409
Registered: 03 / 2005
Subject:

Re: Problem with Disp7sPort

 · 
Posted: 07.02.2015 - 21:20  ·  #21
i don't know if this is relevant, but your stack and particularly your frame seems very small. The first digit looks OK, so I would certainly try doubling the frame and see if it makes a difference.
3xcs
 
Avatar
 
Subject:

Re: Problem with Disp7sPort

 · 
Posted: 07.02.2015 - 21:55  ·  #22
Thanks very much for the reply. I tried to set $0064 on both Stack and frame but the same result. Thanks anyway!

Kindest Regards
Thomas
Harry
Moderator
Avatar
Gender:
Location: zwischen Augsburg und Ulm
Age: 59
Posts: 2134
Registered: 03 / 2003
Subject:

Re: Problem with Disp7sPort

 · 
Posted: 07.02.2015 - 22:21  ·  #23
What happens when you're connect PortC,3 to RCK ?

Please check the connections from right display.

Try this:
Code

For i:=0 to 255 do
  Disp7Buff[0]:=i;
  Disp7Buff[1]:=i;
  DispRefresh;
  MDelay(1000);
  EndFor;


instead of your for...next loop.

both display should now count synchron binary up. Segment A=2^0 ..... segment G=2^6 ..... decimal point=2^7

You have already installed resistors between ICs and displays ?
  • 1
  • 2
  • 3
  • Page 3 of 3
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: 16 · Cache Hits: 14   121   135 · Page-Gen-Time: 0.057514s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI