@cogier
I would need to see more of your old code to work out exactly what you are after but I hope this is a start.
Hello cogier - thanks for the warm welcome!! Here is the desired code and many thanks for your prompt answer - that´s what I needed!!!!!!
P.S: sResult - shouldn´t it be Integer? That´s what represent the counts and they have to be added...but when I try to make sResult Integer I get an error message :(
$regfile "ATtiny13.DAT"
$crystal = 96000000
$hwstack = 32
$swstack = 8
$framesize = 16
'---------------------------------------------------------------------------
Dim Counts As Integer 'Declaration
Counts = 0 'of
Dim Sekunden As Integer 'the variables
Sekunden = 0 'all values to 0
Const Timervalue = 40 'equals 1 second at 9,6 MHz
'---------------------------------------------------------------------------
Led Alias Portb.0 ' Led connected to PORTB.0
Led = 0 ' for making the counts visible
Config Led = Output ' not needed for the actual program
'---------------------------------------------------------------------------
Config Portb.1 = Input 'PortB.1 (INT0) - where signal from geigercounter arrives
'---------------------------------------------------------------------------
On Int0 On_int0 'declaring Label "On_int0"
Config Int0 = Falling 'Interrupt at falling edge
Enable Int0
Enable Interrupts
'---------------------------------------------------------------------------
Config Timer0 = Timer , Prescale = 1024
Enable Timer0
Timer0 = Timervalue ' Timer0 is charged with "Timervalue" = 1 second
On Timer0 Timer_interrupt
'---------------------------------------------------------------------------
Open "comb.3:9600,8,n,1,INVERTED" For Output As #1
' activate Software-UART on Attiny13 - TX is PORTB.3
'---------------------------------------------------------------------------
Do
!nop 'mainprogram - no Action!
Loop
End
'---------------------------------------------------------------------------
On_int0: 'on interrupt jump to this label
Incr Counts ' Increment Counts on each Interrupt
Led = 1 ' LED is blinking on each Count
Waitms 10
Led = 0
Return 'back to the main program when done
'---------------------------------------------------------------------------
Timer_interrupt: 'jump to this label once in a second
'increment by 1 each second
Incr Sekunden
If Sekunden = 60 Then 'after 60 seconds counting of events is done
Then
Sekunden = 0
Print #1 , Counts 'send value to the serial as counts per minute (cpm)
Counts = 0
End If
Return