Interrupt Service Routine for Car Ignition!

JAIHO

JAIHO

@jaiho-Hz9Ulk Oct 26, 2024

I need to write an Interrupt Service Routine in C, for microcontroller. I have no idea where to start. I have an idea of the difference between using an Interrupt and a Polling. And I am going to go with Interrupt.
Rather than making the Cpu ask the device , "is it done, is it done" until the device says " yes " .

I would rather just go with a Interrupt. Except I have no clue where to start , This is my 2nd project at this company.
How do you write an interrupt and how can i implement it on the development board ??

I really appreciate the help you can give me. Thanks.

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Harshad Italiya

    Harshad Italiya

    @harshad-ukH5ww Apr 4, 2009

    Dear Jai ho,

    First off all check that for interrupt which pin you are using and as you are using KEIL it shows the interrupt service routine for perticular pin... use that command..

    interrupt 1 using 2 or any other

    Or there is one more way..
    Continue checks that pin when that pin gets high or low edge then transfer your execution to ISR.

    Godfather

  • JAIHO

    JAIHO

    @jaiho-Hz9Ulk Apr 7, 2009

    Thanks Godfather. I completed the program.It's working now. Good luck with your studies ! I hope you do well.
    I Did some reverse engineering , to figure out how to configure the Timer, interrupt and ports.
    Thank you so much. I have another question that I am going to post. its' regarding adding a debounce code to the main Interrupt program I have.

    I have the interrupt routine working properly and the interrupt is edge triggered , from the Ignition.
    Now I want to debounce it and check if the edge has been triggered even after 1 second of the initial interrupt and PROCEED only after it's been confirmed. Any help you can give me , i will greatly appreciate it .