1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Micro-controller Programming Problem - Assembly

  1. Jan 18, 2010 #1
    1. The problem statement, all variables and given/known data

    I am writing a program to loop (rotate) two lit LEDs through eight LEDs on my board.
    For Example:
    11000000 01100000 00110000 00011000 00001100 00000110 00000011

    Where the ones are lit LEDs and the zeros are non-lit LEDs.

    It is supposed to loop forever.

    2. Relevant equations

    N/A

    3. The attempt at a solution

    The program is in the text file attached. The program was pretty much already written for me. We had to take the tutorial code the looped one LED and allow it to loop two while also created a initialization subroutine.

    This program worked the first time I built it though I recently built it again with no changes and it does not work, whilst simulating it loops through the Init subroutine forever.

    My Questions:
    What is cblock?, it isn't in the datasheet for my pic.
    What does endc do? also not in the datasheet.
    Why does my init subroutine continue to loop?

    I'm very new to assembly programming, though I do have a background in VHDL, Verilog, C++, MATLAB, and JAVA.

    Thank you.

    EDIT: I found that the reason why it was continuously looping through the Init subroutine was because I forgot to add "goto Start" after org 0, though now it only flashes the LEDs once and then they turn off indefinitely.

    Now it works, feel free to delete this post.
     

    Attached Files:

    Last edited: Jan 18, 2010
  2. jcsd
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Can you offer guidance or do you also need help?
Draft saved Draft deleted