Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 25, 2024, 01:01:44 01:01


Login with username, password and session length


Pages: [1]
Print
Author Topic: Pulse count from 2 channels  (Read 4405 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, 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?
Logged

Parmin
Hero Member
*****
Offline Offline

Posts: 582

Thank You
-Given: 494
-Receive: 133


Very Wise (and grouchy) Old Man


« Reply #1 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.
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, 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.
 
Logged
Basicpic
Newbie
*
Offline Offline

Posts: 20

Thank You
-Given: 9
-Receive: 43

Welcome! www.picbasic.ru


WWW
« Reply #3 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.
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