On 1/21/2015 5:14 AM, [email protected] wrote: > > I have to study in depth the programming of PRU for encoders. I think you > have something about this (PRU encoder program). Is it working properly? > maximum > frequency that you got reading? any problem if I want to read 3 encoders at > time?
My PRU encoder code can be found here: https://github.com/machinekit/machinekit/blob/master/src/hal/drivers/hal_pru_generic/pru_encoder.p The PRU code is working as expected, although I have only tested it without index. Maximum frequency will depend on the PRU task period the way my HAL code is setup, but there's no reason it couldn't run really fast. The only limit to supporting multiple encoders is how many PRU direct input pins are available. You should be able to do three encoders with index assuming there are no pin conflicts with other required functions. More encoders could be supported if you used a single GPIO bank and did one GPIO read with the PRU each loop of the encoder logic. This adds about 160 nS to the loop time, but if the PRU isn't doing much else you should still be able to support encoder rates fast enough to be very useful (easily into the hundreds of KHz). -- Charles Steinkuehler [email protected] -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
