On 29-11-2012 0:56, Michael Haberler wrote: > summary: high-speed HAL I/O without extra hardware & idle main cpu on TI > ARM335x omap processors > > -- > > ok, we have something working in HAL : > http://git.mah.priv.at/gitweb/emc2-dev.git/shortlog/refs/heads/arm335x-hal-pru-module > > this adds hal_pru if --with-platform=beaglebone is passed to configure > > hal_pru demonstrates: > > - initialisation and loading of code into a PRU > - start execution > - communicate with PRU through shared memory > - wiggling GPIO / led pins > - stop execution on module exit > > hal_pru can load code either into PRU 0 or 1. By default compiled-in > PRU code is used; an alternate .bin file can by passed with > prucode=<filename>. > > The PRU code examples do not demonstrate anything sensible (yet), this so far > has been > configuration plumbing and build support, plus integrating support code. I > have looked > through the stepgen, encoder and freqgen thread functions; it seems they > could be transliterated > into PRU assembly without much hassle; no multiply/divide used. The PRU code > isnt anywhere > elegant yet, the examples are based on stuff which I fished from the net. > > the PRU can accces 14 out GPIO pins and 17 GPIO in pins directly; > the rest can be accessed by the main CPU only, but overall that looks very > plush even for complex stepper configs. > > The TI pasm assembler and prussdriv UIO support is integrated into > configuration and build. > > for a look & feel of PRU assembly language, see: > http://git.mah.priv.at/gitweb/emc2-dev.git/blob/f94ce417fcff5cfc2223b9936d695a36b21a5c65:/src/hal/components/blinkleds.p > It's pretty straightforward, 40 or so instructions - 32 bit integer, > 5ns/cycle, no multiply/divide. > > To add some PRU assembly, add hal/components/foo.p - this will be compiled > into > rtlib/foo.bin (for loading with prucode=foo.bin) as well as > hal/components/foo_bin.h which > contains the code array - this can be included as default PRU code into a HAL > component, > see hal/components/hal_pru.c. It is a userspace module. > > External dependencies: the prussdrv UIO support expects a matching uio_pruss > kernel module, which > is loaded as needed by hal_pru as needed. This module is included in the > beaglebone kernel modules. > > as for the highest rate of pin wiggling, see this code example: > http://git.mah.priv.at/gitweb/emc2-dev.git/blob/f94ce417fcff5cfc2223b9936d695a36b21a5c65:/src/hal/components/maxrate.p > this needs some more extra setup in hal_pru - it will load and run but them > pins dont move, just FYI at this point. > > I've scoped 50Mhz pin toggle rate by similar code; a qualified rumor in the > TI ARM forum says 'this code shows a 200Mhz signal on the scope' - generated > by assembly code in the PRU, the main CPU doing nothing at all. > > > - Michael
Hi Michael, great job done! Some minor remark: I expect your code to generate a 66.7 MHz signal at 1/3 duty cycle. The rumoured 200 MHz is not feasible, the theoretical maximum is 100 MHz, but will be lower because you'll have to loop, unless you fill the entire program memory with SET and CLR instructions (assuming the programs counter wraps). BTW: Did you use the original assembler or my 'extended' version? -- Bas > > ------------------------------------------------------------------------------ > Keep yourself connected to Go Parallel: > INSIGHTS What's next for parallel hardware, programming and related areas? > Interviews and blogs by thought leaders keep you ahead of the curve. > http://goparallel.sourceforge.net > _______________________________________________ > Emc-developers mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/emc-developers ------------------------------------------------------------------------------ Keep yourself connected to Go Parallel: VERIFY Test and improve your parallel project with help from experts and peers. http://goparallel.sourceforge.net _______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
