Hello,
I am wanting to use the timer input capture mode on the LM3S8962. That mode is implemented on timer 0 and available as CCP0 pin on timer A and CCP1 on timer B. This assumes 16 bit mode where timer 0 split into 2 16 bit timers. The standard timer module only appears to support the 32 bit modes. Am I correct in that? I am assuming that I will need to code a platform specific module which I would call something like "lm3s.tmr16". Please confirm. Are there other platforms that provide timer input capture pins in the same way? Has this ever been discussed for adding to the standard tmr module? Thanks, Jim |
Mauricio Henrique Bomfim |
On Fri, Mar 23, 2012 at 3:04 PM, jrambo316 <[hidden email]> wrote:
> Hello, > > I am wanting to use the timer input capture mode on the LM3S8962. That mode > is implemented on timer 0 and available as CCP0 pin on timer A and CCP1 on > timer B. This assumes 16 bit mode where timer 0 split into 2 16 bit timers. > The standard timer module only appears to support the 32 bit modes. Am I > correct in that? > > I am assuming that I will need to code a platform specific module which I > would call something like "lm3s.tmr16". > > Please confirm. Are there other platforms that provide timer input capture > pins in the same way? Has this ever been discussed for adding to the > standard tmr module? Bogdan has implemented a very customized timer capture module for str9. We use it at PUC-Rio to implement a pulse counter from a truck odometer. Below, follows how we use its API: -- setup the timer id for timer capture str9.cap.setup( TIMER_ID, str9.cap.NEGEDGE ) -- just for compatibility with eLua interruption API cpu.set_int_handler( cpu.INT_TMR_CAPTURE, function() end ) -- enable the timer capture interruption cpu.sei( cpu.INT_TMR_CAPTURE, TIMER_ID ) -- gets the current counting and restart the counter to zero str9.cap.getcount( TIMER_ID ) I hope it helps. []s Mauricio > > Thanks, > Jim > > -- > View this message in context: http://elua-development.2368040.n2.nabble.com/LM3S8962-Timer-Input-Capture-Mode-tp7399429p7399429.html > Sent from the eLua Development mailing list archive at Nabble.com. > _______________________________________________ > eLua-dev mailing list > [hidden email] > https://lists.berlios.de/mailman/listinfo/elua-dev eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev |
Perfect! Do you have a link where I can look more closely at that implementation on github? That is the same purpose that I need the timer capture. Thanks, Jim |
Mauricio Henrique Bomfim |
On Mon, Mar 26, 2012 at 7:15 PM, jrambo316 <[hidden email]> wrote:
> > Mauricio Henrique Bomfim wrote >> >> Bogdan has implemented a very customized timer capture module for >> str9. We use it at PUC-Rio to implement a pulse counter from a truck >> odometer. Below, follows how we use its API: >> >> -- setup the timer id for timer capture >> str9.cap.setup( TIMER_ID, str9.cap.NEGEDGE ) >> >> -- just for compatibility with eLua interruption API >> cpu.set_int_handler( cpu.INT_TMR_CAPTURE, function() end ) >> >> -- enable the timer capture interruption >> cpu.sei( cpu.INT_TMR_CAPTURE, TIMER_ID ) >> >> -- gets the current counting and restart the counter to zero >> str9.cap.getcount( TIMER_ID ) >> >> I hope it helps. >> >> []s >> >> Mauricio >> >>> >>> Thanks, >>> Jim >>> >>> -- >>> View this message in context: >>> http://elua-development.2368040.n2.nabble.com/LM3S8962-Timer-Input-Capture-Mode-tp7399429p7399429.html >>> Sent from the eLua Development mailing list archive at Nabble.com. >>> _______________________________________________ >>> eLua-dev mailing list >>> eLua-dev@.berlios >>> https://lists.berlios.de/mailman/listinfo/elua-dev >> _______________________________________________ >> eLua-dev mailing list >> eLua-dev@.berlios >> https://lists.berlios.de/mailman/listinfo/elua-dev >> > > > Perfect! Do you have a link where I can look more closely at that > implementation on github? That is the same purpose that I need the timer > capture. It isn't on github because the customer business logic isn't open source. But we can share everything that isn't customer business logic. All files that implements the timer capture for str9 (which stay at src/platform/str9 directory) are available here http://dl.dropbox.com/u/1413610/elua_cap.zip . Notice that it was added at april 2011 and it is not merged with current eLua master branch. Tell us if it helps you. []s Mauricio > > Thanks, > Jim > > -- > View this message in context: http://elua-development.2368040.n2.nabble.com/LM3S8962-Timer-Input-Capture-Mode-tp7399429p7407691.html > Sent from the eLua Development mailing list archive at Nabble.com. > _______________________________________________ > eLua-dev mailing list > [hidden email] > https://lists.berlios.de/mailman/listinfo/elua-dev eLua-dev mailing list [hidden email] https://lists.berlios.de/mailman/listinfo/elua-dev |
Free forum by Nabble | Edit this page |