Simple interrupt


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Aug 2008
    Posts
    42


    Did you find this post helpful? Yes | No

    Default Re: Simple interrupt

    Wow, all of that for an interrupt huh. Maybe I should try some other way, all that code looks like Greek to me. Is all that crap really necessary?
    I do appreciate any help but I hate assembly language , mainly because I don't know it. This all really leaves me scratching my head.

  2. #2
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Simple interrupt

    You don't have to know it.
    You only need to change one label and never look at it again
    (assuming I've got it right which is an assumption :P

  3. #3
    Join Date
    Aug 2008
    Posts
    42


    Did you find this post helpful? Yes | No

    Default Re: Simple interrupt

    I think Steve is on to something, most of the time program execution works great. It is when it goes into the long pauses, necessarily so, that I can't stop the program. Wait........Just tried it and it seems to work !!!
    I put Steve's code in where there was the pause 20000 and it I pleased thus far in my tests on the bench. I noticed the other day while driving that unless your going uphill your are really giving your car very little throttle and therefore the stepper motor must do the same thing and make slow adjustsments and await the result and either adjust or continue to hold the throttle right where it is. This program will hopefully do that. I'm sure that it will need further tweaking. I just mounted my stepper motor and made an arm that is mechanically connected to my throttle valve. Next I am going to build the hardware for the project, (an enclosure for my electronics, mounting switches etc). My Kudos to Steve and Art. I will post my results in few days.

    Thank You Thank You
    Thank You Thank You

  4. #4
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Simple interrupt

    That method will work unless you brake while program execution is being held up by the COUNT command.
    If you decided to brake while that command was starting out it's time duration, it would take 2.5 seconds
    for your program to know you hit the brakes, and if you brake for less than 2.5 seconds at that time,
    your program will never register it. Sub standard for an auto application.

  5. #5
    Join Date
    Aug 2008
    Posts
    42


    Did you find this post helpful? Yes | No

    Default Re: Simple interrupt

    True but at 20 mhz that 2.5 seconds seems more like 1 second, Also I can lower this to say 1000 and it still works well. A less than elegant solution, I know, but I am not a programmer. If I am unsatisfied with it on the road then I may try a relay attached to the brake switch that controls mclr. I just thought that in PicBasicPro you could enter a few simple lines of code like ON INTERRUPT GOTO START and it was as easy as pie, I guess not. Everyone says read the spec sheet on the chip, well I have downloaded them and I am still lost. I guess I am just to damn old to understand it.

  6. #6
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Simple interrupt

    At 20 Mhz, that 2.5 second delay is only going to be half a second... much more acceptable.
    Didn't see that in your comments before.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts