>> 1. How do you disable/reenable an interrupt? i mean in this system and to avoid using registers.
There are 2 macros, INT_ENABLE and INT_DISABLE.
Code:
@ INT_DISABLE TX_INT ; Disable USART Transmit interrupt
@ INT_ENABLE TX_INT ; Enable USART Transmit interrupt
@ INT_DISABLE INT_INT ; Disable external INT interrupt
>> 2. Is there any constrain about the handlers lenght?
The biggest thing to worry about is Time. If the interrupt handler takes a long time to do something, you run the risk of missing other interrupts. In general, the interrupt handler should be as short as possible, and it should NEVER contain pauses or routines that wait for something external to happen.
This forces you to think a little differently when writing interrupt driven programs. For instance, for USART RX, the interrupt handler should only be receiving the byte and placing it in a buffer. Don't try to HSERIN a whole string because it will take too long.
After placing the byte in a buffer, you would set a Flag to indicate that a byte is waiting, then somewhere in the main loop, the program should test that flag to see if it needs to do something with the data that has arrived.
As another example, say you measure a pulse width using Capture Mode. The interrupt handler will only grab the CCP1H:CCP1L value and save it to a variable, to be processed later in the main program. Attempting to Calculate the Actual Pulse width with complex formulas will take many hundreds, or even thousands of instruction cycles to complete, and any other interrupts that happen in the mean time will be lost.
>> 3. ...how can i work with an array? for example an 8 rows x 10 bytes array?
PBP doesn't have Multi-Dimensioned arrays, but it's easy enough to just make one big array and calculate the offset into it to accommodate the Rows.
Code:
array VAR BYTE[80]
Row VAR BYTE ' 0-7
COL VAR BYTE ' 0-9
Temp VAR BYTE
Row = 4
Col = 8
Array(Row*10+Col) = 69 ' Put 69 in Array(4, 8)
Temp = Array(Row*10+Col) ' Get value of Array(4, 8)
>> 4. How can i avoid filling my memory program with LCDOUT sentences?
http://www.picbasic.co.uk/forum/showthread.php?t=1999
>> 5. What is the difficulty about using this system in 18f452 like devices
The 18F interrupts can have either a High or Low priority. A high Priority interrupt can interrupt a Low priority interrupt that has already triggered. This presents some HUGE problems for the Instant Interrupt system, especially when using PBP Ints. The problems are not insurmountable, just HUGE.
>> 6. To many questions?
Yes. 
>> 7. I am using a matrix keyboard with portbchange interruption, but i am losing time (missing the tmr1 int) while i wait for the user to release at the kb
Again, never wait for anything in an interrupt handler. With RBC_INT, you'll start with all PORTB 3:0 set to Output Low, so that when the user presses a button you will get an interrupt. At this point scan the keypad real quick to see which button was pressed. Then set the bottom 4 bits back to Low again. Now, Read PORTB one more time before exiting (very important) to end any mis-match condition.
When the user releases the key, you will get another interrupt. Do the same thing again. But this time you should scan that no keys are pressed. Keep track of the Presses and Releases in the routine. Of course de-bouncing becomes more difficult too.
<br>
Bookmarks