I have been playing with the timer on a 20X2. Ideally I would need it to activate and deactivate from picaxe input.
I tried this
I provided different time between each input using a 28X1 which has quite good accuracy according to my scope
I expected it to be around 2ms over with 1ms input from the 28X1 which is there or there about. I upped the time to 100ms and consistently got 86ms reading from the 20x2 timer, and when I tried 1000ms I got a reading of ~866ms. This can get to more than a second at 10 second time intervals.
I don't really want to use Hippy's high accuracy timer due to both hardware and software increases, and later a plan to try and use the same timer to look for a specific time interval.
I was hoping for a 0.5ms resolution but if accuracy is going to be better by dropping the resolution that will have to be done, but I cant go any lower than 1ms resolution
I tried this
Code:
[color=Navy]#no_data
#no_table[/color]
[color=Blue]setfreq m8[/color]
[color=Navy]#terminal 9600[/color]
[color=Black]main:
[/color][color=Blue]do while [/color][color=Purple]pinb.3 [/color][color=DarkCyan]= [/color][color=Navy]0
[/color][color=Blue]loop
settimer [/color][color=Navy]65521
[/color][color=Blue]do while [/color][color=Purple]pinb.4 [/color][color=DarkCyan]=[/color][color=Navy]0 [/color][color=DarkCyan]and [/color][color=Purple]timer [/color][color=DarkCyan]< [/color][color=Navy]60000
[/color][color=Blue]loop
settimer off
sertxd ([/color][color=Black]#[/color][color=Purple]timer[/color][color=Black],[/color][color=Navy]13[/color][color=Black],[/color][color=Navy]10[/color][color=Blue])
let [/color][color=Purple]timer [/color][color=DarkCyan]= [/color][color=Navy]0
[/color][color=Blue]do while [/color][color=Purple]pinb.3 [/color][color=DarkCyan]= [/color][color=Navy]1
[/color][color=Blue]loop
goto [/color][color=Black]main[/color]
I expected it to be around 2ms over with 1ms input from the 28X1 which is there or there about. I upped the time to 100ms and consistently got 86ms reading from the 20x2 timer, and when I tried 1000ms I got a reading of ~866ms. This can get to more than a second at 10 second time intervals.
I don't really want to use Hippy's high accuracy timer due to both hardware and software increases, and later a plan to try and use the same timer to look for a specific time interval.
I was hoping for a 0.5ms resolution but if accuracy is going to be better by dropping the resolution that will have to be done, but I cant go any lower than 1ms resolution