EASy68K
http://www.easy68k.com/EASy68Kforum/

assign address of 7-segment display
http://www.easy68k.com/EASy68Kforum/viewtopic.php?f=6&t=1045
Page 1 of 1

Author:  draquake17 [ Tue Oct 11, 2011 6:51 am ]
Post subject:  assign address of 7-segment display

hello. i just wanna ask how can you assign the address of the 7-segment display and the toggle switch? i can't find it through the net.
For example, this memory mapping:
E00000 7 segment display 0
E00002 7 segment display 1
E00004 7 segment display 2
E00010 toggle switch 0
E00012 toggle switch 1

thanks in advance.

Author:  clive [ Tue Oct 11, 2011 1:51 pm ]
Post subject: 

What's the question? How are they defined, or how are they used? Your question lacks clarity.

You can set the base addresses within SIM68K (View->Hardware), if you really need to change them. If you need to change them, please state the reasoning so the question can be better understood.

In assembler you can load the address into a register

Code:
  LEA $E00000,A0


or

Code:
  MOVE.L #$E00000,A0


or write a value directly

Code:
LEDS  EQU  $E00010

   MOVE.B D0,LEDS

Author:  draquake17 [ Tue Oct 11, 2011 2:23 pm ]
Post subject: 

clive wrote:
What's the question? How are they defined, or how are they used? Your question lacks clarity.

You can set the base addresses within SIM68K (View->Hardware), if you really need to change them. If you need to change them, please state the reasoning so the question can be better understood.



sorry for misunderstanding. what i meant was how the 7 segment display can be mapped to a certain address without touching the address on the 68k hardware. Is there a certain name to each 7 segment display so an address can be mapped with it through the source file? i'm sorry but it was required for us to map the 7 segment display on a certain memory address.

For clarity, if i want the following memory mapping:
E00000 7 segment display # 0
E00002 7 segment display # 1
E00004 7 segment display # 2
E00006 7 segment display # 3
E00008 7 segment display # 4
E0000A 7 segment display # 5
E0000C 7 segment display # 6
E0000E 7 segment display # 7

i cannot do it with just changing the base address in the easy68k hardware since the address are decreasing from display #7 to #0. If i put E0000E on the base address, the mapping would be this:
E0001C 7 segment display # 0
E0001A 7 segment display # 1
E00018 7 segment display # 2
E00016 7 segment display # 3
E00014 7 segment display # 4
E00012 7 segment display # 5
E00010 7 segment display # 6
E0000E 7 segment display # 7

sorry i'm not proficient in english so i couldn't clearly express the question. thanks for answering.

Author:  profkelly [ Wed Oct 12, 2011 12:30 pm ]
Post subject: 

There is no way to change the address of individual digits in the 7-segment display.

Author:  clive [ Wed Oct 12, 2011 2:48 pm ]
Post subject: 

Neither EASy68K or IDE68K handle their 7-Segment panel in this fashion. They both fill left-to-right.

If you have specific hardware that has different addresses you'll need to perform some level of abstraction when writing to the display. ie use EQU to define each element, or use DC.L to hold the address(es) and index into that table.

The addresses the simulator uses doesn't preclude you from assembling code at different addresses for your own hardware, it's just that you won't be able to simulate it. ie assemble then download the S-Records to your board and run it there.

Code:
   LEA SEGTBL,A1
   MOVEA.L   (A1)+,A0
   MOVE.B #$3F,(A0) ; 0
   MOVEA.L   (A1)+,A0
   MOVE.B #$06,(A0) ; 1
   MOVEA.L   (A1)+,A0
   MOVE.B #$5B,(A0) ; 2
   MOVEA.L   (A1)+,A0
   MOVE.B #$4F,(A0) ; 3
   MOVEA.L   (A1)+,A0
   MOVE.B #$66,(A0) ; 4
   MOVEA.L   (A1)+,A0
   MOVE.B #$6D,(A0) ; 5
   MOVEA.L   (A1)+,A0
   MOVE.B #$7D,(A0) ; 6
   MOVEA.L   (A1)+,A0
   MOVE.B #$07,(A0) ; 7

   MOVE.B   #9,D0
   TRAP   #15      ; halt simulator

SEGTBL   DC.L   $E0000E
   DC.L   $E0000C
   DC.L   $E0000A
   DC.L   $E00008
   DC.L   $E00006
   DC.L   $E00004
   DC.L   $E00002
   DC.L   $E00000

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/