The Godfather talking
You can run, but you can't hide.
Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 11, 2016, 05:15:15 05:15


Login with username, password and session length


Pages: [1]
Print
Author Topic: Pulse count from 2 channels  (Read 1915 times)
0 Members and 1 Guest are viewing this topic.
Basicpic
Newbie
*
Offline Offline

Posts: 20

Thank You
-Given: 9
-Receive: 43

Welcome! www.picbasic.ru


WWW
« on: October 08, 2009, 03:28:47 15: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?
Logged

Parmin
Hero Member
*****
Offline Offline

Posts: 544

Thank You
-Given: 357
-Receive: 126


Very Wise (and grouchy) Old Man


« Reply #1 on: October 09, 2009, 12:30:25 00:30 »

put the inputs on separate interrupt on change pins.

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

If I have said something that offends you, please let me know, so I can say it again later.
fernandodiaz
Junior Member
**
Offline Offline

Posts: 73

Thank You
-Given: 1
-Receive: 18


« Reply #2 on: October 09, 2009, 08:31:11 20: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.
 
Logged
Basicpic
Newbie
*
Offline Offline

Posts: 20

Thank You
-Given: 9
-Receive: 43

Welcome! www.picbasic.ru


WWW
« Reply #3 on: October 13, 2009, 09:14:58 09:14 »

Thanks, I already realised through two counters tmr0 and tmr1. On overflow I increase values of variables of the first and second channels.
Logged

Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC