All About Circuits Forum  

Go Back   All About Circuits Forum > Software, Microcomputing, and Communications Forums > Programmer's Corner

Notices

Programmer's Corner Discussion forum for all aspects of programming and software engineering. Any software programming language welcome: C, C++, C#, Fortran, Java, Matlab, etc.

Reply   Post New Thread
 
Thread Tools Display Modes
  #1  
Old 02-15-2005, 08:08 AM
JLam JLam is offline
New Member
 
Join Date: Feb 2005
Location: Malaysia
Posts: 2
Send a message via ICQ to JLam Send a message via MSN to JLam Send a message via Yahoo to JLam
Thumbs down

Hi, I'm new here, i'm having difficulty completing a program on my own. I was given a task to complet 3 programs. I've completed the first 2 but having problems with the last one. Can anybody help me out here? The description of my tasks are below:

Hardware Configuration

The hardware configuration of the 68000 applications boards in the laboratory are as shown in Figure 1. Data to all four seven segment displays is supplied via PortB. A display is activated by outputting a logic 1 on the corresponding Port C control line e.g. outputting a logic 1 will turn on the LSD (Least Significant Digit) display.

Experiment

1) Develop a 68000 assembly language program to produce a count down sequence on the LSD seven segment display after switch connected to PC4 has been asserted.

2) Develop a program that will display the hexadecimal equivalent on the LSD seven segment display of any binary input from PortC bits PC4 to PC7.
(Hint: Use MOVE. B (A0,D0),D1 - Move the byte value from the memory location pointed to by A0 + D0 into D1 where D0 is the four bit value read from the switches).

3) Complete a program that will read any byte value from PortC and display the corresponding hexadecimal values on two seven segment displays. It will be necessary to time multiplex the displays so that the correct value is displayed on the right display at the right time.

Like i mentioned earlier, i've completed task 1 and 2 but i'm stuck with task 3. The circuit diagram of the 7-seg is attached below as well as the program for task 2. My lecturer told me that tasks 2 and 3 are similar but no matter how i tried, i still can't make it work. So if there's a kind soul out there, please help me out I'll be so grateful to u The attachments are below. Thanks.

Joseph

Task 2 program:

PBDDR EQU $A00007 ; DATA DIRECTION REGISTER (TO CONFIGURE I/O)
PCDDR EQU $A00009 ;
PBDR EQU $A00013 ; ADDRESS OF PORTS AS SHOWN IN DIAGRAM
PCDR EQU $A00019 ;

ORG $400400

MOVE.B #$FF,PBDDR ; SET PORT B AS O/P
MOVE.B #$0F,PCDDR ; SET PORT C 0-3 0/P, 4-7 I/P
MOVE.B #$01,PCDR ; ENABLE LSD OF 7-SEG DISPLAY

BEGIN LEA DATA,A0 ; DEFINE DATA ADD
CLR.B D0 ; RESET D0
CLR.B D1 ; RESET D1
MOVE.B PCDR,D0 ; GRAB 4 BIT DATA INPUT FR ABITEC
ASR.B #4,D0 ; SHIFT 4 BITS TO THE RIGHT AND.B #$0F,D0 ; MAKE LEFT 4 BITS TO BE 0

CHECK SUB.B #$00,D0 ; CHECK I/P NO.
BEQ DISPLAY

INCR ADD.L #$01,D1 ; INCREASE DATA ADD BY $1
SUB.B #$01,D0 ; SUB I/P NO.
BNE INCR

DISPLAY ADDA.L D1,A0 ; ADDING DATA ADD
MOVE.B (A0),D2 ; LOAD THE DATA
MOVE.B D2,PBDR ; DISPLAY DATA
BRA BEGIN ; RESTART

DATA DC.B $3F,$06,$5B,$4F,$66,$6D,$7D,$07
DC.B $7F,$6F,$77,$7C,$39,$5E,$79,$71

END
Reply With Quote
Reply   Post New Thread

Tags
,


Related Site Pages
Section Title
Worksheet Digital display circuits


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem when programming avr through genius g540 universal programmer khan yousufzai Embedded Systems and Microcontrollers 0 11-01-2012 08:43 PM
parallel port programming problem khan yousufzai Embedded Systems and Microcontrollers 1 10-19-2012 12:21 PM
ASM Programming problem Jakob90 Embedded Systems and Microcontrollers 2 01-14-2009 04:34 PM
PIC Programming Problem m_mourad2008 Embedded Systems and Microcontrollers 1 03-08-2008 02:42 PM

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:21 PM.


User-posted content, unless source quoted, is licensed under a Creative Commons Public Domain License.
Powered by vBulletin
Copyright ©2000 - 2014, vBulletin Solutions, Inc.