Programming

Discussion in 'Homework Help' started by Kayne, Apr 28, 2009.

  1. Kayne

    Thread Starter Active Member

    Mar 19, 2009
    105
    0
    Hi Everyone


    My question is If i was to display the number 12345 on a set of 5 LEDs connected to the parallel port B - PB0(lsb)toPB4(msb). When the displayed is on it will stay on for 5 seconds and then off for 2 seconds. Once all bar code patterns have been displayed the program will stop and the LEDs will be OFF.

    Am I going about this question the right way, if i have not explained myself enough i will try again.

    I have attached a TXT file with my assembly code



     
    • LED.txt
      File size:
      1.9 KB
      Views:
      35
    Last edited: Apr 28, 2009
  2. StayatHomeElectronics

    Well-Known Member

    Sep 25, 2008
    864
    40
    I am not the correct person to answer the question as I have not ever done assembly code; however, could you state what your question or problem is with the design? I understand what you are trying to do with the LEDs. I do not have a clear understanding of what additional information you are looking for.
     
  3. Ratch

    New Member

    Mar 20, 2007
    1,068
    3
    Kayne,

    What you really need to do is disclose what assembler/language you are using and for what CPU you are coding.

    Ratch
     
  4. Kayne

    Thread Starter Active Member

    Mar 19, 2009
    105
    0
    Thanks for the heads up probably is a good idea to tell you what processor i am using.
    The assembler program i am using to write the code is called THRSim11 simulator software and the processor i am trying to program is the Motorola m68hc11.
     
    • LED.txt
      File size:
      1.9 KB
      Views:
      22
  5. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    Is this a "persistance of vision" (POV) project? I ask that because you mention that you write the number 12345 on a set of only 5 leds.

    hgmjr
     
  6. Skeebopstop

    Active Member

    Jan 9, 2009
    358
    3
    Why not do it in C? So much easier.

    Regardless. Just took a quick look. These are 7 segment displays no? That means you'll need 7 bits to represent any given number, I only see 5 in your code.

    I'll go ahead and assume it is going through a decoder.

    Regardless, can't do much more. Not a fan of assembly. I like the idea of technological progress getting us out of such nitty gritty.

    Only the gurus at my work would argue, when they are able to optimize 3-4 instructions out of a real-time control loop, versus the C compiled version. I roll my eyes at them.
     
  7. Kayne

    Thread Starter Active Member

    Mar 19, 2009
    105
    0
    Hi,
    No its not a 7 segment display and there is no mention of POV for this. The question asks to display a bar code patterns, for each digit 12345. The Hexpat i have used are the binary code for digits 0-9, this is explained more in the attachment. I think that these binary numbers are what needs to display on a led.

    Hopefully this helps more.
     
Loading...