8051 code in C language which can be tested using KEIL, NO IDEA AT ALL!

Discussion in 'Homework Help' started by mkuls25, Nov 24, 2010.

  1. mkuls25

    Thread Starter New Member

    Nov 24, 2010
    10
    0
    I need to move one stepper motor forward and the other one backward at the same time that will make the motor turn right or left or indirectly I want to make the motor turn rght and left, please give me the code for it. I have to program it on 8051 microcontroller! Please help as soon as possible!
     
  2. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    1. Don't double post
    2. What have you done so far, what part of your code are you having trouble with?
     
  3. mkuls25

    Thread Starter New Member

    Nov 24, 2010
    10
    0
    I have not done anything i have to start from base, please help me ! I have no idea about how to go with this, I require it for a project!
     
  4. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    Why should you pass your course if others do your assignment. Were you paying attention in class?
     
  5. mkuls25

    Thread Starter New Member

    Nov 24, 2010
    10
    0
    Actually I am forced to do this, I just dont have any idea, please help, just give me he the code in C language, because I know a bit of it.! please help! I beg!
     
  6. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    Forced? Were you kidnapped and told you must else they'll shoot your dog?
     
  7. mkuls25

    Thread Starter New Member

    Nov 24, 2010
    10
    0
    PLease just help, and there is nothing as that! PLEASE!
     
  8. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    Read the forum rules, you must make an effort we're not a do your homework for you forum.

    I'm still curious, how were you "forced" to do this? Is a kid stuck in a well and you're building the machine to get him out?
     
  9. mkuls25

    Thread Starter New Member

    Nov 24, 2010
    10
    0
    That's not a homework, I needed your help because I am in eleventh grade and I have an idea of C++, so my teacher had asked me to make a code for the above mentioned thing, that's why I am just unaware of how it functions! I just need the code so that I an give it to my friends who are also involved but they have a knowledge of hardware and not of software for which I am responsible, pleas understand! and help! It's a kind of an exhibit that they have to make for the PHYSICS EXHIBITION! and yes there is no judgement fot\r that we are no going to be awarded any thing for that! IT's kind of a compulsion! PLEASE HELP!
     
  10. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    When's it due? Where do they still teach the 8051?
     
  11. mkuls25

    Thread Starter New Member

    Nov 24, 2010
    10
    0
    I need it as soon as possible, I can just extend it till tomorrow! My teacher had asked me to make it on 8051, Please I need your help! PLEASE! If possible I need it today!
     
  12. mkuls25

    Thread Starter New Member

    Nov 24, 2010
    10
    0
    I need it as soon as possible, it's better that I get it today! I don't know why my teacher is using 8051, moreover this is the first time that I am working on a MICROCONTROLLER!
     
  13. mkuls25

    Thread Starter New Member

    Nov 24, 2010
    10
    0
    I need it as soon as possible, it's better that I get it today! I don't know why my teacher is using 8051, moreover this is the first time that I am working on a MICROCONTROLLER!
     
  14. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Same response as in other thread:

    We generally do not provide completed code.

    Show how far you have gotten with the project, and point out where you are having issues. Once that is done, we volunteers may help, we are NOT a homework completion service, but we are more than happy to help you step by step so you learn through the process. For this to happen, you need to show initiative, and show an ability to learn and apply what you have learned.

    Too many people have gotten degrees by simply getting answers from others, which devalues a degree. You do not want your degree to be worthless, do you?
     
  15. mkuls25

    Thread Starter New Member

    Nov 24, 2010
    10
    0
    I absolutely agree to you, but I am just a kid, I assure you that after I finish my project I will definitely dwell into its depth, I have not gone too far I am just new! BTW I have one code that is for up and down and that is for some software like UMPS! It's for moving up and down, can you modify it? I'll post it!
     
  16. mkuls25

    Thread Starter New Member

    Nov 24, 2010
    10
    0
    Org0000h
    glr a
    mov p1,a
    mov p2,a
    mov p3,a

    ba jnb p3.0,top
    ljmp ba
    top: Mov r2#255
    back: Mov a,#25h
    mov p1,a
    acall delay
    mov a,#29h
    mov p1,a
    acall delay
    mov a,#0ah
    mov p1,a
    acall delay
    mov a,#0,6h
    mov p1,a
    acall delay
    djnz r2, back
    mov p1,#0
    setb p3,0
    ljmp ba
    delay: Mov r5,#8
    h3: Mov r4,#8
    h2: Mov r3,#8
    h1: Djnz r3,h1
    djnz r4,h2
    djnz r5,h3
    ret
    end
     
  17. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
    That code is not using 'C' it is using Assembly language.

    You are going to have a real hard time if you do not even know the difference between the two.

    Have you tried searching the 8051 forums?

    Or try a google search for CNC using 8051 or 8051 stepper driver.

    Do you know if you are trying to control a bi-polar or uni-polar stepper motor?

    If you do not know, you NEED to.

    Find that out.

    I would like to add:

    BOY did you wait till the last minute. Should have got started a little earlier. Also, in the future, dont bite off more than you can chew.

    Have you been in contact with the other people on the team?

    Have you asked your parents or aunts or uncles if anyone has any experience with the 8051?

    I have taken the time to search google for you.

    Here:
    http://www.8051projects.net/stepper-motor-interfacing/stepper-motor-connections.php

    There is all you need to know to get it going, including C code.

    You NEED to find out what type of stepper you are using.
     
  18. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    Bit of advice with source code
    1. comment liberally
    2. use code tags when posting
     
  19. Kermit2

    AAC Fanatic!

    Feb 5, 2010
    3,795
    951
    It may just be that you should admit to your teacher that you exaggerated your ability in programming with C+ and you are not able to do this project.

    Poor planning in your situation, does not create any urgency to help on our end.
     
  20. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
    Agreed.

    If you continue along this path of exaggeration without planning and good organization skills, you will end up dying of heart trouble early in life, or being medicated for panic-attacks throughout life.

    Just because there is an internet, and it IS possible to learn anything does NOT mean you will understand and be able to absorb the information as displayed.

    Can you fix my jet engine? Ill give you $10,000 plus parts.

    You may think "Sure, I can find out how online and learn it as I go!"

    You are completely disregarding one VERY IMPORTANT THING.

    You are forgetting about experience. Experience counts more than free floating information.

    Anyway, I hope you get it together.

    The link I posted can get you in the right direction IF you know what type of stepper motor you are using.

    You probably accepted the role of programmer without knowing there was a difference. This is where experience would have come in handy.
     
Loading...