Dear Kenjj,
the complete code I've written for testing it is:
counter1 var word
counter2 var word
counter3 var word
counter4 var word
counter5 var word
counter6 var word
counter7 var word
counter8 var word
counters var byte
status1 var byte
status2 var bytemain
counter1 = 0
counter2 = 0
counter3 = 0
counter4 = 0
counter5 = 0
counter6 = 0
counter7 = 0
counter8 = 0
low P16
for i = 1 to 4000
status1 = inl
pauseus 250 'I set a pause of 0.25 millisec to acquire a signal of max freq of 2000 HZ
status2 = inl
counters = status1 ^ status2 'I compare every bit each other so that if the i-th bit is different between
'status1 and status2 I have a transition in input signal
if counters.bit0 = 1 then 'bit0 corresponds to channel 1
counter1 = counter1 + 1 'counter1 increments itself for every transition 1-0 or 0-1 so that in one second I have all
' the transitions in variable counter1 for channel 1
endifif counters.bit1 = 1 then 'bit1 corresponds to channel 2
counter2 = counter2 + 1 'counter2 increments itself for every transition for channel 2
endif
if counters.bit2 = 1 then
counter3 = counter3 + 1
endif
if counters.bit3 = 1 then
counter4 = counter4 +1
endif
if counters.bit4 = 1 then
counter5 = counter5 + 1
endif
if counters.bit5 = 1 then
counter6 = counter6 +1
endif
if counters.bit6 = 1 then
counter7 = counter7 + 1
endif
if counters.bit7 = 1 then
counter8 = counter8 +1
endifnext
high P16 'LED on for tests delay in for - next cycle
pause 10
serout P20,I9600,["C1:",dec counter1,"C2:",dec counter2,"C3:",dec counter3] 'it sends to the display the strings
goto mainThe manual I read the instructions for ATOM is of version 3.0.0.2 and the page in wgich is explained the command "INL" is 43.
I have only read the code for sampling the 8 channels for counters, if I also add the code for analogic channels (ADIN...) the delay is increasing more and more..
Kind Regards
Deny