Need help in programming

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • JLam
    Junior Member
    • Feb 2005
    • 1

    Need help in programming

    Hi I'm new here. I'm an engineering student and i'm having a little problem writing a program using Motorola's 68000. I need to complete a program that can display and Hexadecimal number on 2 seven segment displays upon entry of binary inputs from the user via switches (If switch is ON then is logic "1" and vice versa). For example, if the display displays FF on both 7-seg displays, it means that user has already ON-ed all 8 switches, inputing "11111111" to the processor. I'm using a Motorola 68k series microprocessor training kit to simulate this program. Anyone can help me please!!!

    If you can't understand what i was trying to say earlier, this is the actual question: 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.

    The schematic of the output is attached below:
    Attached Files
  • siberian
    Member
    • Dec 2004
    • 34

    #2
    Ahh, I remember this assignment.

    Unfortunately I don't remember the answer since you will probably never in your professional life ever encounter the problem

    Its easiest in assembler, especially on the 68k processor (they teach with 68k since it is so easy).

    Regardless, the HT Guide is probably the wrong place to ask this, try google.

    Comment

    • Kevin P
      Member
      • Aug 2000
      • 10808

      #3
      I don't know 68000 assembler, though I did some dabbling on the 6809 in a prior life.

      Basically, you need to break the problem down into easily digestible pieces.

      1) Reading a byte from PortC.
      2) Breaking the byte into two 4-bit "nybbles" (in order to translate each into a hexadecimal digit).
      3) Use a lookup table to convert the 4-bit values into two 7-segment hexadecimal digits.
      4) Code a loop that cycles through PC0 thru PC3, while applying the appropriate translated 7-segment value on PB0-PB7.

      Because the 7 segment displays (plus decimal) equals 8 bits, a 16-byte lookup table in memory would work. Assuming PB0 in your schematic is the least significant bit, the following values would display as hexadecimal digits:

      0: 00111111 (3F)
      1: 00000110 (06)
      2: 01011011 (9B)
      3: 01001111 (4F)
      4: 01100110 (66)
      5: 01101101 (6D)
      6: 01111101 (7D)
      7: 00000111 (07)
      8: 01111111 (7F)
      9: 01101111 (6F)
      A: 01110111 (77)
      B: 01111100 (7C)
      C: 00111001 (59)
      D: 01011110 (5E)
      E: 01111001 (79)
      F: 01110001 (71)

      Comment

      Working...
      Searching...Please wait.
      An unexpected error was returned: 'Your submission could not be processed because you have logged in since the previous page was loaded.

      Please push the back button and reload the previous window.'
      An unexpected error was returned: 'Your submission could not be processed because the token has expired.

      Please push the back button and reload the previous window.'
      An internal error has occurred and the module cannot be displayed.
      There are no results that meet this criteria.
      Search Result for "|||"