Sonsivri

Electronics => Pic Basic Languages => Topic started by: Basicpic on October 08, 2009, 02:28:47 14:28



Title: Pulse count from 2 channels
Post by: Basicpic on October 08, 2009, 02:28:47 14:28
Please tell, how it is possible to consider quantity of impulses on two channels in PIC16f628/84 (or others)? Frequency of following of impulses - on the first channel is no more than 10 Hz, and on the second - 50 Hz there are more. Somebody has ideas?


Title: Re: Pulse count from 2 channels
Post by: Parmin on October 08, 2009, 11:30:25 23:30
put the inputs on separate interrupt on change pins.

on interrupt, check which pin is changed and add the count accordingly.


Title: Re: Pulse count from 2 channels
Post by: fernandodiaz on October 09, 2009, 07:31:11 19:31
Is too use timer0 and  timer1   hardware use as counters,
put in start bit  each timer  in a lapse 1 second  next stop timers    and extract values in adress timers, next reset values in timers and stratr timer and repeat secuency, this work fine for my, this metod use short code.
 


Title: Re: Pulse count from 2 channels
Post by: Basicpic on October 13, 2009, 08:14:58 08:14
Thanks, I already realised through two counters tmr0 and tmr1. On overflow I increase values of variables of the first and second channels.