4_ smt160

Thread Starter

BorealDude

Joined May 20, 2013
9
hi

my question is about smt160.
i wanna use 4 sensors with an atmega16.
the problem is that i've only 3 timers to measure the dutycycle.
is there any software solution to this or i've to change my micro.

thanks
 

GopherT

Joined Nov 23, 2012
8,009
You can use interrupts and one timer.
1) Have the sensor trigger an interrupt,
Within the interrupt service routine...
2) have the Isr determine the delay time,
3) determine which sensor triggered the interrupt
4) record the time to memory register
5) make sure no other sensors have been triggered since the ISR started
6) reset the interrupt flag
7) exit the interrupt (continue into delay loop or do other work until next interrupt is called)
 

Thread Starter

BorealDude

Joined May 20, 2013
9
thank you my friend.
its ok for at most 3 sensors ( because we have only 3 external interrupts ).
what about for 4 sensors?
 
Thread starter Similar threads Forum Replies Date
B General Electronics Chat 0
B General Electronics Chat 0
B General Electronics Chat 1
Similar threads
running smt160
smt160
smt160
Top