Hi, I'm doing a project with a 80C32 processor. I'm lacking, however, interrupts. Is there a (tricky) way to have more than the standard provided interrupts at your disposal? --Geert
I think you can have two or more interupts on the same pin.. Inside the interrupt routine you have to check which source caused that interrupt (for example: you can have the external interrupt sources place a certain word on one of the ports or simply make one of the port pins go low) but of course you have to be sure that no 2 interrupts on the same pin can occcur simultaneously.. Hope I was helpful..
I assume by "tricky" you mean something other than dropping an external interrupt controller onto the board?
Hi, If you have spare pins available on your micro, you could try (wire) anding all your external interupt sources together and feeding that resultant signal to an interrupt pin but you also have to connect each interrupt source to a separate pin that you can then test to see what caused the interrupt. The interrupt is set as edge rather than level triggered and once you hit the routine you MUST check all of the interrupt sources's (by checking each of the port pins you have connected them to) to ensure that you pick up (near) simultaneous interrupts because only one irq request will be generated. Also DONT clear the interrupt flag (e.g. clr EX0) within the routine as it is perfectly possible that a new irq can occur once you are inside the irq. I seem to recall that we also had a status flag for each irq source that was set to TRUE/FALSE within the interrupt so that we could tell if we had alredy detected this source and take appropriate action if need be. You must also be careful that in the worst case that all interrupting source's servicing doesnt take too long such that whilst you are processing them that one of the other sources doesnt have time to go inactive before it can be processsed otherwise you will not know about it. Hope this helps, Mark.
Hello Drew, Indeed, 'tricky' means a way to have this without extra external components. But I read the response of Mark and this seems quite interesting. More over, I found a link to a site that explains just this (I think...): http://www.elecdesign.com/Articles/ArticleID/2189/2189.html Pls. have a look at this. Really interesting and maybe a solution for my problem. It's, like Mike said, based on a combination of some extra AND-gates (oops, still extra hardware, but not heavy ones...) and a few pins of a port you have to sacrifice. But I think that will do the job. Unless you have other, more 'tricky', ideas? --Geert
"like Mike said, based on a combination of some extra AND-gates (oops, still extra hardware, but not heavy ones...)" Actually Mike suggested Wire-AND - which would require no extra components!
If you load a timer with 0xffff and use the external input (counter) configuration, you will get an interrupt when the pin toggles. This can be done with all timers. With this method the interrupts can be edge, with the above hardware suggestion, they have to be level. A third possiblity is to use a derivative with comparators (philips LPC (<$1), Cygnal) and use the comparator interrupts. A fourth is to 'play' with the PCA/CCA. as a fifth I believe you can trick the UART, IIC and SPI interface interrupts to act as external interrupts. Erik