Hello everyone, I don't remember the details all that well but we have a function called PPWA that could be used for a 24 bit counter. One of the problems was that the result had to be held in two parameter RAM locations. That is, the Parameter RAM is 16-bits wide and the function needed 24 bits. The TPU microcode had to do two functions. One was to count incoming pulses and increment the lower word of the result. This worked OK. However, there was a possibility that an edge would come in while the TPU microcode was detecting a "roll over" in the lower word. When the roll over occurred, the microcode would increment the upper byte. When an incoming edge occurred while the microcode was trying to detect whether or not a roll over occurred, the algorithm got goofed up and really bizarre results would occur. The moral of this storey so far is that in writing your microcode, you have to be careful on how you handle "roll overs" of the lower part of the result with respect to also handling the incoming signal. You have to account for the case where the incoming signal creates an edge while the microcode is actually handling the roll over condition. Here is something that might help you. Take two PWM channels. Run one with an internal clock and the other with an external clock. Use the output of the first channel to drive the external TPU clock. This results in a 32 bit counter. The first 16 bits is associated with the first TPU channel and the second TPU channel contains the upper 16 bits. Anyway, hope that this might give you some ideas on implementing a 32-bit counter. Charlie -----Original Message----- From: Rod.Niner@... [mailto:Rod.Niner@...] Sent: Thursday, December 04, 2003 8:42 AM To: 68300@yahoogroups.com Subject: Re: [68300] 32 bit timer on TPU on 68376 Eric McRae - Electro-Logic Machines, Inc. 511 Root St., Port Townsend WA, 98368 Phone/Fax: 360.379.0969, http://www.elmi.com <http://www.elmi.com> wrote a timer32 that we use. Rod Niner GSE Scales 42860 Nine Mile Road Novi, MI 48375-4122 ph: 248.596.3350 rod.niner@... The information contained in this electronic mail transmission is intended by SPX Corporation for the use of the named individual or entity to which it is directed and may contain information that is confidential or privileged. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email so that the sender's address records can be corrected. <aage@...> 12/03/2003 06:40 PM Please respond to 68300@yahoogroups.com To <68300@yahoogroups.com> cc Subject [68300] 32 bit timer on TPU on 68376 Hello List, I am trying to write a 32 bit timer routine in TPU microcode for the TPU in a 68376. I seem to be having a timing problem when a match = $0000 (MRL = 1) and the micro instruction p:= ert; ram p -> @LYD_TIMER_B. For my application I need a high resolution (200nS) and measurements down to .1Hz. Has anybody been able to implement a 32 bit timer on the TPU to measure frequency. I would like to hear from somebody who any knowledge on the subject. Aage Christoffersen Lydatronic Brisbane, QLD Australia aage@... This message was sent through MyMail http://www.mymail.com.au <http://www.mymail.com.au> --------------------------------------------------- To unsubscribe from this group, send an email to: 68300-unsubscribe@yahoogroups.com To learn more about Motorola Microcontrollers, please visit http://www.motorola.com/mcu <http://www.motorola.com/mcu> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ <http://docs.yahoo.com/info/terms/> [Non-text portions of this message have been removed] Yahoo! Groups Sponsor ADVERTISEMENT <http://rd.yahoo.com/SIG=12c2fomtq/M=267637.4116732.5333197.1261774/D=egroupweb/S=1706554205:HM/EXP=1070635361/A=1853618/R=0/*http://www.netflix.com/Default?mqso=60178338&partid=4116732> click here <http://us.adserver.yahoo.com/l?M=267637.4116732.5333197.1261774/D=egroupmail/S=:HM/A=1853618/rand=660104781> --------------------------------------------------- To unsubscribe from this group, send an email to: 68300-unsubscribe@yahoogroups.com To learn more about Motorola Microcontrollers, please visit http://www.motorola.com/mcu <http://www.motorola.com/mcu> Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . [Non-text portions of this message have been removed]
Message
RE: [68300] 32 bit timer on TPU on 68376
2003-12-04 by Melear Charles-rdph40
Attachments
- No local attachments were found for this message.