To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.handyboardOpen lugnet.robotics.handyboard in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Handy Board / 2296
2295  |  2297
Subject: 
Re: System Interrupts & frequency counting
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Mon, 9 Jun 1997 15:23:10 GMT
Original-From: 
Daniel Nicholas Horner <(horner@ecf.toronto)Spamless(.edu)>
Viewed: 
1466 times
  
  I'm in the middle of planning/writing a small program that will read a
digital input to determine it's frequency & pulse width. I thought it'd be
nice to have this part of the program (in assembly) running off the system
interrupt so that these various freqs. & PW are available "transparently"
to my C program (by passing the results into a C Global variable). The one
issue I'm wondering about is how my code will be affected if it is
executing still when the system generates an interrupt.

I'm unfamiliar with the workings of IC, but if your interrupt service
routine is sufficiently short, and you don't reset the interrupt mask to
enable recursive interrupts, you shouldn't notice the difference.

You asked if there was a more elegant way to do this... There's an
excellent one built in to the 6811 as the timer input capture register.
IC1/IC2 I think. The idea is that you can configure the chip to
automatically save the clock time in a register everytime a the level on
an input pin makes a transition. Then, all you have to do is poll this
register from your C code, or write an interrupt service routine to do it.

More elegant yes. Easier? You decide.
I don't know if these pins are free on the handy board, but it's worth
checking. The pink 68HC11 reference manual has assembly code snippets for
calculating the pulsewidth/frequency of a signal using timer input
capture.

Sorry I can't be more helpful, but it's been a while since I looked at
this.



Message is in Reply To:
  System Interrupts & frequency counting
 
I'm in the middle of planning/writing a small program that will read a digital input to determine it's frequency & pulse width. I thought it'd be nice to have this part of the program (in assembly) running off the system interrupt so that these (...) (27 years ago, 9-Jun-97, to lugnet.robotics.handyboard)

3 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR