This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

8051F120 Hardware Interrupt

Hi all. I am fairly new to micro controllers and I am wondering how to go about creating a hardware interrupt with the 8051F120.

I have a simple program and I want a button to be a hardware interrupt as at the moment i have tried to embed it in sections of the code where I think it will occur, but it is causing bugs.

As far as I am aware the only way I can do it is by creating an interrupt after a given time period with the timers. Is a way to create an interrupt when a particular pin changes state?

Regards,

Jeremy

Parents
  • how to create a hardware interrupt would depend on the hardware.

    it looks like you want to use pin change interrupt. if that's the case, read the datasheet to identify the pcint. configure the pcint to be active, and in your isr, process the interrupt and trigger whatever action you want.

Reply
  • how to create a hardware interrupt would depend on the hardware.

    it looks like you want to use pin change interrupt. if that's the case, read the datasheet to identify the pcint. configure the pcint to be active, and in your isr, process the interrupt and trigger whatever action you want.

Children