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
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.
Thanks for the fast response.
I just had a look on the data sheet and I could not find anywhere a pin change interrupt, or pcint.
This is the micro I am using:
www.silabs.com/.../DownloadDoc.aspx
:S
I could not find anywhere a pin change interrupt look for "external interrupt"
it also might help if you looked at the actual datasheet
www.silabs.com/.../C8051F12x-13x.pdf
Erik