Hi, I am a member of this forum for a long time, only share information when I think I can be useful, I think this time I can be of help commenting on how you can use the PCIE interruption in Atmel ATTINY85 or ATTINY45 programming in BASCOM.
I wrote this little program that reads the interrupt vectors, and execute any routine in case the input-PCINT change state.
$regfile = "attiny45.dat"
$crystal = 1000000
Config Portb = &B11100001 'config inputs / outpus
Config Timer0 = Timer , Prescale = 1 'need timer to check interrupt vector
Dim Flag As Byte
Enable Interrupts
Enable Timer0
Set Pcmsk.pcint1 'configure pin to be sensed
Set Pcmsk.pcint2
Set Pcmsk.pcint3
Set Pcmsk.pcint4
Set Gimsk.pcie 'enable PCIE
On Timer0 Active 'go sub active
Set Portb.0 'set pin to see activity
Flag = 1
Start Timer0
Do
Wait 5
Flag = 0
Wait 1
If Flag = 0 Then
Reset Portb.0
End If
Loop
Stop Timer0
End
Active:
If Gifr.pcif = 1 Then 'check interrupt
Reset Gifr.pcif
Flag = 1
Set Portb.0
End If
Return
I hope this example will be clear to everyone, I apologize to everyone for my bad English I wrote this post with the help of a translator, if anyone has doubts about the functioning of the code will answer any question with pleasure.
Thanks to all