u need to find out how fast is the processor --> how long per
clock cycle ???
Assuming interrupt from hardware change processor flag...
Assuming it takes minimium 650 ms per heartbeart for a human
being
1) Write a delay procedure for 50ss
2) Write a delay procedure for 600ms
3) Write a counter to count the number of loop
4) Put some delay if u want
5) if flag not tigger, loop back to 3
6) Save data +delay = 50ms
7) Loop to 2
The number of clock cycle used in 3,4,5 can be used to calculate
the time taken... So for example, if the # of cycle used in 3,4,5
takes 1ms. Thus, the total time taken for 2 heartbeat is
(600+counter x 1 )ms
The rest should be easy...